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
In actual projects, the up and down scroll bars a...
introduce This chapter mainly introduces the proc...
1. js will not protect hasOwnProperty from being ...
MySQL 5.7 installation We are learning MySQL data...
Basic Environment Pagoda installation service [Py...
1. Front-end-led implementation steps The first s...
Table of contents 1. Database Operation 2. Data T...
The final result is like this, isn’t it cute… PS:...
1. Download First of all, I would like to recomme...
Table of contents Install and introduce axios dep...
filter is generally used to filter certain values...
The project was tested these days, and the tester...
Table of contents background Problem Description ...
1. After installing the Windows version of Docker...
1 Introduction Binary log records SQL statements ...