


Questions
1. Some browsers do not fully support css3. Which tool can be used to detect whether the browser supports it and what items it supports?
modernizr: Detect the browser's HTML5 and CSS3 features (as for the introduction of modernizr, you can read my other blog post HTML5 series four (feature detection, introduction to Modernizr.js))
2. Commonly used html tags, their display attributes generally default to block and inline. What are the common tags whose display is not block or inline? What is the difference between the display of these tags and block/inline?
The specific display attribute values are as follows:
inline can be understood as a flow, which has no size or shape, and its width depends on the parent container width. For inline tags, the width and height you set are invalid.
How to convert inline elements into block-level elements
- Set display:block
- elements 🎜>Set float for inline
- elements and set position:absolute/fixed elements 🎜> To put it simply, general text and pictures are inline, divs are block, and general buttons and inputs are inline-block.
So the characteristics of inline-block can be summarized as: it looks like a "flow" from the outside, but it is indeed a "block" in itself.
3.
The first row of a table displays a red background, the last row displays a blue background, and the middle row uses a gray/white spaced background. How to write?Using structured pseudo-classes, you will write as follows
Insert a sentence here, if you want to underline between each menu, as shown in the figure below Effect
Most people will use
ul li { border-bottom: 1px solid #ccc; } ul li:last-child { border-bottom: 0px; }But in fact there is a more convenient way (if you are very familiar with structured pseudo-classes) If you understand)
ul li + li { border-top: 1px solid #ccc; }Here are the following two structural pseudo-classes:
Select the sibling node next to an element, For example, li li{…}
- selects all sibling nodes of a certain element, such as span ~ a{…}
- 4,
Clear the float and add a "triangle" to a div
In fact, many icons are generally very small (it should be small in itself), but I need this If you add event binding to small icons, it will be even worse on the mobile phone. Users cannot click it at all. What to do? You can use before and after to increase the size of the container
Another thing to mention here is css The content attribute will only work in before and after, and has no effect in other attributes. So sometimes don't write some useless attributes to your code, which will increase the browser's parsing time.
5.
css?? Cascading style sheet, how to understand the "cascading" in it?There is nothing to say about this. In fact, I have seen many blog posts saying that ID represents 100, class represents 10, and Element represents 1. I don’t agree with this explanation. If you want to really If you know more about it, you can read the "CSS Definitive Guide", or you can read CSS--Structure and Cascading
6.
The width of the box model actually refers to the width of the content, excluding padding and border. , margin. In fact, this is very detrimental to our CSS layout. Is there any way to make the width the full width?box-sizing
....
There are many other questions, I will summarize them one by one
Ideas for learning css
How does the browser work?
After the browser loads the html, it only looks for one thing?? the dom tree. The browser changes the html into a dom tree structure, thus completing the structuring of the html.
The browser turns the loaded html into a dom tree, but there is no display style at this time. Therefore, the displayed styles are all defined by CSS. The browser will only render the view style through CSS
As for the subsequent rendering of the view, p is block and br is newline. That is after integrating CSS. The browser's integration of CSS is another route, which is separate from parsing HTML.
HTML parsing is a line, CSS parsing is a line, and the two will be combined at a certain point to form the final view.
If we focus on CSS, from the above picture we can summarize three breakthrough points for learning CSS.
- How does the browser load and parse CSS?? 5 sources of CSS;
- How to combine CSS and html?? Selector;
- What display methods can CSS control? Box mode, floating, positioning, background, font, etc.;
- In fact, if we start from the above If you understand css from three aspects, your ideas will suddenly become clear. To make use of a sentence from the original blogger, it means
css style source
我之前一直到《css权威指南》里面说的用户代理样式一词很不了解,看了博主的文章后才明白,在一些浏览器是可以自定义字号和字体的(用户在这里设置了字体和字号之后,它们会覆盖掉浏览器默认的样式)。 display:table具有包裹性,除了display:table之外,float及position:absolute也都具有包裹性,什么叫包裹性,简单一点的说就是宽度会根据内容而定,包裹的特性其实主要有三个表现:收缩、坚挺、隔绝。 在没有css3的column-count之前,大家都习惯用display:table-cell来实现多列布局,但是众所周知table-cell IE6、7不兼容。 纵向margin是会重叠 用div画下三角 布局相关
div { border: 10px solid; border-color: #333 transparent transparent transparent; }
div设置了float之后,其宽度会自动调整为包裹住内容宽度,而不是撑满整个父容器。
被设置了float的元素会脱离文档流。
“清空格”这一特性的根本原因是由于float会导致节点脱离文档流结构。它都不属于文档流结构了,那么它身边的什么换行、空格就都和它没关系的,它就尽量的往一边去靠拢,能靠多近就靠多近,这就是清空格的本质。事实上这些空格并没有真正消失,只是位于float元素的后面罢了。
清除浮动的方法
- 为父元素添加overflow:hidden
- 浮动父元素
- clear:both
- 兼容各浏览器的clear both方法
.clearfix:after { content: ''; display: table; clear: both; } .clearfix { *zoom: 1; }
看王朋福的css知多少系列的总结

Boolean attributes are special attributes in HTML that are activated without a value. 1. The Boolean attribute controls the behavior of the element by whether it exists or not, such as disabled disable the input box. 2.Their working principle is to change element behavior according to the existence of attributes when the browser parses. 3. The basic usage is to directly add attributes, and the advanced usage can be dynamically controlled through JavaScript. 4. Common mistakes are mistakenly thinking that values need to be set, and the correct writing method should be concise. 5. The best practice is to keep the code concise and use Boolean properties reasonably to optimize web page performance and user experience.

HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.


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

SublimeText3 English version
Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download
The most popular open source editor
