How to use css margin-bottom property

青灯夜游
Release: 2019-05-29 11:51:45
Original
4127 people have browsed it

css margin-bottom property is used to set the bottom margin of an element, allowing negative values. All major browsers support the margin-bottom attribute.

How to use css margin-bottom property

How to use the css margin-bottom property?

The margin-bottom attribute sets the bottom margin of the element.

Setable attribute values:

● auto: The browser calculates the lower margins.

● Length: Specifies the bottom margin value in specific units, such as pixels, centimeters, etc. The default value is 0px.

● %: Specifies the bottom margin as a percentage of the width of the parent element.

● Inherit: Specifies that the margins should be inherited from the parent element.

Description: This attribute allows negative values.

Note: All major browsers support the margin-bottom attribute.

css margin-bottom property example

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
p.bottommargin {margin-bottom: 2cm}
</style>
</head>
<body>
<p>这个段落没有指定外边距。</p>
<p class="bottommargin">这个段落设置了2厘米的底边距。</p>
<p>这个段落没有指定外边距。</p>
<p>这个段落没有指定外边距。</p>
</body>
</html>
Copy after login

Rendering:

How to use css margin-bottom property

The above is the detailed content of How to use css margin-bottom property. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!