CSS import method - inline Through the style tag attribute, the CSS key-value pair is directly written into the tag <p style="width: 100px;height: 100px;background: red;"></p> <!--Note: This code describes a container with a width and height of 100px and a red background--> CSS import method - embedded (embedded) Use the style tag to introduce CSS attribute names and attribute values into the HTML page. Usually the style tag is placed in the head tag. Why should CSS styles be placed in the head tag? Because the code is executed from top to bottom. If the structure is loaded first, the user will see dry content without beautification. Loading the style first and then the structure is like a child being born wearing clothes! <head> <style type="text/css"> p{ width: 100px;height: 100px;background: red; } </style> </head> The above code also describes a container with a width and height of 100px and a red background, but it is introduced in an embedded way! CSS import method other than chain Introduce independent css files into HTML pages through link tags <link rel="stylesheet" type="text/css" href="./style.css"> rel="stylesheet" describes the relationship between the current page and the document specified by href, which means that the document linked by href is a new style table, and type="text/css" specifies the MINME type, which is a css document. href="./style.css" specifies the location of the linked document CSS import method <style type="text/css"> @import url("style.css"); </style> Introduce a separate CSS file through @import url, url("style.css") specifies the location of the linked document This concludes this article about the four ways of importing CSS files: inline, inline, external, and imported. For more information about CSS import methods, please search 123WORDPRESS.COM’s previous articles or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! |
<<: Docker starts MySQL configuration implementation process
>>: Our thoughts on the UI engineer career
Preface It is very simple to create a server in n...
The core is mysqldump and Runtime The operation i...
Method 1: Use the SET PASSWORD command First log ...
Starting from MySQL 5.7, many security updates ha...
Download image docker pull openjdk Creating a Dat...
The Docker daemon uses HTTP_PROXY , HTTPS_PROXY ,...
Demand: This demand is an urgent need! In a subwa...
Recently, when developing a small program, I enco...
A new window opens. Advantages: When the user cli...
In the horizontal direction, you can set the alig...
This article shares the specific code of JS+AJAX ...
What does text-fill-color mean? Just from the lit...
summary During the interview, when discussing abo...
1. Download the ubuntu16.04 image and the corresp...
Preface Recently, I found a pitfall in upgrading ...