Reprinted: on Having Layout

xiaoxiao2021-04-01  229

Translator Note: A very good article, I have recommended it on Blog a long time. After two days, I have been translated, and I recommend reading.

English is here.

All the words in the article did not translate, and the words themselves mean more. They all feel that don't turn, I'm here is also a proprietary property, so I have to let go. The level is limited, and many places are moderately translated, and the mistakes are welcome. Welcome to the message.

Quote a paragraph from Dean Edwards:

I Recommend That Every CSS Designer and Dom Scripter Read this. Understanding "Layout" gives a huge Insight Into Lots of Other IE Bugs and IDiosyncras.

(Dean edwards)

Introduction

There are a lot of strange rendering issues in Internet Explorer to be resolved by giving it "layout". John Gallant and Holly Bergevin classify these questions as "Dimensional Bugs", meaning that these bugs can be solved by giving a width or height to the corresponding element. This takes out a question about "layout": Why is it changed the rendering characteristics of the element, why will it affect the relationship between elements? This question is very good, but it is difficult to answer. In this article, we focus on this complex issue, there will be those aspects, and the specific discussion and examples of a certain aspect provide the related links given in the following.

Haslayout - definition

"Layout" is a private concept of IE / WIN, which determines how an element is displayed and constrained, how to interact with other elements, how to respond to and deliver an application event / user event, etc. Concept of a form.

Microsoft's developers believe that the box-type element should have a "property" (this is an object-oriented programming), so they use layout, which is HASLAYOUT.

Haslayout is actually neither an attribute is not a behavior, but IE this rendering engine is inheriting a rendering concept that has been rendered, and the elements rendered under this concept will have a feature.

In fact, this rendering feature is in some html elements, and in other elements can also be triggered to True through some CSS properties, and once the trigger will not reverse.

the term

When we say that an element "is layout" or "get layout", or when "HAS Layout", we mean it means that its Microsoft's proprietary attribute Haslayout is set to True. A "layout element" can be an element that has a Layout or an element that gets a Layout by setting some CSS properties.

"None Layout Elements" refers to the elements of HASLAYOUT un triggered, such as a clean DIV element that does not set a wide high size can be used as a "no Layout ancestor".

Give a method that gives Layout to a default, it is included to set the CSS attribute that triggers Haslayout = TRUE. Refer to the default Layout element and list of these attributes. There is no way to set HASLAYOUT = FALSE unless the CSS attribute that triggers Haslayout = True is removed.

Variety of problems

Haslayout's problem regardless of the novice or older, regardless of the designer or programmer may have encountered. Elements with layout usually have different ordinary and unpredictable display effects, and sometimes even implicated to their child elements.

Whether an element has "layout" may trigger some questions: IE a lot of common floating bugs. The element itself is an abnormality problem of some basic attributes. Margin collapsing between the container and its descendants. There are many problems encountered when using the list. Background image position deviation problem. Processing inconsistency between browsers encountered when using scripts.

The above list is only listed, and it is not perfect. The following article will describe the various issues that have not been "layout" as detailed.

Where is Layout from?

Unlike standard properties, it is not like a private CSS property of some browsers, and Layout cannot be directly set through a CSS statement. That is to say, there is no "layout attribute" such something, the element is either automatically owned by Layout, or with some CSS statements quietly get Layout.

Default Layout element

The following elements should be the default with Layout:

,

, ,
,