Where to put css style sheet

青灯夜游
Release: 2021-11-10 15:19:11
Original
6056 people have browsed it

Where the css style sheet can be placed: 1. Use the style attribute to place it on a single HTML element tag, with the syntax ""; 2. Place it in a style tag pair, Syntax ""; 3. Place it in an external text file with the extension ".css".

Where to put css style sheet

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

Where the css style sheet can be placed:

1. Place it on the HTML tag

Use the style attribute to add it directly to a single HTML element tag to control the presentation style of the HTML tag.

This way of introducing CSS is decentralized, flexible and convenient, but it lacks integrity and planning, which is not conducive to later modification and maintenance. When the style of the website needs to be modified, the same modification may involve multiple places. , high maintenance costs. The style effect using the STYLE attribute is the strongest and will overwrite the same style effects of other introduction methods.

<div style="color:red"></div>
Copy after login

2. Place it in the