Jump to content

ul, ol inconsistencies

Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

ul, ol inconsistencies Rate Topic: -----

#1 User is offline   sam 

  • W.R. Corporal
  • Group: Members
  • Posts: 117
  • Joined: 07-February 07
  • Gender:Male

Posted 26 April 2007 - 10:06 AM

I have noticed a lot of inconsistencies across browsers when its comes to ul and ol. This happens inspite of the reset * {margin: 0; padding: 0}. I am aware of the yui browser reset. But doesn't * cover everything ? If anybody has more information on this aspect please post. I assume * covers everything and inspite of that if they have taken the pains to list out each element, there must be a reason I suppose.
0

#2 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 26 April 2007 - 12:26 PM

Once you've used the asterisk/reset 'feature' that you've described, it certainly pulls all browsers into alignment in regards to... well, margin and padding.

After that, though, you should then define what you want what the ul, ol, and li's will do. Like so...

* {margin:0; padding:0}
ul, ol {padding-left:1.5em;}
li {margin:.25em .5em;}

etc.
0

#3 User is offline   sam 

  • W.R. Corporal
  • Group: Members
  • Posts: 117
  • Joined: 07-February 07
  • Gender:Male

Posted 26 April 2007 - 03:24 PM

But I see inconsistencies even after using the asterisk reset feature in ol' and ul' between IE6 IE7 and firefox. I am guessing its line height that is different but I am not sure. I will have to test that sometime. But this is after the reset before any margin or padding is given.

Edit - can't reproduce what I was talking about right now... I guess I will come back when I run in to it. :(

This post has been edited by sam: 26 April 2007 - 04:05 PM

0

#4 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 26 April 2007 - 09:06 PM

Are you using a Strict DOCTYPE?
0

#5 User is offline   sam 

  • W.R. Corporal
  • Group: Members
  • Posts: 117
  • Joined: 07-February 07
  • Gender:Male

Posted 26 April 2007 - 10:08 PM

Any advantages using a strict doc type in this regard ?

This post has been edited by sam: 26 April 2007 - 10:28 PM

0

#6 User is offline   Ryan Fait 

  • W.R. Sergeant
  • Group: Members
  • Posts: 204
  • Joined: 07-January 07
  • Location:Las Vegas

Posted 27 April 2007 - 01:59 AM

I use this one, personally. Maybe this will help:

* {
  margin: 0;
  padding: 0;
  list-style: none;
}

The commercial front for my freelance web design company.
0

#7 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 27 April 2007 - 04:57 AM

View Postsam, on Apr 26 2007, 11:08 PM, said:

Any advantages using a strict doc type in this regard ?

There certainly are, and while I'm not entirely sure of the hows and whys, I do know that using a Strict DOCTYPE helps the browser to render the code in ways more expected to you.

If it's convenient for you to change the DOCTYPE, it can't hurt, at the very least to see if it solves this one problem you're having.
0

#8 User is offline   sam 

  • W.R. Corporal
  • Group: Members
  • Posts: 117
  • Joined: 07-February 07
  • Gender:Male

Posted 27 April 2007 - 10:12 AM

Ok I have switched to XHTML 1.0 strict. Didn't seem to make any difference but I agree and will stick with XHTML strict from now on. The situation that I mention above in this thread pops up when you <a> nested in <li>'s. Firefox and Opera agree while IE's have their style or mess, whatever one would like to call it.

Thanks Ryan that piece of code is always up top my style sheets by default.
0

#9 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 27 April 2007 - 10:25 AM

View Postsam, on Apr 27 2007, 11:12 AM, said:

Ok I have switched to XHTML 1.0 strict. Didn't seem to make any difference but I agree and will stick with XHTML strict from now on. The situation that I mention above in this thread pops up when you <a> nested in <li>'s. Firefox and Opera agree while IE's have their style or mess, whatever one would like to call it.

Thanks Ryan that piece of code is always up top my style sheets by default.

Ahar, I didn't know there were anchors in there... this might help ya: http://www.456bereastreet.com/archive/2006...st_items_in_ie/
0

#10 User is offline   sam 

  • W.R. Corporal
  • Group: Members
  • Posts: 117
  • Joined: 07-February 07
  • Gender:Male

Posted 27 April 2007 - 05:32 PM

Thanks Marc you are the man ! I have used negative top margin to beat IE devils in to place. But this solution seems promising. I see that many others have reported other solutions on the same page. Which one works for you the best ?
0

#11 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 27 April 2007 - 06:01 PM

View Postsam, on Apr 27 2007, 06:32 PM, said:

Which one works for you the best ?

I personally use the one Roger recommends in the posts itself. Glad it worked out for you :borat:
0

#12 User is offline   sam 

  • W.R. Corporal
  • Group: Members
  • Posts: 117
  • Joined: 07-February 07
  • Gender:Male

Posted 27 April 2007 - 06:39 PM

But with Roger's method the a element becomes like a button with the area around a text becoming "clickable". How would you do it if you would like just the text and not the area around it to be active ?
0

#13 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 27 April 2007 - 11:34 PM

View Postsam, on Apr 27 2007, 07:39 PM, said:

But with Roger's method the a element becomes like a button with the area around a text becoming "clickable". How would you do it if you would like just the text and not the area around it to be active ?

I'm way too tired at the moment to look into his method, but I can tell you that anywhere it says 'display: block;' in the CSS, is what is doing it. If not 'display: block;', then it is some other block-level value. Removing that will remove the effect you mentioned, but then it may ruin the IE6 fix.

May I ask why you'd like only the text to be clickable? In general, the more of a target area you can give to your visitors, the better.
0

#14 User is offline   sam 

  • W.R. Corporal
  • Group: Members
  • Posts: 117
  • Joined: 07-February 07
  • Gender:Male

Posted 28 April 2007 - 07:10 PM

I agree with the greater target area. Its easier for people to click around. But sometimes people happen to want only the text to be clickable... Thanks for the info and the link Marc. I learned some new stuff reading that post. :)
0

#15 User is offline   lwaxhaxnc 

  • W.R. Private
  • Group: Members
  • Posts: 14
  • Joined: 24-September 11

Posted 24 September 2011 - 01:20 PM

I have used negative top margin to beat IE devils in to place. But this solution seems promising. :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users