CSS教程

edu平台Web实训CSS样式规则

本文主要是介绍edu平台Web实训CSS样式规则,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

第1关CSS基础知识

BDCAB

第2关初识CSS

<!DOCTYPE html>
<html>
  <head>
   <meta charset="utf-8"/>
   <title>初识CSS样式</title>
  </head>
  <body>
   <div style="background-image:url(https://www.educoder.net/api/attachments/1426624);width:360px;height:260px;">
    <!-- ********* Begin ********* -->
    <h1 style="font-family:楷体;text-align:center;line-height:2;">静夜思</h1>
    <h2 style="font-family:楷体;text-align:center;">床前明月光</h2><br>
    <h2 style="font-family:楷体;text-align:center;">疑是地上霜</h2><br>
    <h2 style="font-family:楷体;text-align:center;">举头望明月</h2><br>
    <h2 style="font-family:楷体;text-align:center;">低头思故乡</h2>  
        
        
        
        
    <!-- ********* End ********* -->
    </div>
  </body>
</html>

第3关用内嵌式引入CSS样式

<!DOCTYPE html>
<html lang="zh">
 <head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>内嵌CSS样式</title>
  <style type="text/css">
    /* ********** BEGIN ********** */   
    body {
      background-image:url(https://www.educoder.net/api/attachments/1427381);
      background-size:cover;


    }
    /* ********** END ********** */   
    div {
        position:fixed;
           left:400px;
            top:100px;
           color:#ffffff;
       font-family:黑体;
        text-align:center;
    }   
  </style>
 </head>
 <body>
  <div>
   <h1>静夜思</h1>
   <h2>床前明月光</h2>
   <h2>疑是地上霜</h2>
   <h2>举头望明月</h2>
   <h2>低头思故乡</h2>
  </div>
 </body>
</html>

第4关用外链式引入CSS样式

<!DOCTYPE html>
<html lang="zh">
 <head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>外链CSS样式</title>
     <!-- ********** BEGIN ********** -->
     <link href="https://www.educoder.net/api/attachments/1433016"    
    type="text/css" rel="stylesheet"/>

     <!-- ********** END ********** -->
 </head>
 <body>
  <div>
   <h1>静夜思</h1>
   <h2>床前明月光</h2>
   <h2>疑是地上霜</h2>
   <h2>举头望明月</h2>
   <h2>低头思故乡</h2>
  </div>
 </body>
</html>

这篇关于edu平台Web实训CSS样式规则的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!