Exploring the world of web design as a recent enthusiast, I delved into the basics some time ago only to forget them shortly after. My interest reignited a few months back, leading me to create my own web pages for practice and skill enhancement. However, I've hit a roadblock with my navigation bar display. Here is the HTML code snippet for my navigation bar:
<div class="nav">
<ul class="nav">
<li class="nav"><a class="nav" href="#">Home</a></li>
<li class="nav"><a class="nav" href="#">Coffee</a></li>
<li class="nav"><a class="nav" href="#">Food</a></li>
<li class="nav"><a class="nav" href="#">Catering</a></li>
<li class="nav"><a class="nav" href="#">About</a></li>
<li class="nav"><a class="nav" href="#">Contact</a></li>
</ul>
</div>
<!--Navigation bar.-->
Below is the CSS code that pertains to the elements (div, ul, li & a):
div{
border: 2px;
border-radius: 3px;
margin: 0 auto 60 auto;
padding: 10px;
width: 980;
}
/*BASIC DIV ELEMENT.*/
/*LINKS.*/
a{
color: #545454;
font-family: lucida grande, lucida sans, sans-serif;
font-size: 14px;
text-decoration: none;
}
a:hover, a:active {
color: #191919;
}
/*LINKS.*/
/*NAV BAR*/
a.nav:link{
background-color: #D7C5CC;
color: #191919;
display: inline-block;
padding: 15px;
text-align:center;
width: 90px;
}
a.nav:hover{
color: #191919;
background-color: #EDD9DF;
}
li.nav{
float: left;
}
ul.nav{
display: center;
margin: 0 auto 0 auto;
}
/*NAV BAR*/
My knowledge of HTML and CSS is at a beginner level, so I apologize for any mistakes in the coding. The issues I'm facing with my navigation bar are twofold:
- I am unable to achieve proper round corners for the navigation bar. I've attempted setting "border-radius: 10;" on ul.nav and li.nav without success.
- The centering of the navigation bar on my Chrome testing page has proven to be a challenge. While other divs center flawlessly, my efforts to modify "display" and "float" attributes have been fruitless.
Despite searching extensively on Stackoverflow, none of the solutions provided have yielded the desired outcome.
EDIT: My objective is to create a seamless navigation bar where only the outer corners are rounded, akin to the design showcased here: