• CSS继承


    1 <!DOCTYPE html>                           
     2 <html lang="en">                          
     3 <head>                                    
     4     <meta charset="UTF-8">                
     5     <title>继承</title>                   
     6     <style>                               
     7     /*                                    
     8     样式的继承:我们作为一个元素的设置样同时也会应用到它的后代元素
                                                    
     9     继承是发生在祖先后代之间的            
    10     继承的设计是为了我们的的开发,利用继承我们可以将一些通用的样式>
       ,设计在共同的祖先样式上,这样我们只需设置一次
    11     注意:并不是所有的样式都会被继承      
    12         比如:背景相关的,布局相关的不会                             
    13     */                                    
    14     body{                                 
    15         font-size:50px;                   
    16     }                                     
    17     p{                                    
    18         color:red;                        
    19     }                                     
    20     div{                                  
    21         color:yellow;                     
    22     }                                     
    23     </style>                              
    24 </head>                                   
    25 <body>                                    
    26     <p>                                   
    27         我是p元素                         
    28     <span>我是p元素中的span</span>        
    29     </p>                                  
    30     <div>                                 
    31         我是div                           
    32         <span>                            
    33             我是div中的span               
    34             <em>我是span中的span</em>     
    35         </span>                           
    36     </div>                                
    37 </body>                                   
    38 </html>                                   
    ~                                                                       
    ~                                                                       
    ~                                              

    笨鸟先飞
  • 相关阅读:
    Oracle10g服务启动命令
    Linux系统添加永久静态路由的方法
    搭建YUM仓库与定制RPM包
    LVS简介
    【Linux】先添加一块磁盘制作LVM卷并进行分区挂载
    函数部分
    Python中if __name__ == "__main__": 的作用 (整理转自Arkenstone) --感谢!
    python语言基础笔记
    部分示例程序
    转,关于游标
  • 原文地址:https://www.cnblogs.com/zoutingrong/p/13950182.html
Copyright © 2020-2023  润新知