简体   繁体   中英

css border-radius is not applied

CSS border radius is not applied on navigation wrapper. Any ideas why?

Fiddle

Code:

HTML:

<div class="navigation">
    <div><a href="">Home</a></div>
    <div><a href="">Products</a></div>
    <div><a href="">Services</a></div>
    <div><a href="">Support</a></div>
    <div><a href="">Contact</a></div>
</div>
<div style="clear:both;"></div>

CSS:

.navigation {   
    position:relative;
    float:left;

    overflow:auto;

    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
}

.navigation div {
    position:relative;
    float:left;

    background: #484745;

    height:53px;
    line-height: 53px;
}

Give background-color to .navigation . Write like this:

.navigation {    
    background: #484745;
}

Check this: jsFiddle

Problem is with your background. Your divs' background hide border radius of .navigation . Just add background to .navigation (see http://jsfiddle.net/nDEmS/18/ )

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