April 13, 201115 yr Hi everyone, I want to make my primary nav a little more user friendly, by having not just the text itself as a link. But the area around it too. What is the best way to do this? Here's the link to the site - http://pt-academy.co.uk/ Cheers. Rich
April 13, 201115 yr Here's the typical navigation code block I use when I design my websites. /***NAVIGATION***/ .nav{ width: auto; font: 14px "Comic Sans MS",Verdana,Arial,Tahoma; margin: 0 10px; height: 40px !important; overflow: hidden; } .nav ul{ width: auto; margin: 0; text-align: left; height: 40px !important; overflow: hidden; } .nav ul li{ display: inline; } .nav ul li a{ color: #706150; padding: 10px 20px; margin: 0; text-decoration: none; text-shadow: #ffffff 1px 1px 1px; text-transform: lowercase; letter-spacing: .1em; line-height:40px; } .nav ul li a:hover{ background: url('../images/hav-hover.png') repeat-x center center; line-height:40px; } The .nav acts as the main container. The .nav ul allows me to align my navigational links (left, center, right). The main li tag is where I set my display time (inline is often best in my opinion), li a is where I define the padding and text style information. The line-height property is very important as it helps set the proper link block sizes. I started using this code a while back; I believe I whipped this up after watching several code styles over at DynamicDrive.com. If you would like to see a demo, here is a new design in which I applied the above CSS: http://www.sazzadhossain.org/portfolio/7arts/ Edited April 13, 201115 yr by Sazzad
Create an account or sign in to comment