A simple example of how to use the three methods is as follows: Inline styles: <!doctype html> <html> <head> <meta charset="UTF-8"> <title>css inline style</title> </head> <body> <div style="width:100px;height:100px;background:red;"></div>> </body> </html> Inline styles: <!!doctype html> <html> <head> <meta charset="UTF-8"> <title>css embedded style</title> </head> <body> <style type="text/css"> #div{width:100px;height:100px;background:red;} </style> <div id="div"></div>> </body> </html> External type: <!doctype html> <html> <head> <meta charset="UTF-8"> <title>css embedded style</title> <link rel="stylesheet" type="text/css" href="ccss.css"> </head> <body> <div id="div"></div>> </body> </html> css file #div{width:100px;height:100px;background:red;} In short: Inline style: the code is written in an element on a specific web page; for example: <div style="color:#f00"></div> Inline: just write it before </head>; for example: <style type="text/css">.div{color:#F00}</style> External style: refers to an external CSS file; for example: <link href="css.css" type="text/css" rel="stylesheet" /> The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Detailed tutorial on installing CentOS, JDK and Hadoop on VirtualBox
>>: Newbies quickly learn the steps to create website icons
The :not pseudo-class selector can filter element...
Often, after a web design is completed, the desig...
You need to add "gt_" in front of the f...
1. Introduction In the past, if you wanted to emp...
What is pip pip is a Python package management to...
Be sure to remember to back up your data, it is p...
Most of the commands below need to be entered in ...
Table of contents 1. What is a window function? 1...
Let me briefly describe some common basic graphic...
<br />Related articles: innerHTML HTML DOM i...
Let’s take a look first. HTML source code: XML/HT...
Therefore, we made a selection of 30 combinations ...
Table of contents Why use gzip compression? nginx...
Scenario 1: Html: <div class="outer"...
question: Recently, garbled data appeared when de...