How to cancel element padding in css

WBOY
Release: 2021-11-24 17:12:05
Original
4703 people have browsed it

In CSS, the padding attribute can be used to cancel the padding of the element. This property can set the value of the padding of the element. When the attribute value is 0, the padding of the element will be eliminated. The syntax is "element Object{padding:0px;}".

How to cancel element padding in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

How to cancel the inner margin of the element in css

In css, the padding attribute is used to cancel the inner margin of the element. The padding abbreviation attribute is in one Set all padding properties in the declaration. The example is as follows:

Create a new Clear Margins and Padding.html file, enter the HTML5 structure code, and modify the content in the title tag to: Clear Margins and Padding.

Define multiple tags, such as: div, span, etc., run the web page, right-click --> View elements, you can see that the body tag has margins (the yellow part is the margin), such as As shown in the picture:

How to cancel element padding in css

Use the * wildcard selector to set the margin and padding of all labels to 0px, and clear the inner and outer margins of all labels, as shown in the picture:

How to cancel element padding in css

Run the web page again and view the elements. You can see that the inner and outer margins have been cleared, as shown in the picture:

How to cancel element padding in css

In the above example, the padding attribute of the element has been cleared.

(Learning video sharing: css video tutorial)

The above is the detailed content of How to cancel element padding in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template