Example tutorial of margin-top in web page production

php中世界最好的语言
Release: 2017-12-01 14:44:09
Original
2711 people have browsed it

In HTML, margin-top is to set the distance between the object and the previous object. It is to set the css style of the spacing distance outside the object border. Today I will take you to get to know margin-top

margin-top syntax

.div{margin-top:10px}

Set the object ".div" The spacing is 10px

Related tutorials: margin

2. Margin-top application example

In order to observe the effect, the example sets up 3 DIV boxes, all with the same width and the same Height, same CSS border, set margin-top:10px for the second div layer; set margin-top:20px for the third div layer, observe the effect and understand the effect of margin-top style. The three object layers are DIV class named ".div1" ".div2" ".div3"

Instance complete HTML+CSS code

    margin-top在线实例  
  
Copy after login

margin-top is to set the object distance on the object distance Settings, if the object does not have a background or border set, you can usepadding-topinstead.


# I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

How to use the transform gradient attribute in Css3

Steps to implement the effect of creating a dynamic switch in Css3

Steps to implement animation technology in CSS3

The above is the detailed content of Example tutorial of margin-top in web page production. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
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!