> >

Re: CSS margin external distance from outer space, namely div to div spacing.

time:17-06-28 forum:HTML web page, JS language and code
  Three, common margin style - TOP

1, margin set object box spacing
we commonly used margin to set the distance between 2 boxes, no matter up or down the distance we can use margin implementation interval.


actually available margin local diagram

2, using margin to achieve the middle of the layout, the basic word:
marign:0 Auto;
can achieve the middle of the object, but need a condition, that is, the object superior must Set the text-align:center content in the middle attribute style. Some browser body tags do not set the text-align:center content in the middle style, its lower level contains the object set margin:0 Auto to make its layout in the middle, but in order to compatible with the major browsers to recommend a text-align:center attribute style to body, where divcss5 provides a CSS initialization template for DIV CSS layout when no The initialization style attributes such as CSS text-align:center need to be repeated.
four, CSS margin common case - TOP

DIVCSS5 set 2 boxes. In order to reflect the margin effect, we set the CSS border border, certain CSS width and CSS height for its 2 boxes.

1, margin use CSS code
.divcss5-top,.Divcss5-bottom{width:300px; height:100px; border:1px solid #F00}
  • 1
  • 2
  • 3

prev:Processing method of Chinese characters ... next:PHP hidden data, MD5 encryption, interce...
post comments
Notice



Approved   A total of 12 years of investigation...   Ding Dawei, a foreign member of the ...   91 year old people spend 54 years bu...   Brazil women do not fear the face bi...   The first generation of migrant work...
rand   WowJS: adds a simple animation to th...   Introduction to CSS3 animation and t...   Animate.css makes adding CSS animati...   JS control   CSS hover picture jitter effect
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com