Blogger Information
Blog 12
fans 0
comment 0
visits 7835
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
HTML/CSS基础总结(基本标签和css样式及选择器使用示例)2018-08-10
Jimi的博客
Original
567 people have browsed it

实例

实例
       <meta charset="UTF-8"><!-- 字符集编码 -->
       <title>PHP中文网-视频教程</title>
       <!-- link:定义文档与外部资源的关系 链接外部文件 -->
       <link rel="stylesheet" type="text/css" href="static/style.css">
       <!-- 链接外部css样式 外部样式:为了共享 -->
       <link rel="shortcut icon" type="image/x-icon" href="images/footlogo.png">
       <!-- 让titile内部放入图片 -->
       <style type="text/css" >/*内部样式:只针对当前页面*/
           /*tag标签名、id名(名字前面加#)、class名(名字前面加.)、属性选择器    */
           body{}/*标记选择器*/
           #box{width:100px;height: 100px;background: pink; }/*id选择器*/
           .main{width:100px;height: 100px;background: green; }/*class选择器  类*/
           
           a{color: red;}
           /*属性选择器*/
           a[href="http://www.php.cn/"]{color:blue;}
           a[href="demo2.html"]{color:pink; }
           /*派生选择器 根据文档上下文关系来定义样式*/
           div a{color: #000;}
           #box a{}


       </style>
   </head>
   <body><!-- 内联样式 style="background:blue;" -->
       <img src="images/bd_logo1.png" alt="logo" style="width: 100px;"><!-- 内联样式 -->
       <a href="https://www.baidu.com">百度</a><!-- 链接到百度 -->
       <a href="http://www.php.cn/">php中文网</a>
       <a href="demo2.html">demo2</a><a href="#">#</a><!-- 链接到外部文件 -->

       <div id="box">
           <a href="">php</a>
       </div>
       <div class="main"></div>
   </body>
   </html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

IMG_4383.JPG

Correction status:qualified

Teacher's comments:手写代码记得补上!!!
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post