HighDots Forums  

margins/padding for bulleted lists..

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss margins/padding for bulleted lists.. in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
maya
 
Posts: n/a

Default margins/padding for bulleted lists.. - 06-25-2008 , 11:23 AM






hi,

I'm having a problem w/bulleted lists.. as you know FF and IE do diff
margins/spacing for these, so have to do stuff like

/* IE: */
* html ul.headlines {margin-left:20px; margin-top:0px; }

/* FF: */
html> body ul.headlines {margin-left:-20px; margin-top:0px; }


two problems:

1) it looks diff in IE6 from IE7
2) the browser-specific "hack" for some reason is not working here..
code meant only for FF is picked up by IE and vice-versa...

this is for a bulleted list in a fairly small space (approx 250 x 300..)
so need to do very specific spacing..

would appreciate suggestions.. thank you..





Reply With Quote
  #2  
Old   
Johannes Koch
 
Posts: n/a

Default Re: margins/padding for bulleted lists.. - 06-25-2008 , 11:28 AM






maya schrieb:
Quote:
hi,

I'm having a problem w/bulleted lists.. as you know FF and IE do diff
margins/spacing for these, so have to do stuff like

/* IE: */
* html ul.headlines {margin-left:20px; margin-top:0px; }

/* FF: */
html> body ul.headlines {margin-left:-20px; margin-top:0px; }
Did you try both margin-left _and_ padding-left for both ul _and_ li?

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Reply With Quote
  #3  
Old   
John Hosking
 
Posts: n/a

Default Re: margins/padding for bulleted lists.. - 06-25-2008 , 11:41 AM



maya wrote:

Quote:
I'm having a problem w/bulleted lists.. as you know FF and IE do diff
margins/spacing for these, so have to do stuff like

/* IE: */
* html ul.headlines {margin-left:20px; margin-top:0px; }

/* FF: */
html> body ul.headlines {margin-left:-20px; margin-top:0px; }


two problems:

1) it looks diff in IE6 from IE7
Yes, because they're different browsers.
See http://msdn.microsoft.com/en-us/library/bb250496.aspx, especially
the "* HTML Filter" and ""html > body" child selector filter" sections.


Quote:
2) the browser-specific "hack" for some reason is not working here..
code meant only for FF is picked up by IE and vice-versa...
Look at both margin and padding.

Quote:
this is for a bulleted list in a fairly small space (approx 250 x 300..)
so need to do very specific spacing..
And I hope you're aware that the text may overflow your 250px or 300px
space anyway.

HTH

--
John
Pondering the value of the UIP: http://improve-usenet.org/


Reply With Quote
  #4  
Old   
maya
 
Posts: n/a

Default Re: margins/padding for bulleted lists.. - 06-25-2008 , 11:50 AM



Johannes Koch wrote:
Quote:
maya schrieb:
hi,

I'm having a problem w/bulleted lists.. as you know FF and IE do diff
margins/spacing for these, so have to do stuff like

/* IE: */
* html ul.headlines {margin-left:20px; margin-top:0px; }

/* FF: */
html> body ul.headlines {margin-left:-20px; margin-top:0px; }

Did you try both margin-left _and_ padding-left for both ul _and_ li?

actually this finally worked:

margin:7px 0px 15px 0px; padding:0px 0px 0px 20px;

looks decent in all three browsers, and didn't even have to do the
browser-specif hack....

thank you very much...





Reply With Quote
  #5  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: margins/padding for bulleted lists.. - 06-25-2008 , 04:02 PM



maya wrote:
Quote:
hi,

I'm having a problem w/bulleted lists.. as you know FF and IE do diff
margins/spacing for these, so have to do stuff like

/* IE: */
* html ul.headlines {margin-left:20px; margin-top:0px; }

/* FF: */
html> body ul.headlines {margin-left:-20px; margin-top:0px; }


two problems:

1) it looks diff in IE6 from IE7
2) the browser-specific "hack" for some reason is not working here..
code meant only for FF is picked up by IE and vice-versa...

this is for a bulleted list in a fairly small space (approx 250 x 300..)
so need to do very specific spacing..

would appreciate suggestions.. thank you..
No hack required, just the understanding that browsers choose different
default settings for margin and padding on ULs to produce the indent so
explicitly set both properties top get constancy....

ul.headlines { margin: 0 0 0 25px; padding: 0; }

Will look the same in all above.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #6  
Old   
Bergamot
 
Posts: n/a

Default Re: margins/padding for bulleted lists.. - 06-25-2008 , 04:43 PM




Jonathan N. Little wrote:
Quote:
ul.headlines { margin: 0 0 0 25px; padding: 0; }

Will look the same in all above.
No, I'm afraid it won't. IE puts the list marker in the UL padding,
which you've just blown away.
http://www.bergamotus.ws/samples/cross-browser-bullet-lists.html

--
Berg


Reply With Quote
  #7  
Old   
Ben C
 
Posts: n/a

Default Re: margins/padding for bulleted lists.. - 06-25-2008 , 05:00 PM



On 2008-06-25, Bergamot <bergamot (AT) visi (DOT) com> wrote:
Quote:
Jonathan N. Little wrote:

ul.headlines { margin: 0 0 0 25px; padding: 0; }

Will look the same in all above.

No, I'm afraid it won't. IE puts the list marker in the UL padding,
which you've just blown away.
http://www.bergamotus.ws/samples/cross-browser-bullet-lists.html
I don't know what IE does, but it shouldn't matter. The bullet is
supposed to be positioned a short distance from the left edge of the LI.

Either margin or padding on the UL should therefore result in some space
for the bullet, unless IE is so broken it positions the bullet relative
to the UL's left edge instead of relative to the LI's left edge.

The CSS 2.1 suggested default stylesheet has 40px left padding.


Reply With Quote
  #8  
Old   
Bergamot
 
Posts: n/a

Default Re: margins/padding for bulleted lists.. - 06-25-2008 , 05:45 PM




Ben C wrote:
Quote:
I don't know what IE does, but it shouldn't matter.
Perhaps it shouldn't, but it does.

Quote:
Either margin or padding on the UL should therefore result in some space
for the bullet,
Depending on the margin and padding values, there may be insufficient
space in IE. You'll end up with bullet markers disappearing altogether,
or cut off on the left edge. A disc marker looks like a half moon.

Quote:
unless IE is so broken it positions the bullet relative
to the UL's left edge instead of relative to the LI's left edge.
And there you have it.

--
Berg


Reply With Quote
  #9  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: margins/padding for bulleted lists.. - 06-25-2008 , 07:40 PM



Bergamot wrote:
Quote:
Jonathan N. Little wrote:
ul.headlines { margin: 0 0 0 25px; padding: 0; }

Will look the same in all above.

No, I'm afraid it won't. IE puts the list marker in the UL padding,
which you've just blown away.
http://www.bergamotus.ws/samples/cross-browser-bullet-lists.html

Hmmm funny thing is I do not see it.

http://www.littleworksstudio.com/temp/usenet/liststyle.jpg
liststyle.jpg (JPEG Image, 708x858 pixels)

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #10  
Old   
Stanimir Stamenkov
 
Posts: n/a

Default Re: margins/padding for bulleted lists.. - 06-26-2008 , 07:50 AM



Wed, 25 Jun 2008 11:23:22 -0400, /maya/:

Quote:
I'm having a problem w/bulleted lists.. as you know FF and IE do diff
margins/spacing for these, so have to do stuff like

/* IE: */
* html ul.headlines {margin-left:20px; margin-top:0px; }

/* FF: */
html> body ul.headlines {margin-left:-20px; margin-top:0px; }
Already answered, but described here, also:

Consistent List Indentation
<http://developer.mozilla.org/docs/Consistent_List_Indentation>

--
Stanimir


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.