1.CSS is the abbreviation of Cascading Style Sheets. It is used to define the display form of HTML elements.
2. There are three ways to introduce CSS into HTML:
a. External style sheet:
b. Embed style sheet:
c. Inline style sheet:
The attribute name is style. Example:
3. Selector in CSS:
A: Simple selector;
a: Element selector; Element { attribute: value; }
b: class selector; .class name { attribute: value; } Note that there is a dot.
c: ID selector; #id name { attribute: value; } Note that there is a #, the ID selector can only be referenced once, while the class selector can be referenced multiple times.
d: pseudo-class selector; (has four states) a:link 3. a:hover{ }( The mouse is on the link)
{ }
4. Compound selector :
a:Intersection selector: The intersection selector is composed of two selectors directly connected, and the result is to select the intersection of their respective element ranges.
The first one must be a tag selector, and the second one must be a category selector or ID selector. There can be no space between these two selectors.
b: Union selector:
c: Descendant selector: (inherited The influence of the nearest) descendant selector is not limited to the "direct descendants" of the element, but also affects its "descendants at all levels"
5. Understand the cascading of style sheets:
The priorities of the levels from small to large are:
External style sheet
use use using ’ s ’ s
use using ’s ’ through ’s ‐ through ‐ ‐‐ ‐‐ ‐ ; Basic attributes---Text style
1. Length unit 1.px 2.em
2. Color definition color
3. Set font style Set the font of the text font-family: "Heilong";
Set the font tilt effect font-style :Italic;
using font-weight: 100 (range 100-900, the larger the font) The thicker)
Set English letter case conversion text-transform: capitalize; (capitalize the first letter of a word)
Set control text size font-size:..px/..%/..em
out through ’ s through through use through ’ through ’ through ’ s ‐ ‐ off ‐‐ ‐‐‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ underline/line-through (strikethrough)/overline (top line);
4. Set the paragraph style Set the indent of the first line of the paragraph text-indent: ..em (..standard character size distance)/..px ;
‐ ‐ ‐ ‐ ‐ ‐ ‐ set the distance between words letter-spacing (letters):..px; . Controlling the horizontal position of text text-align :left/right (right-aligned)/center (centered)/justify (aligned at both ends)
Set the text and background color background-color:...; :...;(Only works for elements in table cells)
Basic attributes of css - image style
1. Set the picture border: border-width: (thickness) ; border-color: (color) ; border-style: (linear) ;
Different borders can be set in different styles. eg: border-left-style, border-top-width .... solid solid line
2. Image scaling: width height (percent, pixels)
3. Mixed graphics and text:
Text wrapping: float (floating)
Alignment of pictures and text: horizontal alignment text-align:
<br/>
Vertical alignment vertical-align: : Indicates the header of the table : Indicates the content of the table : Indicates the tail of the table (The order can be different, but it is generally in order) and unordered list Attribute rotate(angle) Effect: When the mouse moves up, the list can rotate to the angle you set. (Zheng is clockwise, negative as counterclockwise, if it is 180 degrees, you can see that the word is inverted. You cannot clearly see the rotation , but you can see the change of the word) transform (conversion): rotate (rotate; cycle to rotate; make rotation; make turns) (-20deg) ; deg: degree (degree) 1. The concept of box: In CSS, an independent box model has 4 content (content), border (border), padding (inner margin) and margin (outer margin) Partially composed. 3-- to 3. the relationship between boxes:
4,. Set the background color and image: background-color: background-image:url(address) You can use background-repeat: to control tiling, repeat: horizontal and vertical tiling, default value. At No-Repeat: Not flat. X Repeat-X: Laip it in the horizontal direction.
.
5. Set the background image position: background-position: (two values can be set eg: left top)
6. Set the background image fixed position: background-attchment: fixed; Image scrolling: scroll
small dots, list-style: none; Positioning (see position7) 1. Absolute positioning: (The element frame set to relative positioning will be offset by a certain distance. The element still retains its shape before positioning, and the space it originally occupied is still retained. )
The position of the element is relative to the nearest positioned element,
Top:..px;
px;
. : table border bgcolor: table color border-collapse: merge adjacent columns Border line
border-spacing using using using using through through out through through out through out through through off ‐ ‐ ‐ ‐‐ ‐‐‐‐border
2. Set the style of the table when the mouse passes over: a:hover
3. CSS and form: a: production Button like text
transparent (transparent) Set the background to be transparent
border:0px; eg:
b: Make a colorful drop-down menu select option
c: Make an input box with only underline border: 0px/none;
border- bottom: 1px (thickness) dashed (linear) #000000 (color);
Supplement: 1. display: block (row-level elements are replaced with block-level elements) / inline (block-level elements are replaced with row-level elements)
Device:: NTH-OF-TYPE (N) Selector matching each element of the n n element of the nly element of the parent element .
N can be numbers, keywords or formulas.
Use CSS to set links and navigation menus (les9)
1. Set hyperlink styles: In HTML a:visited (visited). a:link{ } a:active{ }
(You can set these) background: ;
color: ; Border-top: px .
3. Make a fluorescent menu: Apply an unordered list,
, a:hover, (check les9).
4. Control the mouse (cursor) pointer . {cursor: } (check other CSS 2.0 Chinese manuals under properties).
5. Set the project list format: You can use ordered list
and
absolute: Absolute positioning (The relative position of the parent element will affect the box behind him as if the box is taken away, and other boxes in the back will fill fixed: fixed positioning (when the scroll bar slides, it will not change its position, it will always be there.)
2. Positioning of the box (static):
will maintain the original high and low coverage relationship.)
4. Inline has two values, one represents block-level display and the other represents inline display. display also has a value of none. When set to none, it means that the element will be hidden. This hiding means that the element completely disappears from the page. . 8.28o1.overflow (overflow): There are four values: visible (default value. No cut content or increase the scroll bar)
inline-block: Inline block element.

I know, I know: there are a ton of content management system options available, and while I've tested several, none have really been the one, y'know? Weird pricing models, difficult customization, some even end up becoming a whole &

Linking CSS files to HTML can be achieved by using elements in part of HTML. 1) Use tags to link local CSS files. 2) Multiple CSS files can be implemented by adding multiple tags. 3) External CSS files use absolute URL links, such as. 4) Ensure the correct use of file paths and CSS file loading order, and optimize performance can use CSS preprocessor to merge files.

Choosing Flexbox or Grid depends on the layout requirements: 1) Flexbox is suitable for one-dimensional layouts, such as navigation bar; 2) Grid is suitable for two-dimensional layouts, such as magazine layouts. The two can be used in the project to improve the layout effect.

The best way to include CSS files is to use tags to introduce external CSS files in the HTML part. 1. Use tags to introduce external CSS files, such as. 2. For small adjustments, inline CSS can be used, but should be used with caution. 3. Large projects can use CSS preprocessors such as Sass or Less to import other CSS files through @import. 4. For performance, CSS files should be merged and CDN should be used, and compressed using tools such as CSSNano.

Yes,youshouldlearnbothFlexboxandGrid.1)Flexboxisidealforone-dimensional,flexiblelayoutslikenavigationmenus.2)Gridexcelsintwo-dimensional,complexdesignssuchasmagazinelayouts.3)Combiningbothenhanceslayoutflexibilityandresponsiveness,allowingforstructur

What does it look like to refactor your own code? John Rhea picks apart an old CSS animation he wrote and walks through the thought process of optimizing it.

CSSanimationsarenotinherentlyhardbutrequirepracticeandunderstandingofCSSpropertiesandtimingfunctions.1)Startwithsimpleanimationslikescalingabuttononhoverusingkeyframes.2)Useeasingfunctionslikecubic-bezierfornaturaleffects,suchasabounceanimation.3)For

@keyframesispopularduetoitsversatilityandpowerincreatingsmoothCSSanimations.Keytricksinclude:1)Definingsmoothtransitionsbetweenstates,2)Animatingmultiplepropertiessimultaneously,3)Usingvendorprefixesforbrowsercompatibility,4)CombiningwithJavaScriptfo


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

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

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

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