css margin property


  Translation results:

margin

English [ˈmɑ:dʒɪn] American [ˈmɑ:rdʒən]

n. Edge, range; limit; profit, surplus; (outside the version) ) of the blank

vt. Leave a margin; become the side of...; add a margin to, surround; add a margin for...

Plural: margins

css margin propertysyntax

Function: Set all margin attributes in one statement.

Description: This shorthand attribute sets the width of all margins of an element, or sets the width of the margins on each side. Vertically adjacent margins of block-level elements merge, while inline elements don't actually occupy top or bottom margins. The left and right margins of inline elements are not merged. Likewise, the margins of floated elements are not merged. It is allowed to specify negative margin values, but use caution when using them.

Note: Negative values ​​are allowed.

css margin propertyexample

<html>
<head>
<style type="text/css">
p.margin {margin: 20px 40px 30px 40px}
</style>
</head>

<body>

<p>这个段落没有指定外边距。</p>

<p class="margin">这个段落带有指定的外边距。这个段落带有指定的外边距。这个段落带有指定的外边距。这个段落带有指定的外边距。这个段落带有指定的外边距。</p>

<p>这个段落没有指定外边距。</p>

</body>

</html>

Run instance »

Click the "Run instance" button to view the online instance

Popular Recommendations

Home

Videos

Q&A