How to set a label location by html
This article mainly introduces the html how to set a tag location, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Setting method: 1, add "position: relative;" style to the parent tag of a tag for relative positioning; 2, add "position: absolute;" style to a tag for absolute positioning; 3, use top, bottom, left, right attributes to control the position of a tag.
The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.
In html, you can use the position attribute to set the a tag location:
Add "position: relative;" style to the parent tag of a tag for relative positioning
Add "position: absolute;" style to a tag for absolute positioning
Use the top, bottom, left, right attributes to control the position of the a tag.
Div {width: 300px; height: 200px; background-color: yellow; position: relative;} a {position: absolute Top: 50px; left: 50px;} I am an a tag
Description:
The position attribute specifies the type of positioning method for an element (static, relative, absolute, or fixed).
Relative: a relative positioning element is generated and positioned relative to its normal position. Therefore, "left:20" adds 20 pixels to the LEFT position of the element.
Absolute: an element that generates absolute positioning, relative to the first parent element other than static positioning. The location of the element is specified by the "left", "top", "right", and "bottom" attributes.
Thank you for reading this article carefully. I hope the article "how to set a tag location for html" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!