WD 9. Inline&BlockElements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inline ans Block elements</title>
</head>
<body>
<!-- 1. "p" tag send 2nd paragraph to next line as default -->
<p style="border: 2px solid red;">This is a paragraph</p>
<strong style="border: 2px solid red;">This is a paragraph</strong>
<p style="border: 2px solid blue;">This is also a paragraph</p>
<a style="border: 2px solid blue;">This is also a paragraph</a>
<!-- 1. "span" tag send 2nd paragraph to same line as default -->
<!-- 2. it is happened bcz "span" tag is an inline element -->
<span style="border: 2px solid red;">This is a span</span><span style="border: 2px solid red;">This is also a span</span>
</body>
</html>
<!-- elements take up entire space are called block or block element always start from a new line-->
<!-- and elements that take only their space are called inline -->
#Output:
Comments
Post a Comment