Inline, Block, Inline-block elements 👉 Inline -  An inline element only takes up as much width as necessary. Here are the inline elements i...

Module 5.5 Box model, pseudo class, position


Inline, Block, Inline-block elements

👉 Inline - An inline element only takes up as much width as necessary.







👉 Inline-block - display: inline-block allows setting a width and height on the element.

display: inline-block, the top and bottom margins/paddings are respected

display: inline-block does not add a line-break after the element, so the element can sit next to other elements.

CSS Box model


Explanation of the different parts:

  • Content - The content of the box, where text and images appear
  • Padding - Clears an area around the content. The padding is transparent
  • Border - A border that goes around the padding and content
  • Margin - Clears an area outside the border. The margin is transparent

Pseudo class hover, focus, visited, first child, nth child 

<style>
Selector:hover {
style-name : style-value;
}
</style>

Pseudo-element before after

<style>
Selector::before{
style-name : style-value;
}
Selector::after{
style-name : style-value;
}
</style>

The position Property

There are five different position values:
  • static
  • relative
  • fixed
  • absolute
  • sticky

0 āĻŽāĻ¨্āĻ¤āĻŦ্āĻ¯(āĻ—ুāĻ˛ি):