行内样式表

1 <html>
2     <head>
3           <title>行内样式表</title>
4     </head>
5     <body>
6         <p style="color:blue;font-size:10px;">aaaaaaa</p>
7     </body>
8 </html>    

 

内嵌样式表

 1 1 <html>
 2 2     <head>
 3 3           <title>内嵌样式表</title>
 4 4     </head>
 5       <style>
 6             p{
 7                   color:blue;
 8                   font-family:"宋体";
 9                }
10       </style>
11 5     <body>
12 6         <p >aaaaaaa</p>
13 7     </body>
14 8 </html>    

 

链接外部样式表

one.css代码

body{
      color:blue;
      font-size:10px;  
}

 html代码

<head>
    <link rel="stylesheet" href="one.css"  type="text/css">
</head>

 

导入外部样式表

one.css代码

body{
      color:blue;
      font-size:10px;  
}

 html代码

<head>
   <style type="text/css">
   @import "one.css"
   </style>
</head>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2021-11-04
  • 2021-11-27
猜你喜欢
  • 2021-11-24
  • 2022-02-24
  • 2021-12-15
  • 2022-01-05
  • 2022-02-15
  • 2021-08-30
相关资源
相似解决方案