How to set the size of div in html
This article mainly introduces how to set the size of div in html. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
Html div size setting method: in the div tag, use the style attribute to set the "width: width value + unit;" and "height: height value + unit;" style.
The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.
In HTML, you can define a separate block or an area part of a document.
Tags can divide a document into separate, different parts. It can be used as a strict organizational tool and is not associated with it in any format.
Div {border: 1px solid red;} Test text
You can see that the width of the div tag is full by default, and the height is the content height by default.
But we can resize div by manually styling it:
Just set the style "width: width value + units;" and "height: height value + units;" using the style attribute in the div tag.
Div {border: 1px solid red;} Test text
Effect picture:
The above is all the contents of the article "how to set the size of div in html". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!