Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Making background color wider in nav
Old 11-26-2007, 07:51 AM Making background color wider in nav
Super Talker

Posts: 133
Name: Jess Weiss
Location: Massachusetts
Trades: 0
Hi all - I've been working on this site:

http://www.ansaphone.com/

I want to make the background color in both the a: hover state and in the nav_here element "wider" - as in I want it to take up more space around the text, and leave less white space between the vertical lines. Any thoughts? As always, TIA!
__________________
"If you worried about falling off the bike, you'd never get on it" - Lance Armstrong

"The problem with people who have no vices is that generally you can be pretty sure they're going to have some pretty annoying virtues." - Elizabeth Taylor
lynnema is offline
Reply With Quote
View Public Profile Visit lynnema's homepage!
 
 
Register now for full access!
Old 11-26-2007, 09:59 AM Re: Making background color wider in nav
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you can't.
anchor elements <a> are inline elements that are only as wide as the content,

To change it you would need to have the anchor elements with display:block then "float" them with a set width inside a parent container.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-26-2007, 10:58 AM Re: Making background color wider in nav
Super Talker

Posts: 133
Name: Jess Weiss
Location: Massachusetts
Trades: 0
Bummer. What if I used a background image instead of a background color? Would that do it, or would I still have to do the block, float combo?
__________________
"If you worried about falling off the bike, you'd never get on it" - Lance Armstrong

"The problem with people who have no vices is that generally you can be pretty sure they're going to have some pretty annoying virtues." - Elizabeth Taylor
lynnema is offline
Reply With Quote
View Public Profile Visit lynnema's homepage!
 
Old 11-26-2007, 12:00 PM Re: Making background color wider in nav
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
same thing;

here's one way of achieving the look

HTML Code:
<ul id="nav">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
<li><a href="#">Link 5</a></li>
<li><a href="#">Link 6</a></li>
</ul>
Code:
/* CSS code*/
ul#nav {
	color:green;
	}
ul#nav li {
	list-style-type:none;
	width:15%;
	float:left;
	border:0 none transparent;
	border-right:1px solid #000000;
}
ul#nav li a {
	display:block;
	text-align:center;
	background-color:grey;
	color:blue;
	border:0 none transparent;
}
ul#nav li a:hover {
	display:block;
	text-align:center;
	background-color:#00CC00;
	color:red;
	border-bottom:2px dashed black;
}
and it can be seen at
http://www.candsdesign.co.uk/article...tal-textlinks/
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Making background color wider in nav
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16386 seconds with 12 queries