Page 1 of 1

how to change height of LI

Posted: Tue Jul 10, 2007 2:30 am
by eshban
hi,

how can i set the height of LI border . i use the border-Left property to enable the browser.
i use this code.

Code: Select all

#topnav LI {
	PADDING-RIGHT: 12px; DISPLAY: inline; PADDING-LEFT: 12px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-LEFT: #d0d1d3 1px solid ; PADDING-TOP: 0px; 
}
the problem is border height is very large. how can i make it small.

thanks

Posted: Tue Jul 10, 2007 2:38 am
by Oren
Edit: Ignore the below post as it is not correct... I guess it's been a while since the last time I did client-side work :P

[ignore]
<li> is an inline element, thus you can't change its height/width. If you still wish to do that, you first need to change it to a block element with:

Code: Select all

display: block;
[/ignore]

Posted: Tue Jul 10, 2007 7:27 am
by superdezign
<li> is not an inline element.

Your code says "display:inline" though. Get rid of that part. If you want them to be next to each other, either float them, or try inline-block (not recommended).

Posted: Tue Jul 10, 2007 7:32 am
by Oren
superdezign wrote:<li> is not an inline element.
Correct... my bad :oops:

Posted: Tue Jul 10, 2007 10:06 am
by pickle
border-width is usually used to set the width of the border

Posted: Tue Jul 10, 2007 11:02 am
by superdezign
To extend on that, the shorthand for the border property is "width type color."

Code: Select all

border: 1px solid #000;

Posted: Tue Jul 10, 2007 10:25 pm
by s.dot
I know in IE, setting the height will work. I don't think it does in firefox though. However, setting a bottom and top margin will give you a height.

Posted: Wed Jul 11, 2007 2:29 am
by Rovas
scottayy wrote:I know in IE, setting the height will work. I don't think it does in firefox though. However, setting a bottom and top margin will give you a height.
It will work also in FF. Check your CSS and XHTML code for mistakes and then validate it. I had a similar problem with the distance (padding) between 2 li tags and the cause was that I forgot to close an li tag.

Posted: Fri Jul 13, 2007 4:32 pm
by RobertGonzalez
If you set the line height you can adjust the height of the side border on LI's as well.