Home  >  Article  >  Web Front-end  >  html 5 common interview questions

html 5 common interview questions

PHPz
PHPzOriginal
2017-04-04 09:44:061394browse
1. Common block-level elements Inline element p - the most commonly used block-level element dl - block-level element used with dt-dd form - interactive form h1 -h6- title hr - horizontal separator line ol – Ordered list p - paragraph ul - unordered list fieldset - form field set colgroup-col - form column grouping element table-tr-td table and row-cell pre - formatted text a – hyperlink (anchor) br - Line break i - italic em - emphasis img - picture input - input box label - form label span - commonly used inline container, defining text blocks strong - bold emphasis sub - subscript sup - superscript textarea - multi-line text input box u - Underline select - Project selection 2. Several conditions for realizing three points of text text-overflowAttribute is only: whether to display an omission mark when the text overflows, and does not haveOthers Definition of style attributes. To achieve the effect of producing an ellipse when overflowing, you need to define:
1. Container width: width: value; (px, %, both are acceptable)
2. Mandatory text Display in one line: white-space:nowrap;
3. Overflow content is hidden: overflow: hidden;
4. Overflow text displays ellipses: text-overflow: ellipsis;
Note: It must be a single line of text to set the overflow of this article! ! !

IE6+; chrome1.0+; safari3.1+ (firefox, opera are not supported yet)

3. Several conditions for vertical centering

To set an element to be vertically centered in a container, you must change the default display attribute value to inline-block;
and add the sibling element (ruler) (sibling element [ruler] style Set to vertical-align:middle;width:0;height:100%;display:inline-block;).

Three conditions:
1: The container (parent element) must be added text-align:center;
2: The current element must be converted into an inline block element (display:inline-block;) Then add vertical-align:middle;
3: Add the sibling element span after the current element (without carriage return); and perform vertical-align on span: middle;width:0;height:100%;display:inline-block

4. Replacement elements and non-replacement elements

Replacement elements and non-replacement elements

a) Replacement elements: The browser determines the specific display content of the element based on its tags and attributes. For example: the browser will read the image information and display it based on the value of the src attribute of the tag, but if you view the (x)html code, you cannot see the actual content of the image; the type of the tag Attributes determine whether to display input boxes, radio buttons, etc. (x), ,