INR (₹)
India Rupee
$
Singapore Dollar

Block vs. Inline

Lesson 18/19 | Study Time: 10 Min
Block vs. Inline

⁕ Block elements can contain inline elements, but inline elements cannot contain block elements.
⁕ Block elements can be aligned using the margin property, but inline elements cannot be aligned using the margin property.
⁕ Block elements can be aligned using the text-align property, but inline elements cannot be aligned using the text-align property.
⁕ Block elements can have margins and padding, but inline elements cannot have margins and padding.
⁕ Block elements can have a width and height, but inline elements cannot have a width and height.
⁕ Block elements can have a border, but inline elements cannot have a border.
⁕ Block elements can have a background color, but inline elements cannot have a background color.
⁕ Block elements can have a line break before and after the element, but inline elements cannot have a line break before and after the element.

GDPR

When you visit any of our websites, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and manage your preferences. Please note, that blocking some types of cookies may impact your experience of the site and the services we are able to offer.