Every element in HTML has display level. There are two types of display level which decide how it will display in browser.
Block-level elements always occupy full width in the browser. So new elements always starts with new line in browser.
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
p {
background-color: pink;
}
</style>
</head>
<body>
<p>This is block level element and occupy full width.</p>
<p>This is also block level element and will start on new line.</p>
</body>
</html>
The below is a list of few block-level elements.
Inline element doesn't starts from new line. It always start with left side of the document and only takes space as it require.
Below in example, span and a elements are inline elements.
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
span {
background-color: pink;
}
</style>
</head>
<body>
<div>This is block level element and <span>this is inline element.</span> The inline element <a href="#">starts from the left</a> side of element.</div>
</body>
</html>
The below is a list of few inline elements.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How to Create Custom Maintenance Page in Laravel 7.x Example
In this article, I will apportion you si...PHP array_combine method example
In this tutorial article, we have PHP ar...Most Powerful JavaScript Libraries Designed for Deep Leaning Devlopment
JavaScript, one of the core programming...How to Install Oh My Zsh in Ubuntu
Your terminal never felt this good befor...Node.js os Module
Node.js built-in os module returns basic...