Home >Web Front-end >CSS Tutorial >How to clear margins in css
How to clear margins in css: 1. Use the margin attribute to clear the outer margin of the element, the syntax is "element {margin:0px;}"; 2. Use the padding attribute to clear the inner margin of the element, the syntax is " Element {padding:0px;}".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
How to clear margins in css
1. Create a new Clear Margins and Padding.html file and enter the HTML5 structure code , modify the content in the title tag to: clear the outer margins and inner margins, define multiple tags, such as: div, span, etc.
Run the web page, right-click --> View elements, you can You can see that the body tag has margins (the yellow part is the margin), as shown in the picture:
css video tutorial)
The above is the detailed content of How to clear margins in css. For more information, please follow other related articles on the PHP Chinese website!