How to adjust the position of html content: First create two div containers in the html file, set the style of the class attribute in the style tag; then set the height, width and color.
The operating environment of this tutorial: windows7 system, html5 version, DELL G3 computer.
How to adjust the position of html content:
1. Use the float attribute of CSS to adjust the position in html. For detailed usage, first create two div containers in the html file to facilitate demonstration effects. Add h2 tags to the containers and set different text for easy distinction:
##2, div The tag gives it the style of the class attribute set in the style tag, giving it height, width and color. One of the h2 tags uses the float attribute, and the other does not. The role of the float tag here can be to display the text on the left or right, or it can be set to empty. Finally, Crtl+S saves the file: 3. Open the browser and you can see two The text positions in the two divs are not the same. The text with the float tag is set to the right position. The above is how to adjust the text position in html:Related learning recommendations:
The above is the detailed content of How to adjust the position of html content. For more information, please follow other related articles on the PHP Chinese website!