简体   繁体   中英

CSS3 vs Angular Material CSS

I have a ul, li design css which works good on bootstrap. When I use the same on Angular material project, Angular material css is blocking that css code to work.

css code:

li {
    width: 2em;
    height: 2em;
    text-align: center;
    line-height: 2em;
    border-radius: 1em;
    background: dodgerblue;
    margin: 0 1em;
    display: inline-block;
    color: white;
    position: relative;
}

    li::before {
        content: '';
        position: absolute;
        top: .9em;
        left: -4em;
        width: 4em;
        height: .2em;
        background: dodgerblue;
        z-index: -1;
    }


    li:first-child::before {
        display: none;
    }

.active {
    background: dodgerblue;
}

    .active ~ li {
        background: lightblue;
    }

        .active ~ li::before {
            background: lightblue;
        }

Html code:

<link rel="stylesheet" href="app/css/style.css">
<link href="master/libraries/angular-material/angular-material.css" rel="stylesheet" />

On including material css link, my design is not working as expected. But, I need that to get work.

Maybe you should try to add your css after angular material css like this:

<link href="master/libraries/angular-material/angular-material.css" rel="stylesheet" />
<link rel="stylesheet" href="app/css/style.css">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM