SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,801
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)

    what's the default margin/padding on an OL?

    It's another one of my theoretical CSS questions that may or may not have an answer. How is default margin/padding on an OL calculated? I figure it varies by UA, but there must must be a pattern and a pattern must be being applied to cause the following observed behavior.

    Say you have an OL, with display-type:upper-roman; (because it's the most obvious) , and you HAVEN'T applied any sort of margin/padding reset, you will notice that the space used to accommodate the marker changes automatically. That is, there is AUTOMATICALLY more space if the list has 38 items (XXXVII) than if the list has 11 (VIII, being the longest). This leads me to believe that there must be a 'default' ( even if it's vendor specific) to let the list adjust the space of the longest maker. This seems nearly impossible to estimate manually ( that is if you allow a fixed amound of space, say 4em, and your list has 6-7 items it seems like execcive space but if your list has 28 items then it wont be enough space).
    Do any of the forum experts know what this property is? Is there anyway to go back to it after a reset?

  2. #2
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,518
    Mentioned
    61 Post(s)
    Tagged
    2 Thread(s)
    d_p, would you mind posting a sample of the code that you are testing? I tried this long ago and found the intentation to be 40px fixed. Had to manually pad to make room for long roman numbers. I don't remember ever seeing auto accommodation for romans. Would love to see it.

  3. #3
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    In IE8, there's certainly no adjustment to accommodate long numbers, when I get up to xxxviii, the first x is completely off screen, and some others are only half-visible.

  4. #4
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    As a note, if you have actual code using Roman numerals where you have to add padding back in, and the numbers are really so long that the padding matters, think of the children.


    Or, people reading your document.

    I'm thinking the nature of the cascade is going to stop you from going back to whatever was in the original user stylesheet. But you can check what's in that user stylesheet in the browsers' debuggers.

  5. #5
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    As a note, if you have actual code using Roman numerals where you have to add padding back in, and the numbers are really so long that the padding matters, think of the children.
    Be grateful you aren't in the UK. Our beloved* education minister thinks that children should know roman numerals. In particular, he thinks that 10 year olds should be able to read roman numerals up to 1000, or perhaps I should say M. http://www.guardian.co.uk/education/...-nqt-academies

    * OK, 'beloved' is not quite true. Everyone I know wishes that he had never been inflicted on this earth, but that's another matter, because we don't discuss politics here.

  6. #6
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by StevieD
    thinks that children should know roman numerals.
    I'm in total agreement with him. They should also have to add, subtract, multiply and divide those suckers. It teaches you how not freaking easy it was for humans to come up with the idea of numbers you can easily manipulate, and they'll gain appreciation for the brilliance of ancient Indian mathematicians.

    That said, I don't think we should actually inflict the common populace with roman numbers in lists, unless you're showing movie years (this is where I learned Roman numerals... wtf was MCMLXXXIV... ah yes).

  7. #7
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,518
    Mentioned
    61 Post(s)
    Tagged
    2 Thread(s)
    For those with a sense of humor, and a appreciation for "line art" - except for the color added to the ol element so the clipped characters would be obvious - this is a screen clip of my early experiment to see if css was bright enough to fulfill d_p's thoughts. It wasn't, so I learned. Enjoy a chuckle.
    greenbar.png

    (this is where I learned Roman numerals... wtf was MCMLXXXIV... ah yes).
    Ha, ha! Same here!

  8. #8
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,801
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Well I LOVE roman numerals, but I'm Italian! :P

    Anyway. I fell victim to an optical illusion. as Ronpat said it seems the default padding is ~40px. OF COURSE ( and I should have sen this) not mono spaced letter characters seem to occupy less space than arabic ( decimal) numbers. My bad.

    Nice catch Ron.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •