Cascading style sheet CSS_html/css_WEB-ITnose
??
1. What is a cascading style sheet
css is to control the display of styles on web pages
2. Several ways to set css
inline Style sheet (Inline styles)
Set the style attribute of the tag
When using inline style sheets, the html4.01 standard recommends adding the following
Reason: The new version of html can not only use css but also use other methods, such as using text/sml to control the display effect of xml in html
Disadvantages: It needs to be set in each tag. Inline style sheets will work on all media
Embedded style sheets
Defined in the
< style>
The basic format of each style rule defined in the tag pair is as follows:
selector{property:value;property:value;...}
selector : When defining a style rule, the web page elements affected by this rule must be specified.
The web page element defined in a rule is the selector (selector), that is, the web page element affected by the style rule is selected
property: Specify the style names to be modified, i.e. css attributes, such as color
Value: The value assigned to property, i.e. css attribute value
Disadvantage:
must be written in every page
External style sheet
type and media attributes It is optional
Save the external style sheet in the buffer to speed up the loading of the web page
Advantages: It can make the web page slimmer
Input style sheet
You can use css The @import statement imports an external style sheet (css file) into two external css files. The style rule definition statements in the imported css
You can also use the @import statement to import a css file into the tag of the web page. The
style rule definition statement in the imported css file becomes tag pair.
An example statement using the @import declaration is as follows:

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...
