zoukankan      html  css  js  c++  java
  • 什么是css继承?哪些属性能继承,哪些不能?

    CSS继承可定义为特定的css属性向下传递到子孙元素,就是指被包在内部的标签将拥有外部标签的样式,即子元素可以继承父元素的属性。

    一、能继承的属性

    1. 字体系列属性:font、font-family、font-weight、font-size、font-style;
    2. 文本系列属性:
    (1)内联元素:color、line-height、word-spacing、letter-spacing、text-transform;
    (2)块级元素:text-indent、text-align;
    3. 元素可见性:visibility
    4. 表格布局属性:caption-side、border-collapse、border-spacing、empty-cells、table-layout;
    5. 列表布局属性:list-style
    6. 生成内容属性:quotes
    7. 光标属性:cursor
    8. 页面样式属性:page、page-break-inside、windows、orphans;
    9. 声音样式属性:speak、speech-rate、volume、voice-family、pitch、stress、elevation;

    二、不能继承的属性

    1. display:规定元素应该生成的框的类型;
    2. 文本属性:vertical-align、text-decoration;
    3. 盒子模型的属性:width、height、margin 、border、padding;
    4. 背景属性:background、background-color、background-image;
    5. 定位属性:float、clear、position、top、right、bottom、left、min-width、min-height、max-width、max-height、overflow、clip;
    6. 生成内容属性:content、counter-reset、counter-increment;
    7. 轮廓样式属性:outline-style、outline-width、outline-color、outline;
    8. 页面样式属性:size、page-break-before、page-break-after;
    9. 声音样式属性:pause、cue、play-during;

  • 相关阅读:
    职业生涯起步不要去顶级公司
    discuz uc密码修改
    习惯决定成功与否
    世上没有理想的工作
    中山市慧海人力资源服务有限公司
    Codeforces Round #365 (Div. 2) B 前缀和
    Codeforces Round #365 (Div. 2) A 水
    tyvj 1067 dp 两次LIS(nlogn)
    Codeforces Round #303 (Div. 2) D 贪心
    Codeforces Round #303 (Div. 2) C dp 贪心
  • 原文地址:https://www.cnblogs.com/qinglaoshi/p/13246121.html
Copyright © 2011-2022 走看看