html css basic questions, exercises, interview questions (2)

1. The following which the highest weight ()
A inline style sheet
B id selector
C {div Color: Red Important;!}
D class selector
correct answer: C
Analysis:
In CSS, by declaration of a style! important, can change the default CSS style-priority rule, the article style property declarations have the highest priority.

2. Which of the following does not belong to web standards ()
A structure
B performance
C content
D behavior
The correct answer: C
Analysis:
web standards
3. About CSS Sprites description of the error is ()?
A CSS Sprites is a picture of the integration of technology
B can reduce the number of requests HTPP improve web performance
C CSS Sprites for small icons and more flexible than the big picture
D can reduce the image bytes
The correct answer: C

4. In HTML, the following () enables the table interbank merger?
A colspan tag
B rowspan attribute
C rowspan label
D colspan attribute
the correct answer: B
parsing:
colspan attribute tables across columns to achieve merger

5. Why do you want to initialize About CSS style misunderstanding that ()?
A browser compatibility issues because of different browser the default value is different from some of the label
B does not often appear on the initial page CSS browser displays the difference between the
C in order to avoid different browsers have different display
D is not CSS style initialization and there is no question
the correct answer: D

6.link the rel = "stylesheet" role attribute ()?
A linked style sheet
B target path
C Custom document type
correct answer: A

<link rel="stylesheet" type="text/css" href="theme.css" />

href specified positions that are linked document.
rel specified relationship between the current document and the linked document
MIME type type specified by the linked document.

7. The right weight is inline style ()?
10 A
B 100
C 1000
D. 1
correct answer: C

8. The following options, you can set the page opposite page a DIV tag CSS style is centered horizontally ()?
A margin: 0 Auto;
B text-align = left: Center;
C Line-height: 50px;
D Run the display: inline- block;
the correct answer: A
parsing:
text-align = left: Center; centered text

9.CSS style background-position: meaning -5px 10px represents ()?
A background image shifted to the left 5px, downwardly offset 10px
B background image shifts to the left 5px, upwardly offset 10px
C background image shifted to the right 5px, downwardly offset 10px
D background image shifted to the right 5px, 10px upward shift
right answer: A
parsing:
background-position: left and right, up and down (only two values)

10. The following description is correct ()? <style type="text/css"> #menu{font-size:14px;} </style>
A menu is a tag selector
B menu is an element selector
C menu selector is a class
D menu ID selector is
the correct answer: D
Analytical:
#ID selector
.class class selector

11. Which of the following is the object positioning? ()
A margin
B border
C position
D Content
correct answer: C

12. Which property belongs to table that can be added? ()
A cellspacing
B COL
C colspan
D TH
correct Answer: A

13. For HTML statement is correct
A sharp resolution in the first word in the named marks, also called tag, also referred to as elements
B can have a plurality of label attributes, but in order to distinguish attributes
C and labeled can not attribute separated by a space between
D property values can not quote
the correct answer: a
resolution:
on the cusp of the first number in a word, called marking, labeling, also known element, a label can have multiple attributes, and attributes order attribute is not distinguished, separated by a space between the tags and attributes, the attribute value in double quotes

14. Click the following hyperlink to jump to http://www.qfedu.com website
A <a href="http://www. qfedu.com">千锋教育</a>
B <a href="千锋教育"> http://www. qfedu.com </a>
C <a target=" http://www. qfedu.com ">千锋教育</a>
D <a target="千锋教育"> http://www. qfedu.com </a>
The correct answer: A
Analysis:
hyperlink syntax:

 <a href="链接地址">链接文本/图片</a>

15. In the CSS, to achieve link font color to red, no underline, when the mouse shift display of date underlined, the following options are correct
A a: link {color: # ff0000;} a: hover {text-decoration: underline;}
B {A Color: # FF0000; text-Decoration: none;} A: hover {text-Decoration: overline;}
C {A text-Decoration: underline;} A: hover {Color: # FF0000; tEXT- Decoration: none;}
D A: Color link {: # FF0000; text-Decoration: none;} A: hover {text-Decoration: underline;}
correct answer: D
analytical:
A: initial state set a hyperlink link, text- decoration: none; cancel underlined;
A: hover the mouse over the setting state, text-decoration: underline; underline, D is selected from

16. In order to make the following id div container can be horizontally centered, CSS style is required
A #container {width: 880px; padding: Auto 0px;}
B {#container width: 880px; padding: Auto 0px;}
C #container width {: 880px; margin: Auto 0px;}
D {#container width: 880px; margin: 0px auto;}
correct answer: D
Analysis:
center block elements as embodiment margin: any value auto;

17. The following CSS code has several grammatical mistakes TD {font-size &: 12px, Color: 666666;}
A. 1
B 2
C. 3
D. 4
correct answer: C
parsing:
CSS syntax: selector {properties: Property Value;}
the right to:td{font-size:12px ; color:#666666 }

Second, multiple choice (a total of 20 items, each of 2 points)
1. The following options display attribute value of inline-block label which ()
A IMG
B INPUT
C Image
D SELECT
correct answer: A, B, D
analytical:
INPUT, sELECT, the display attribute value img elements are inline-block, select a, B, D

2. The following options property value position is what ()
A static
B Auto
C Fixed
D relative
correct answer: A, C, D
parsing:
◆ position: static positioning no
circumstances sometimes encountered inheritance, we want to see effects of inherited property element itself, so you can use position: static canceled inheritance, namely restore defaults element positioning.

◆ position: absolute absolute positioning
using position: absolute, can be very accurate element is moved to the position you want,

◆ position: fixed relative to the window of fixed positioning
please pay special attention, IE6 does not support the CSS position: fixed property.

◆ position: relative relative positioning

3. Which of the following can make the label be changed to contain block ()
A position: Absolute
B position: relative
C position: static
D Run the display: Block
the correct answer: A, B
analysis:
from the positioning element and the parent with the most recent positioning properties element, the element comprising an absolute positioning block, and provides an offset reference coordinates of the display range absolute positioning element. Selected from A, B

4. hidden element attributes ()
A overflow: hidden
B the display: none
C visibility: hidden
D the display: hidden
correct answer: B, C
Analysis:
hidden element has a three methods, namely display: none; opacity: 0 ; visibility: hidden; so I chose BC, option A is the overflow hidden.

The following options have pseudo-element selectors ()
A: Active
B: First-Line
C: visited
D: before
the correct answer: B, D
resolved:
the CSS2 pseudo elements we previously viewed :: first-line, : first-letter,: before, : after; then in CSS3, he made certain adjustments to the pseudo-element, an increase in the past on the basis of a ":" which is now turned into a ":: first-letter, :: first-line, :: before, :: after " In addition, he also added a" :: selection ", so I chose to BD. Belonging to the AC dynamic pseudo class selector.

6. Allow the display element declaration () scroll bar
A Run the display: the Scroll
B overflow: the Scroll
C-overflow the X-: the Scroll; the y-overflow-: the Scroll
D overflow: hidden
correct answer: B, C
parsing:
overflow: the Scroll
overflow-the X-: scroll; overflow-y: scroll

Using pseudo-element selector 7. The following options allow the float parent element is highly adaptive ()
A elements: after {content: ""; the display: Block; Clear: both}
B elements: after {content: "" ; the display: Block; height: 0; Clear: both}
C elements: After {Content: ""; the display: Block; Clear: both; height: 0; overflow: hidden; visibility: hidden}
D elements: after {display: block; clear: both; height: 0; overflow: hidden; visibility: hidden}
correct answer: a, B, C
Analysis:
pseudo-element selectors to allow the float height of the parent element of the adaptive mean height is actually asked to solve the collapse Clear writing universal law, and pseudo-elements: proper use of after, the pseudo-element: time after use and must be used with content,: after pseudo-elements add content after the element. This allows the pseudo-element is inserted to generate content creators rearmost element content. By default, this pseudo-elements are inline elements, but you can change this using the property display.

8. The element height so that the height of the adaptive window options which may be implemented ()
A height elements {: 100px}
B {HTML height: 100%;} {body height: 100%; height} elements {:} 100%
C html body {height: 100%; } elements {height: 100%}
D HTML, body {height: 100%;} elements {height: 100%}
correct answer: B, D
Analysis:
width and height of an adaptive page layout often to define the width and height of the element. But many times we want to be able to automatically adjust the size of the element or sub-element according to the window, which is adaptive, and is highly adaptive {height: auto;} or height do not write, if you need highly adaptive window, then you need to html and body height are set to height: 100%, so the choice of B, D.

9. See the following code .red {color: red;} the following options, the text is displayed in red
A <a href="#" class="red">文本A</a>
B <div class="red"><a href="#">文本B</a></div>
C <p class="red"><a href="#">文本C</a></p>
D <p><a href="#" class="red">文本C</a></p>
correct answer: A, D

10. The following attributes are correct wording
A padding: -10px
B padding: 10px
C margin: 10px
D margin: -10px
correct answer: B, C, D
resolved:
padding can write negative, margin can write negative

13. Which of the following attributes is an ordered list of html attributes ol
A Color
B src
C of the type
D Start
correct answer: C, D
Analysis:

16. To achieve the following functions: Insert a picture cat.gif on the page, the user by clicking on the picture, connect to the home.html page. The following HTML code is correct
A <a href="home.html" target=“_blank”> <img src="images/cat.gif"></a>
B <a href=" home.html" src="images/cat.gif"></a>
C <a href="home.html">< img src="images/cat.gif"></a>
D <a href="images/cat.gif"></a>
correct answer: A, C

17. The following attribute values set margin margins correct manner is
A 1 value is provided in four directions margin
B 2 values, a first value of the margin provided up and down in both directions, the second value is set margin around two directions
C 3 values, a first value is set in the direction of the margin, the margin value is the second direction, the third value is set in two directions margin
D values. 4, clockwise , top, right, bottom, left
correct answer: a, B, D
Analysis:
three values, the first value is set in the direction of the margin, a second margin value is the left and right directions, the third value margin is provided in the direction

Wherein the element which block 19. ()
A can set the width and height
B is generally used as a container
C This element on a separate line, to wrap
the D default, and other labels can be displayed on one line by one
correct answer: A, B, C
Analysis:
lump elements are: the width and height may be provided, generally as containers, before this element can own line, word wrap; select a, B, C

20. how adaptive element width and height ()
A provided to the element width: 100px
B is provided to the element width: 100%
C if the element is a block element default width is% 100
D is provided to the element width: auto
correct answer: B, C
Analysis:
width adaptive element is required width is automatically adjusted according to the processing content or the size of the browser, so that this time is not necessarily the unit pixel px, px pixels (pixel), the relative length of the unit, with respect to the pixel px For the resolution of the monitor screen, the option a is not right, the correct option b; block element width default value of 100%, instead of auto, so of c, d are not.

Guess you like

Origin blog.csdn.net/ZHANGJIN9546/article/details/92790906