this extra code for a simple separation point distance, as the passage, your CSS file code will be bloated, portability greatly weakened.
Every time I develop, I keep telling myself that the code you write will one day be replaced, modified, and updated by other developers. And a good front-end to write CSS not only in the current structure is strong and also for future developers to provide convenience.
The following is from the study of HTML css--margin and padding, author Fengyv, but added some personal views.You are learning margin and padding when you are ignorant,--what his Niang inner margin, what his niang margin. Oh ah, at first I also a bit do not understand, and l
Today in the login page to find a margin-top bug;The initial code is as follows:Html:Css:. errorstyle { height:20px; width:225px; Background-color: #FFCCCC; Color: #F00; font-size:12px; border: #FF0000 solid 1px; margin-top:10px; /* Note here */}The results show that IE6.IE7 is normal and IE8,FF error is displayed.Crux: When two containers are nested, if there is no other elemen
It is often possible to encounter such a problem, that is, the outer div set the height and width, the inner div If set maring-top does not work (Firefox and IE8 test), the reason is that the inner Div does not get the layout. As in the following code:The test found that Bdiv's margin-top did not work, and was still th
Https://coding.net/u/zhengkenghongOriginal: Https://blog.coding.net/blog/css-marginElaborate CSS marginThis article focuses on the "pit" of margin, which we are less likely to find everyday.Box modelPeople who have been exposed to CSS should know the box model of CSS:The Content box (contents box) is surrounded by the
In sometime, we want the center one div in our layout, but the CSS doesn ' t provide one property for this.We should use margin properties to implement.First let's see the standard explanation about Margin in W3Schools.MarginThe margin clears an area around an element (outsi
The negative margin (negative margin) in CSS is a common technique in layout, so long as it is used properly, it often has unexpected effects. Many special CSS layout methods rely on negative margins, so mastering its usage is a must for the front-end students. This article is very basic, the veteran can skip over.The
plus a CSS margin rules can achieve indentation purposes. P is a structured label, margin is the performance attribute, the former
belongs to HTML, and the latter belongs to CSS. (This is the separation of the structure from the performance phase.)
Well structured HTML pages have almost no label for performance attrib
How to Implement div spacing using the margin and overflow attributes
Using the margin and overflow attributes to implement p-spacing _ experience exchange
Clever Use of overflow: hidden to solve the intermediate interval Problem Clever Use of
All of a sudden, the layout that looks neat under chrome becomes a mess under IE. To find out why, I changed the div's Background-color attribute. Finally, the width of the same div is found to be different under IE and chrome. This is a big night, it's really creepy!After that, I did a test. When:
The code is as follows:
Div1{width:960px;margin:0px;padding:0px;}
At this time, in two browsers is no diffe
distance" between content (text) and (wrapped) elements.Common browser margin appears in the bugIE6 in the double-sided bug:Occurrence: Margin doubles when the first floating element within the parent element is set to Margin-left (element Float:left) or margin-right (element float:right).Solution: To add display:inli
? Every time you modify it, you need to add this redundant code to make it simple to separate points. Over time, your css file code will be bloated and the portability will be greatly reduced.I keep talking to myself during every Development. The code you write will be replaced, modified, and updated by other developers one day. A good front-end css not only has a solid structure, but also provides convenie
The top margin of the first child element of the parent element margin-top if a valid border or padding is not touched. The trouble of "leading" (parent element, ancestor Element) will continue to be found on a level by layer. As long as the leadership to set a valid border or padding can effectively control the goal of the non-leader margin to prevent it leapfro
content, and there is a "breathing distance" between the content (text) and the (wrapped) elements.common browsers for bugs that appear under marginIE6 in the double margin bug:Occurrence: Margin double when setting the Margin-left (element Float:left) or margin-right (element Float:right) for the first floating eleme
P tends to make the entire layer width and height exceed the predetermined range because of the setting of the padding, and the box-sizing attribute of CSS3 can solve this phenomenon simply, let us explain in detail the problem of using the Box-sizing property of CSS3 to solve the problems of the width height being stretched by the inner margin
Sometimes we set a fixed height or width for the elements of the page, such as P. But if the p is set with
Chinese;Cause 2: even if there is such a word, because when writing css code, we must use margin and padding. If we always use Chinese words to replace them, it is easy to confuse the concepts of margin and padding in actual applications.
If there is a little Html basics, you should understand some basic elements (elements), such as p, h1 ~ H6, br,
nested elements.
ExampleHTML:1 P>The bottom margin of this paragraph is collapsed ...P>2 P>... with the top margin of this paragraph, yielding a margin ofCode>1.2remCode>In between.P>3 4 Div>This parent element contains the paragraphs!5 P>This paragraph has aCode>.4remCode>
CSS's margin usage is detailed:recommendation : As far as possible handwriting code, can effectively improve the learning efficiency and depth.The margin property is used very frequently in web pages, so here is a detailed description of the use of this property.This property is used to define the margin of the object, also known as the outer padding, so-called
key to learning CSS layouts.Note: Why not translate margin and padding?Reason one: there is no corresponding word in Chinese;Reason two: Even if there is such a word, because in the writing of CSS code, must use margin and padding, if we always use Chinese words instead of its interpretation, to the practical applicat
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.