user2178841
user2178841

Reputation: 859

Borders are not not rounded in html

It's not to get others to debug your code but, I need a small help to sort this out.

<!DOCTYPE html>
<head>
</head>
<body id="menubody">
<ul class="menubar">
<li><a>CONTACTUS</a></li>
<li><a>ABOUTUS</a></li>
<li><a>HOME</a></li>
<li><a>LINKS</a></li>
</ul>
</body>
</html>

CSS:

* {
    margin:0px;
    padding:0px;
}
#menubody {
    font-size:120%;
    background-color:#D4F1FA;
    padding:50px;
}
.menubar {
    font-family:verdana;
    font-weight:bold;
    list-style-type:none;
    -moz-border-radius:15px;
    -webkit-border-radius:15px;
    border-radius:15px;
}
.menubar li {
    background-color:#A88314;
    width:159px;
    text-align:center;
    position:relative;
    float:left;
}
.menubar a {
    color:#144213;
    text-decoration:none;
    display:block;
    width:159px;
    height:40px;
    line-height:40px;
    background-color:#70FA6B
}
.menubar li:hover>a {
    background-color:#A88314;
    color:#DAECF2
}

The borders are not rounded. Any suggestions? :)

Upvotes: 0

Views: 119

Answers (1)

Javis Perez
Javis Perez

Reputation: 4350

Easy, your anchors doesnt have any border radius so overlaps the UL borders... apply a class to the first child, with a border radius on left corners (top and bottom) and another to last child with the same on right.

Something like this:

.menubar > li:first-child a {
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
}

.menubar > li:last-child a {
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
}

Any question, let me know

Upvotes: 1

Related Questions