msphelix Posted July 24, 2012 Share Posted July 24, 2012 Hi,I'm testing out/learning CSS and applied the following style:#listitem{ display:list-item; color:red;} as follows:<p id="listitem">Why not just use a list?</p> I know the style works because the text was correctly red, but it did not display as a list-item = no bullet.Am I missing something?How do I get it to work?Thanks Link to comment Share on other sites More sharing options...
Ingolme Posted July 24, 2012 Share Posted July 24, 2012 Try setting the list-style-type property to see if something happens.What browser are you testing in? Link to comment Share on other sites More sharing options...
msphelix Posted July 25, 2012 Author Share Posted July 25, 2012 Foxy Mod,I'm using Firefox.I know how to use lists and list-style; that's not what I'm doing here.The w3schools CSS tutorial says display:list-item should style an item by giving it a bullet as if you were using a list. I don't know why you would want to do it with display instead of using a list but because they say you can, I'd like to know why it isn't working for me.See the w3schools CSS Reference for the display property: it shows an example where they create a <span> element with a red background and display:list-item and it shows the bullet. I just copied their code into my own html file and it doesn't work. If you don't know t he answer is there some way I can contact w3schools to ask them and actual get a response?thanks Link to comment Share on other sites More sharing options...
dsonesuk Posted July 25, 2012 Share Posted July 25, 2012 Apply a 15px margin to the left of the paragraph, the bullet is there but it requires margin to bring it into view, the example is within a container that is set away from edge so it shows. Link to comment Share on other sites More sharing options...
msphelix Posted July 26, 2012 Author Share Posted July 26, 2012 dsonesuk,Thanks, that worked 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