Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the syntax and characteristics of the margin-top attribute

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you what the syntax and features of the margin-top attribute are. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

If you know the syntax and features of the margin-top attribute, let me share it with you.

Margin-top attribute

Basic characteristics

The initial value: 0 applies to all elements

Inheritance: no percentage: based on the width of the containing element (refer to width of containing block)

Media: visual version: CSS1

Compatibility: IE4+ NS4+

Basic grammar

Margin-top: auto | length

Syntax value

Auto:  takes the computer value

Length: the length value of  consisting of floating point numbers and unit identifiers | percentage.

The percentage is based on the height of the parent object. Negative values are supported except for inline objects.

See Units of length.

instructions

Retrieves or sets the external patch on the top edge of the object.

You can use em and ex units in IE4.0+. This property is not supported for td and th objects in IE4.0+. To set an external patch in a cell, use this property of objects of type such as div, p, and so on in the cell. This property supports the use of inline objects in IE5.5+. In previous versions, in order for inline features to use this attribute, you must first set the object's height or width attribute, or set the position attribute to absolute, or set the display attribute to block.

For inline objects, the value provided by this property is used to calculate the border area around the inline object. Does not affect the height of the inline object's row (height). External patches are always transparent. This property is read-only to the currentStyle object. It is readable and writable to other objects. The corresponding script feature is marginTop.

Code example

Body {margin: 36pt 24pt 36pt;} body {margin-top: 11.5%;} body {margin: 10% 10% 10% 10%;} the above is what are the syntax and characteristics of margin-top attributes. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report