Grand_master Posted March 8, 2006 Share Posted March 8, 2006 I have a simple question:What is the difference between an element with display:block and that is then floated, and another element with display:inline? Context: I see many tutorials on how to create horizontal navigation bars, some use display:inline (and that makes sense to me), but others use display:block and then float the list. What is the logic behind this?Thanks! Link to comment Share on other sites More sharing options...
Grand_master Posted March 8, 2006 Author Share Posted March 8, 2006 Oops, follow-up question: why after making the LI display block and floating it, why make the "a" element also display block? Here's the code I'm looking at: http://css.maxdesign.com.au/listamatic/horizontal10.htm Link to comment Share on other sites More sharing options...
boen_robot Posted March 8, 2006 Share Posted March 8, 2006 It's just that block elements have different abilities, which inline elements don't have and vice versa. For example, block elements can have explicit demensions, which is why sometimes you see links being displayed as blocks. I don't know other differences though. 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