DIV
This type of layer (box) will generate a line break as a result.
SPAN
This is a neutral element, which means that it won't add anything (unless you indicate so, using styles).
I will now show you the clear difference between those two.When we introduce a span in any text, it can be read without any problems.But if we use the div layer it will introduce a line break in our text.
Look at this example:
This car is dark<span> red,</span> but the other one is blue.
This car is yellow,<div>while <div>the other one is green.
This car is dark red, but the other one is blue.
This car is yellow,
while
the other one is green.
No comments:
Post a Comment