0

I have made a navigation bar using <ul> and <li>

I would like to customize each tab with border, gradient etc.

Where should it be applied?

My CSS styling tend to affect only the letters, not anything else.

CSS

#nav { width: 100%; margin: 20px 0px 20px 0px; } #nav ul { padding: 12px 0px 12px 0px; border-top: solid black 1px; border-bottom: solid black 1px; } #nav ul li { display: inline; margin-left: 50px; font-weight: bold; background-color: grey; } 

HTML

<div id="nav"> <ul> <li>Home</li> <li>Files</li> <li>Info</li> <li>About</li> </ul> </div> 
3
  • We need to see your current code. Please edit your question, and paste (only) the relevant, necessary HTML and CSS. You can use a tool like jsfiddle.net in addition. If your question is closed, you can still add these important details and flag for reopening afterwards. Commented Sep 7, 2012 at 18:43
  • You're likely to get more help if you post what you have tried so far and what exactly you're trying to achieve. Commented Sep 7, 2012 at 18:44
  • Sorry guys, I see. Now I have added it! Commented Sep 7, 2012 at 19:56

3 Answers 3

1

'a' tags inside of a styled tag (such as an 'li' tag) will not pick up any of the styles you set. They want their own styles. You will need to move all the 'li' styles to the 'a' tag and then put a display:block; on the 'a' tag.

Sign up to request clarification or add additional context in comments.

Comments

1
#nav { width: 100%; margin: 20px 0px 20px 0px; } #nav ul { padding: 12px 0px 12px 0px; border-top: 1px solid black; border-bottom: 1px solid black; } #nav ul li { display: inline; margin-left: 10px; width:50px; height:20px; line-height:20px; font-weight: bold; background-color: grey; } 

Comments

0
a { display: block; // then whatever other rules you want to apply: width, height, border, pink flowers, etc } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.