I was asked a question, whats the difference between the following and I did not really know the answer. So here it goes, what is the difference between,
display:inline-block
display:inline
display:block
thanks for your answers…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The main one you are struggling with is inline-block from your comment under your question.
inline-block is a way to get block elements to appear inline, so instead of floating a load of divs left, you could use inline-block on them, preserving their behaviour as divs but making them inline elements instead.
For example lets say you have
This will render as
Where as
will display as
In addition, inline elements can’t have width/height attributes. Block elements can.
inline-blockmakes a block element look like an inline element but you can still apply styles that only block elements can have. See this demo.