I have two sample programs as follows:
Program A:
<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<p style="float:left">This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</p>
<p>This is also some text. This is also some text. This is also some text. This is also some text. This is also some text. This is also some text.</p>
Program B:
<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<div style="float:left">This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</div>
<div>This is also some text. This is also some text. This is also some text. This is also some text. This is also some text. This is also some text.</div>
I have a few clarifications :
a) Although <p>
and <div>
are block elements , why is there a difference in display where <div>
is behaving a perfect inline-block type which is acceptable .
But why is the behaviour of <p>
element different here ?
tag defines a paragraph.** and **The