


CSS3 media support
In css3, we can choose a page layout in the style to accurately adapt to different devices without changing the content, thereby improving User experience
You can use the meta tag in the page to specify the window width of how many pixels the browser will use when processing this page. The specification method is as follows
<meta name="viewport" content="width=600px" />
CSS can determine the devices that the style is applicable to by setting media, such as screen, tv, print, speech, handheld, all, etc.
<style media="all"><link media="print" href="xxx.css">
CSS3 can be based on more Set the visual properties, such as height, width, aspect ratio, resolution, device size, etc.
<style media="screen and (min-width:600px) and (max-width:900px)">
Specifically, the usage of Media Queries is as follows:
The values that can be specified in Media Queries are the same as the The device type represented by the value is as follows:
The description of the specific device characteristics in Media Queries is as follows:
Use the and keyword to specify the style to be used when the value of a certain feature of a certain device type meets a certain condition
Use multiple statement to apply the same style to different device types and device characteristics
You can add the not keyword or the only keyword in the expression. The not keyword means that the following expression Perform the negation operation
The role of the only keyword is to allow browsers that do not support Media Queries but can read Media Type devices to hide the expression style
Add shadow to text
Wrap text automatically
For Western text, the browser will add half-width spaces or hyphens Automatically wrap lines in places without sudden line breaks in the middle of words. When Chinese text contains punctuation marks, it is always impossible for the browser to place the punctuation mark at the beginning of a line of text.
You can use the word-break attribute in css3 to determine the processing method of automatic line wrapping
Let long words and URL addresses wrap automatically
div { word-wrap:break-word; }
Using server-side fonts
Webfonts is a very early CSS technology that allows the page to render specific fonts by downloading font files.
When using the @font-face attribute to display local fonts on the client, you need to modify the URL attribute value of the font file path to an attribute value in the form of local(), and add the following Write the font used in brackets
Declare the format of the font file in the format attribute value (when using the TrueType file format, set the format attribute value to truetype, when using the OpenType format, set the format attribute value to opentype . The file extension of TrueType is ttf, and the file extension of OpenType format is otf. When using server-side fonts in IE, you can only use Microsoft's own Embedded OpenType font file, the file extension is eot)
In the @font-face attribute, the attribute values that can be specified are as follows:
Here we talk about the use of the font-size-adjust attribute. In fact, the method of use is very simple, but you need to use an aspect value (proportion value) that comes with each font
Quoting a browser method for calculating aspect values introduced in "The Authoritative Guide to HTML5 and CSS3"
CSS3 box-related styles
1. The width and height attributes can only be used on block type elements and have no effect on inline type elements.
2. By default, the table element attribute is of block type, so it cannot It is in the same line as other text, but if the table element is modified to the inline-table type, the table can be in the same line as other text
3. When specifying the element as run-in or compact type, If there is a block type element after the element, the run-in type element will be included inside the block type element, and the compact type element will be placed to the left of the block type element
4. css3 All table-related elements and their types are as follows
The support of each browser for various box types
Exceed the part to display ellipses
div { white-space:nowrap;/*使得盒右端的内容不能换行显示,这样一来盒中的内容就在水平方向上溢出了*/ overflow:hidden;/*超出div元素部分的文字将会被隐藏起来*/ text-overflow:ellipsis;/*在div元素的末尾出现一个省略号*/ }
Box-related attributes box-shadow, box-sizing
box-shadow The usage method is exactly the same as text-shadow.
box-sizing: You can specify whether the width and height values specified with the width attribute and height attribute respectively include the padding area inside the element, and the width and height of the border
The purpose of using the box-sizing attribute is to control the total width of the element. If this attribute is not used, the content-box attribute value is used by default in the style, which only specifies the width of the content. However, the total width of the element is not specified. In some cases, using the border-box attribute value will make the page layout more convenient
Title
Paragraph
Some other important details in CSS3
1) You may think that there is no big difference between the alpha channel and opacity of setting the color value. In fact, you need to use the alpha channel for both the background color and the text color at the same time. To achieve the effect of using opacity
2) If the color value is specified as transparent, the color of the background, text or border will be set to be completely transparent, which is equivalent to using an alpha channel with a value of 0 (in In css3, transparent values can be specified in all attributes that specify color values)
3) Everyone knows that the outline attribute is used in css2 to draw an outline around the element. The specific usage method is as follows
By default, for elements with borders, using the outline attribute will draw an outline close to the outside of the border. What if we want the outline to deviate outward by a few pixels? The newly added outline-offset attribute in CSS3 has this effect. It is very simple to use. Just specify an integer value with pixel units for it. If it is specified as a positive integer, it will be offset outwards. If it is specified as a negative integer, then Offset inward
4) The resize development of css3 allows users to modify the size of elements by dragging and dropping (mainly used in any container element using the overflow attribute)
can be resized The values specified by attributes are divided into the following types:
5) In CSS3, you can use the initial attribute value to cancel the style specification of the element, but in individual cases, use the initial attribute for the element The display result after the value is not equal to the result after directly deleting the style setting of the element (because after adding the style setting of the initial attribute value, the font size and font thickness of the element are set using the font size and font thickness attributes in CSS. A certain default value, regardless of what styles the browser adds to the element)

HTMLtagsdefinethestructureofawebpage,whileattributesaddfunctionalityanddetails.1)Tagslike,,andoutlinethecontent'splacement.2)Attributessuchassrc,class,andstyleenhancetagsbyspecifyingimagesources,styling,andmore,improvingfunctionalityandappearance.

The future of HTML will develop in a more semantic, functional and modular direction. 1) Semanticization will make the tag describe the content more clearly, improving SEO and barrier-free access. 2) Functionalization will introduce new elements and attributes to meet user needs. 3) Modularity will support component development and improve code reusability.

HTMLattributesarecrucialinwebdevelopmentforcontrollingbehavior,appearance,andfunctionality.Theyenhanceinteractivity,accessibility,andSEO.Forexample,thesrcattributeintagsimpactsSEO,whileonclickintagsaddsinteractivity.Touseattributeseffectively:1)Usese

The alt attribute is an important part of the tag in HTML and is used to provide alternative text for images. 1. When the image cannot be loaded, the text in the alt attribute will be displayed to improve the user experience. 2. Screen readers use the alt attribute to help visually impaired users understand the content of the picture. 3. Search engines index text in the alt attribute to improve the SEO ranking of web pages.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.


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

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver Mac version
Visual web development tools
