it's important to note that even though you can't set width, you can set margin and padding on inline elements, which can be really useful...
 
for example, i've used a trick from Eric Meyer's first book on some of my sites and created a special 'opens a new window' class of <a> that includes a little icon next to it. you create a little bit of padding in the <a> then apply the icon as a static background placed within the padding. it's useful to visually communicate that the link will open in a new window...
 
s:r
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Chris Stratford
Sent: Wednesday, July 14, 2004 6:57 PM
To: [EMAIL PROTECTED]
Subject: Re: [WSG] setting width for <li>s when inline

hope someone finds this discussion useful.

Yes I do!

I have also wondered why this happens.

I mean, because something is INLINE, doesn't mean it shouldn't be able to have a set width...
I would think its more of a reason to set a width, because it is being set inline with another element - so the width is important.??

I had the same issues, and always I end up forgetting the whole idea, and just throwing away all the navigation code i make.

Thanks for the discussion :)

Scott Reston wrote:
Tania - you're correct. The "display:inline" turns out to be, er, vestigal and the effect works fine without it. What I was worried about is why is "float:left" was allowing me to give the <li> a width. But... with the "display:inline" out of the way, the <li> is a block-element, so applying width is OK.
 
Is the issue that giving an element float makes the browser treat it as a block element?
 
Thanks for bearing with me, everyone... hope someone finds this discussion useful.
 
s:r

Reply via email to