Coming as a beginner into HTML can be difficult, especially for the amount

of default properties and behaviors that are in place and nobody tells you about it. In this article, I am going to show you how these things work, how you can modify their default behavior, and help you get a better understanding of HTML that will be useful any time there is a roadblock in the rendering of your page.

The rendering flow of elements inside an HTML document depends on a property called display, this property sets how the item is going to behave inside the page. There are two default values for all the elements: block and inline. Let’s talk about block first, this property value sets the element to occupy all the available space in the same line. In other words, it generates a line break before and after the item so no other element renders next to it, making the next item in the code rendered below the block element.

As for inline property value, it makes the next element render where the previous one ends, creating a line of items if there is space available. However, they take only the necessary space to fit the content and their dimensions can’t be changed.

All the HTML elements have a default display value. Elements with the

block display property value include but are not limited to:

, ,

,
    ,
      and
      . On the other hand, some of the elements with inline default value are: , and . For the full list of

      elements you can got the these websites  for block elements and inline elements.

      There are a variety of display properties that can be used to change the way you document is rendered. Some of them like flex or grid are a whole world on their own, but we will focus on the simpler ones that will help you to have better control over your elements.

      As we said, the default for every HTML element goes between _block _or inline, but there is a third display property that combines the best of both worlds. The inline-block property will allow your element to behave like an inline element, meaning that other elements can be next to it, but it will also allow you to control its height and width so you can make it as big and wide as you want. This is extremely helpful especially when you want to put images next to text without using float.

#learning-html #web-design #learning-to-code #secrets #microverse #html-css #html #html-fundamentals

The Essential HTML Basics Guide for Beginners
1.55 GEEK