Jump to content

Block and inline


Recommended Posts

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 post
Share on other sites

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...