简体   繁体   中英

CSS not changing the text color

Using Bootstrap4, have set up a div with the class of greenfooter (that takes care ofthe background color and padding), inside I created a container with four columns.

I set up the css to turn the H5 a lighter green color, and set the a tag to be white and lighter green/no text decoration when hovered.

The css code for the color change isn't working, and I think my css is incorrect, can anybody see where I went wrong?

html

    <div class="w-100 g-py-30 greenfooter">
        <div class="container">
            <div class="row">
            <div class="col-md-3">
                <h5>McDowell Technical<br>
                Community College</h5>
                <p>54 College Drive<br>
                  Marion, NC 28752</p>
                <p>
                <a href="https://www.google.com/maps/place/McDowell+Technical+Community+College/@35.6555866,-81.9620476,15z/data=!4m5!3m4!1s0x0:0xf42cd81f2a7dd3ec!8m2!3d35.6555866!4d-81.9620476" target="_blank" class="g-color-white">Get Directions</a> </p>
                <h5>call: 828-652-6021 </h5>
            </div>
            <div class="col-md-3"></div>
            <div class="col-md-3"></div>
            <div class="col-md-3"></div>
            </div>
        </div>
    </div>

css

    .greenfooter {
        background-color: #5C8627;
        color: white;
    }
    .greenfooter.container.row.col-md-3 h5 {
        color: #C8E72F;
    }

    .greenfooter.container.row.col-md-3 a {
        color: #ffffff;
    }

    .greenfooter.container.row.col-md-3 a:hover {
        color: #C8E72F;
        text-decoration: none;
    }

container is child of greenfooter class element so, a space is needed and so on for row, col-md-3 and h5

.greenfooter {
    background-color: #5C8627;
    color: white;
}
.greenfooter .container.row.col-md-3 h5 {
    color: #C8E72F;
}

.greenfooter .container .row .col-md-3 a {
    color: #ffffff;
}

.greenfooter .container .row .col-md-3 a:hover {
    color: #C8E72F;
    text-decoration: none;
}

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