【问题标题】:How to display the progress wizard vertically using css in angular如何使用角度中的css垂直显示进度向导
【发布时间】:2020-06-24 03:07:02
【问题描述】:

我正在开发进度向导,我创建了一个水平进度向导,所以在这里我如何使它成为垂直或有任何库?

下面是我的 stackblitz 网址 https://stackblitz.com/edit/angular-ivy-n6dp3x

css:

ul {
    display: flex;
    align-items: stretch; /* Default */
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

li {
    display: block;
    flex: 0 1 auto; /* Default */
    list-style-type: none;
    background-color: white;
    padding: 0 0.75em;
    z-index: 1;
}

li:first-child {
    padding-left: 0;
}

li:last-child {
    padding-right: 0;
}

ul:after {
    content: '';
    border-bottom: 1px solid lightgray;
    position: absolute;
    transform: translateY(-50%);
    top: 50%;
    width: 100%;
}

【问题讨论】:

    标签: javascript css angular sass


    【解决方案1】:

    使用flex-direction: column; 垂直显示li 并使用左边框设置高度。

    ul {
        display: flex;
        align-items: stretch; /* Default */
        justify-content: space-between;
        width: 100%;
        margin: 0;
        padding: 0;
        position: relative;
    }
    
    li {
        display: block;
        flex: 0 1 auto; /* Default */
        list-style-type: none;
        background-color: white;
        padding: 0 0.75em;
        z-index: 1;
    }
    
    
    ul {
      flex-direction: column;
    }
    
    li {
      height: 40px;
      margin-left: 55px;
    }
    
    ul li:before {
        /* lines */
        content:"";
        position: absolute;
        left: 50px; /* adjust manually */
        border-left: 1px solid lightgray;
        height: 60px;
        width: 1px;
        margin: 20px;
    }
    <ul>
      <li>1</li>
      <li>2</li>
      <li>3</li>
      <li>4</li>
    </ul>

    【讨论】:

    • 它对我没有用,你能改变我的 stackblitz url 吗?
    • 它现在可以工作了,如果我想在
    • 1
    • 旁边显示任何内容,有一点疑问吗?说一段
    猜你喜欢
    相关资源
    最近更新 更多
    热门标签