1. Inline style, 2. Internal style Table, 3. External style sheet
a. link is an HTML tag, and @import is provided by CSS, and can only load CSS
d. The weight of the link mode style is higher than the weight of @import e. When using Javascript to control the DOM to change the style, you can only use the link mode, because @import only sees CSS. It is not DOM and can control CSS basic selectors:
1. Tag selector element
2. Class selector (multiple class name selector).
3.id selector four
#4. Wildcard Selector*
##Special RecommendationCSS compound selector:Descendant selector E>F
Child element selector
Intersection selector
Union selector,
Link pseudo-class selector lvha
Single colon ( :) is used for CSS3 pseudo-classes, and double colon (::) is used for CSS3 pseudo-elements
<ul> <p>111</p> <span>222</span> <li>1</li> <li>2</li> <li>3</li> </ul>
li:nth-of-type(2): indicates the second li element under ulli :nth-child(2): Indicates that it is both a li element and the second element under ul (cannot be found).
It is recommended to generally use nth-of-type, which is less likely to cause problems.
Three major features of css: CSS cascading, CSS inheritance, CSS priority
Talk about your understanding of CSS layout
Box model
Clear the way of floating:
1. Extra tag method,<p style="clear:both"></p>
2. Method of adding overflow attribute to parent3. Use after pseudo-element to clear float
.clearfix:after { content: ""; display: block; height: 0; clear: both; visibility: hidden; } .clearfix {*zoom: 1;} /* IE6、7 专有 */。
4. Use double pseudo-element to clear float
Positioning mode and edge offset:
Display and hide elements:
display:none;overflow:hidden
Mouse style cursor
vertical-align vertical alignment
Overflowing text ellipsis display
2.overflow: hidden is hidden beyond part
3.text-overflow: ellipsis displays an omission mark when the text in the object overflows
Common layout methods:
Flow (%) layout,
Elastic (flex) layout,
rem layout
Floating layout, clear float
Positioning layout,
margin and padding
blocks Level element is vertically centered
1.
left:50%; top:50%
transform: translate(-50%,-50%)
2 .
left:0; top: 0; bottom: 0; right: 0; margin: auto
3.px
Three major features of CSS: cascading inheritance priority
Inheritable properties
Text-related: font-family, font-size, font-style, font-variant, font-weight, font, letter-spacing, line-height, color
List-related: list-style-image, list-style-position, list-style-type, list-style
CSS3 new features
Realize rounded corners (border-radius), shadow (box-shadow), and add special effects to text (text- shadow), linear gradient (gradient), transformation (transform)
Added more CSS selectors multi-background rgba, the only pseudo-element introduced in CSS3 is ::selection, media query, multi-column layout
link @import
a. Link belongs to the HTML tag, while @import is provided by CSS, and can only load CSS
b. When the page is loaded, link will be loaded at the same time, and @import references The CSS will wait until the page is loaded before loading
1. Tag selector element
2. Class selector (multiple class name selector).3. ID selector four
#4. Wildcard selector*
CSS compound selector:
Descendant selector E>F
Child element selector
Intersection selector
Union selector,
Link pseudo-class selector lvha
Single Colon (:) is used for CSS3 pseudo-classes, and double colon (::) is used for CSS3 pseudo-elements
<ul> <p>111</p> <span>222</span> <li>1</li> <li>2</li> <li>3</li> </ul>
li:nth-of-type(2): Represents the second li element under ul
li:nth-child(2): Indicates that it is both a li element and the second element under ul (cannot be found).
It is recommended to generally use nth-of-type, which is less likely to cause problems.
Three major features of css: CSS cascading, CSS inheritance, CSS priority
Talk about your understanding of CSS layout
Box model
Clear the way of floating:
1. Extra tag method,
<p style="clear:both"></p>
2. Method of adding overflow attribute to parent
3. Use after pseudo-element to clear float
.clearfix:after { content: ""; display: block; height: 0; clear: both; visibility: hidden; } .clearfix {*zoom: 1;} /* IE6、7 专有 */。
4. Use double pseudo-element to clear float
Positioning mode and edge offset:
Display and hide elements:
display:none;
overflow:hidden
Mouse style cursor
default Xiaobai Default, pointer, move, text, not-allowed prohibit
vertical-align vertical alignment
Overflowing text ellipsis display
1.white-space:nowrap forces the text to be on one line Displayed on
2.overflow: hidden is hidden beyond part
3.text-overflow: ellipsis displays an omission mark when the text in the object overflows
Common layout methods:
Fixed layout,
Flow (%) layout,
Elastic (flex) layout,
rem layout
Floating layout, clear float
Positioning layout,
margin and padding
blocks Level element is vertically centered
How to center a p up, down, left and right
1.
left:50%; top:50%
transform: translate(-50%,-50%)
2 .
left:0; top: 0; bottom: 0; right: 0; margin: auto
3.px
Three major features of CSS: cascading inheritance priority
Inheritable properties
Text-related: font-family, font-size, font-style, font-variant, font-weight, font, letter-spacing, line-height, color
List-related: list-style-image, list-style-position, list-style-type, list-style
CSS3 new features
Realize rounded corners (border-radius), shadow (box-shadow), and add special effects to text (text- shadow), linear gradient (gradient), transformation (transform)
Added more CSS selectors multi-background rgba, the only pseudo-element introduced in CSS3 is ::selection, media query, multi-column layout
Related tutorial recommendations: CSS video tutorial
The above is the detailed content of CSS common interview questions. For more information, please follow other related articles on the PHP Chinese website!

CSS Grid is a powerful tool for creating complex, responsive web layouts. It simplifies design, improves accessibility, and offers more control than older methods.

Article discusses CSS Flexbox, a layout method for efficient alignment and distribution of space in responsive designs. It explains Flexbox usage, compares it with CSS Grid, and details browser support.

The article discusses techniques for creating responsive websites using CSS, including viewport meta tags, flexible grids, fluid media, media queries, and relative units. It also covers using CSS Grid and Flexbox together and recommends CSS framework

The article discusses the CSS box-sizing property, which controls how element dimensions are calculated. It explains values like content-box, border-box, and padding-box, and their impact on layout design and form alignment.

Article discusses creating animations using CSS, key properties, and combining with JavaScript. Main issue is browser compatibility.

Article discusses using CSS for 3D transformations, key properties, browser compatibility, and performance considerations for web projects.(Character count: 159)

The article discusses using CSS gradients (linear, radial, repeating) to enhance website visuals, adding depth, focus, and modern aesthetics.

Article discusses pseudo-elements in CSS, their use in enhancing HTML styling, and differences from pseudo-classes. Provides practical examples.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
