1. CSS writing format 1. Inline styles You can write CSS code directly into the opening tag
2. Inline styles You can write a bunch of style tags in a pair of head tags, and then write CSS code in the style tags <head> <style> div{ color:red; } </style> </head> 3. External link style Write a separate css file, write the CSS code in this file, and then associate this file with the HTML file through the link tag in the HTML file. This is the HTML file <head> <link rel="stylesheet" href="194_Css.css"> </head> This is the CSS file div { color:red; } 4. Import styles Similar to the third method, but the import method is different <head> <style> @import "194_Css.css"; </style> </head> Note: Most enterprise development uses external link styles, which separates structure and style from each other. So why not use import styles? External link styles are associated through the link tag and imported styles are associated through 2. Build a website from 0 to 1 1. The first thing to do when writing a website Create a site folder and create some subfolders and subfiles, such as: CSS folder, js folder, image folder, index.html Note: You can use Chinese names when creating site folders, but Chinese characters cannot appear in subfolders and subfiles in the site folders. 2. Reset all default styles and set some global styles, and associate the CSS files that set the styles with the corresponding interfaces 3. Create a Nubia website (1) Let’s take a look at the structure directory first (2) Subject content code <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="CSS/base.css"> <link rel="stylesheet" href="CSS/index.css"> </head> <body> <!--Top area--> <div class="top"></div> <!--Advertising Area--> <div class="banner"></div> <!--Content area--> <div class="content"></div> <!--Bottom area--> <div class="footer"></div> </body> </html> (3) CSS style code /*Top area*/ .top{ height:60px; width:100%;/*It is the same width as the parent element. Here we use the percentage form so that the web page will not be deformed when it is enlarged or reduced*/ background-color: red; } /*Advertising area*/ .banner{ height: 800px; width: 100%; background-color: green; } /*Content area*/ .content{ height: 1883px; width: 100%; background-color: blue; } /*Bottom area*/ .footer{ } 3. Source code: D194_CSSWritingFormat.html Project: Nubia address: https://github.com/ruigege66/HTML_learning/blob/master/D194_CSSWritingFormat.html https://github.com/ruigege66/HTML_learning/tree/master/Nubia Summarize This concludes this article about CSS writing format and a detailed explanation of the basic structure of a mobile page. For more relevant CSS writing format content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope that everyone will support 123WORDPRESS.COM in the future! |
<<: Use button trigger events to achieve background color flashing effect
>>: MySQL Series 7 MySQL Storage Engine
I recently reviewed some CSS-related knowledge po...
Table of contents background Effect Ideas backgro...
Method 1: Use the SET PASSWORD command mysql> ...
Preface The latest version of MySQL 8.0 is 8.0.4 ...
MySQL slow log is a type of information that MySQ...
Sometimes it is slow to download large network fi...
1. Official Introduction grep is a commonly used ...
Every time you log in to the test server, you alw...
The methods and concepts of private filters and g...
In front-end projects, attachment uploading is a ...
When making some pages, in order to make the page...
MySQL UTF-8 encoding MySQL has supported UTF-8 si...
This article example shares the specific code of ...
Preface Samba is a free software that implements ...
1.17.9 More delicious, really Nginx download addr...