在网页中嵌入css的三种方式

在网页中嵌入css的三种方式:

  1. 行内式:
    1 <html>
    2 <head></head>
    3 <body>
    4 <h1 style="font-size:12px" align="center">行内式</h1>
    5 </body>
    6 <html>
  2. 内联式:
     1 <html>
     2 <head>
     3 <style type="text/css">
     4 h1{font-size:12px;text-align:center;}
     5 </style>
     6 </head>
     7 <body>
     8 <h1>内联式</h1>
     9 </body>
    10 <html>
  1. 外联式:
    1 <html>
    2 <head>
    3 <link href="1.css" rel="stylesheet" type="text/css">
    4 </head>
    5 <body>
    6 <h1>外联式</h1>
    7 </body>
    8 <html>

    1.css的代码:

    1 h1{
    2 font-size:12px;
    3 text-align:center;
    4 }
原文地址:https://www.cnblogs.com/dzqdzq/p/3010494.html