CSS DIV width and height settings

 DIV means a block. Since it is a block, of course you can set its width and height. To set the DIV width, you can use width to set the value, and you can also set the height with height. Almost all mainstream browsers support DIV For the attributes of width and height, please see the following syntax examples.


DIV width and height example

<div style="width:300px;height:60px;border:3px #cccccc dashed;"></div>


Present results

The example we set width = 300px mean div width 300px, height is set to 60px (height: 60px), in order to allow another example can be more clearly presented, we also set the border ( border ) thickness 3px, color is gray (#Cccccc) and the line is a dashed line (dasched).

Post a Comment

0 Comments