[Compilation and sharing] 75 high-frequency test points in CSS for front-end interviews

青灯夜游
Release: 2022-10-28 19:58:49
forward
2227 people have browsed it

This article will summarize and share with you75the high-frequency test points in CSS for front-end interviews to help students succeed in the autumn recruitment. Hurry up and collect it to study!

[Compilation and sharing] 75 high-frequency test points in CSS for front-end interviews

Theory

1. What is the function of box-sizing attribute value?

The parsing mode of the box model used to control elements, the default is content-box

  • context-box: W3C's standard box model, setting the height/width attributes of the element refers to the height/width of the content part

  • border-box: IE traditional box Model. Setting the height/width attribute of the element refers to the height/width of the border padding content

[Learning video sharing:css video tutorial,web front-end

2. absolute Absolute positioning is relative to whom?

The CSS position property is used to specify how an element is positioned in the document.

Absolute elements will be moved out of the normal document flow, and no space is reserved for the element. The position of the element is determined by positioning the specified element relative to the nearestnon-static positioned ancestor element. Absolutely positioned elements can have margins set and will not merge with other margins.

3. What is the difference between inline elements and block-level elements?

Inline elements:An inline element only occupies the space contained by the border of its corresponding label.

Block-level elements:A block-level element occupies the entire space of its parent element (container), thus creating a "block".

Difference:

  • Whether to start a new line: By default, inline elements will not start on a new line, and blocks Level elements will start on a new line.

  • Whether the width and height can be set: Block-level elements can set the width and height attributes. Note: Even if the width of block-level elements is set, it still occupies an exclusive line. Setting width and height for inline elements is invalid.

  • Whether inner and outer margins can be set: Block-level elements can be used, and horizontal padding-left/right and margin-left/right of inline elements are generated. Margin effect, but vertical padding-top/bottom, margin-top/bottom will not produce margin effect. (That is, the horizontal direction is valid, and the vertical direction is invalid)

  • #Whether to include each other: Block-level elements can contain inline elements and block-level elements. Inline elements cannot contain block-level elements

4. What are the common inline elements and block-level elements?

1. Common inline elements

, , , , , < ;small>, ,

2. Common block-level elements

,

,

  • ,

    ~

    ,
    ,
    ,
    , ,
      ,
      ,
  • The above is the detailed content of [Compilation and sharing] 75 high-frequency test points in CSS for front-end interviews. For more information, please follow other related articles on the PHP Chinese website!

    Related labels:
    css
    source:juejin.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!