HTML Elements: Block Level and Inline Level

How many you know about this topic? Which html element is called block level and which is inline? I’m afraid most of you don’t have the proper knowledge. So, let’s discuss about it here, assuming you know the CSS.

Block level element is that which have by default the CSS property “display: block“, goes across the browser window when placed in an html document without any CSS properties applied. HTML tags in this category are div, p, form, heading tags following h1 to h6 etc. You can try it by yourself placing some elements. In other words, the element which by default, if placed after an element, starts from next line is block level element. CSS is very powerful that we can convert block level to inline level by applying attribute “display: inline“.

Now, talking about inline level element, I don’t have to tell further about it considering above discussion. But here, one new CSS attribute “display: inline-block” also. Inline level element doesn’t support width, height, margin and/or padding CSS attributes unless you make it “display: block” or “display: inline-block“. You need to add “display: inline-block” when you need two elements on the same line and with their margin, padding, width and/or height attributes. Or, if you need the inline elements to be appeared in next line, you have to add “display: block” attribute. In this way you can also skip “<br/>” (inline elements need <br/> tag for line break) tag for line breaks. HTML tags in inline level category are a, font, strong, span, strong etc.

Basic is Advanced

Know the real field, not topics or subjects

Classes run by highly professional trainers with several years of experience and with completely unique and real field learning techniques, we are now running comprehensive IT Training Classes, very far from traditional training methods. It’s time to change your vision that comes first when you think about a general training institute.

View courses   Enroll for a course