Jonas Posted April 28, 2006 Share Posted April 28, 2006 Does anyone know how to put list items display: inline; and yet have them show the numbers? This is really starting to annoy me... Link to comment Share on other sites More sharing options...
boen_robot Posted April 28, 2006 Share Posted April 28, 2006 I don't think such thing is possible. Changing the display property of an item also turns off the default styling of the browser, thus eliminating the number. Adding list-style wouldn't work either scince list-style is applyed only to list items, not inline elements.If the actual idea is to have the list show in one row, such as1. Foo 2. More foo 3. Big fooYou could use the :before pseudo class, but as we know, it won't work in IE. Link to comment Share on other sites More sharing options...
johneva Posted April 28, 2006 Share Posted April 28, 2006 Does anyone know how to put list items display: inline; and yet have them show the numbers? This is really starting to annoy me...<{POST_SNAPBACK}> Use float: left; instead of display: inline;heres a quick example.<html><head><title>example</title><style>ol { float:left; } li { float:left; margin:15px; padding:0; }</style></head><body><ol><li><a href="/1">Link 1</a></li><li><a href="/2">Link 2</a></li></ol></body></html> Ya like that dont ya. Link to comment Share on other sites More sharing options...
Jonas Posted April 28, 2006 Author Share Posted April 28, 2006 Don't like that, because it doesn't work. Link to comment Share on other sites More sharing options...
johneva Posted April 28, 2006 Share Posted April 28, 2006 Don't like that, because it doesn't work. <{POST_SNAPBACK}> Sure it does did you copy it?The thing you do have to watch out for is the diffrence in margin between IE and FF but you already know that. Link to comment Share on other sites More sharing options...
Jonas Posted April 28, 2006 Author Share Posted April 28, 2006 Doesn't work in Opera, which is the browser I use. Link to comment Share on other sites More sharing options...
johneva Posted April 28, 2006 Share Posted April 28, 2006 Doesn't work in Opera, which is the browser I use.<{POST_SNAPBACK}> AhhhhhYeah I never tested it in Opera I only tested it in Firefox and IE.DamnNa dont know of any other way. Link to comment Share on other sites More sharing options...
Jonas Posted April 28, 2006 Author Share Posted April 28, 2006 If the actual idea is to have the list show in one row, such as1. Foo 2. More foo 3. Big fooYou could use the :before pseudo class, but as we know, it won't work in IE.<{POST_SNAPBACK}> How could you use the :before pseudo class actually? I know how to do it with one sign or something, but for the number (and the :before content) to change for each element? I don't know how that would work. Link to comment Share on other sites More sharing options...
Err Posted April 29, 2006 Share Posted April 29, 2006 would it be too much trouble some to just add the numbers in there manually? Link to comment Share on other sites More sharing options...
Jonas Posted May 1, 2006 Author Share Posted May 1, 2006 would it be too much trouble some to just add the numbers in there manually? <{POST_SNAPBACK}> It's quite a long list, which is also why I don't want it to use one line for each number... :| Link to comment Share on other sites More sharing options...
boen_robot Posted May 1, 2006 Share Posted May 1, 2006 How could you use the :before pseudo class actually? I know how to do it with one sign or something, but for the number (and the :before content) to change for each element? I don't know how that would work. I was starting to ask myself this the second I posted this post, but then again, I saw the CSS2.1 specification, which I think holds the plausable answer. However I have no idea which browsers support the needed content values. Look at the content property for starters. There, you'll also find the counter function.As for the odd behaviour of Opera... could it be a browser bug? Should we report it to Opera (I have the latest build of Opera 9 beta and the bug still exists, so who knows...). Link to comment Share on other sites More sharing options...
Kosher Kid Posted May 2, 2006 Share Posted May 2, 2006 i've been following the discussion thread because I've been trying to do the same thing myself.the code johneva posted worked fine for me in firefox but when i opened the page in i.e, the list displayed inline but the numbers weren't there. it's i.e. 6 bty.is there something i'm missing? Link to comment Share on other sites More sharing options...
johneva Posted May 2, 2006 Share Posted May 2, 2006 Na your right I just did not test it properly in all browsers. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now