Thursday, September 13, 2012

Layers

Layers are a very used method by web pages using CSS  to customize them.You must imagine that a  layer is like a simple box we position on our web (we can give this box different color, position, form, dimensions...) and in the inside of it we will introduce the code preferred by us.I will now explain you the two type of layers that exist.They are very similar, but with one little exception.

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