Good programmers share HTML5 web front-end highlights four common interview questions

Good programmers share HTML5 web front-end highlights four common interview questions
1, why should initialize CSS style?
Answer: Because of browser compatibility issues, different browser the default value of some labels are different, if not often appear on CSS Initialization page displays differences between browsers.
Of course, style initialization SEO will have some impact, but the fish and can not have both, but in the case sought to initialize minimal impact.
2, floating elements causing problems?
The answer:. A height of the parent element can not be stretched, the same level of influence of the parent element elements
b and floating elements at the same level of non-floating element will follow later.
C floating if not the first element, then before that element. floating elements are also needed, otherwise it will affect the structure of the page display
3, what is the difference between line-height three kinds of assignments mode? (With units, pure numbers, percentages)?
Answer: with units: PX without calculation, em element to make the parent element font-size value is calculated with reference to their own row height
purely digital: the ratio of transmitted to offspring, e.g. parent row height is 1.5, the font subelements is 18px, the child elements of the row height of 1.5 * 18 = 27px
percentage: the calculated value is transmitted to offspring
4,: link,: visited, : hover,: active execution order is how?
The answer: LVHA, l (link) ov (visited) eh (hover) a (active) te, that is, with love and hate two words to sum
5, css property content What is the role? What application?
Answer: css content attribute in specialized applications before / after pseudo-element, means for generating the content insertion, may be blended in custom fonts special symbols. .
6, the text exceeds displayed as an ellipsis?
Answer: // single line:
overflow: hidden;
text-overflow: ellipsis;
White Space-: nowrap;
// multiple lines:
the display: -webkit-Box;
-webkit-Box-Orient: Vertical;
-webkit-Line-CLAMP:. 3;
overflow: hidden;
7, HTML5 form elements What's new there?
The answer: the DataList the Output datetime DATE month The Week Time Email the Range Color Number The url
8, create a triangle using pure CSS what is the principle?
Answer: First, you need the element width, height set to 0. Then set the border style.
width: 0;
height: 0;
border-Top: Solid transparent 40px;
border-left: 40px Solid transparent;
border-right: 40px Solid transparent;
border-bottom: 40px Solid # FF0000;
9, when can trigger BFC?
Answer: The root element, namely html
value of the float is not none (default)
value overflow is not visible (default)
Block-value display inline, the Cell-the Table, the Table-Caption
position value is absolute or Fixed
10, writing style tags after the body before the body and what is the difference?
Answer: The page is loaded from top to bottom course, is to load the style.
Written after the body tag because the browser parses the HTML document in a progressive way, when the resolve to write at the end of the style sheet (outreach or write in a style tag) will cause the browser to stop rendering before, waiting to load and parse style after the form is re-rendered, FOUC phenomenon may appear in the windows of iE (ie, page style flicker caused by the failure)

Guess you like

Origin blog.51cto.com/14479068/2438496