初学HTML5--CSS样式(四)

-CSS属性(红色表示常用)
可继承属性:父标签的属性值会传递给子标签, 一般都是文字控制属性
a.所有标签可继承()
visibilitycursor

b.内联标签可继承
letter-spacing、word-spacing、white-space、line-heightcolor、font、font-familyfont-sizefont-style、font-variant、font-weighttext-decoration、text-transform、direction

c.块级标签可继承
text-indenttext-align

d.列表标签可继承
list-style、list-style-type、list-style-position、list-style-image
不可继承属性:父标签的属性值不能传递给子标签, 一般是区块控制属性
display、margin、border、padding、background
height、min-height、max-height、width、min-width、max-width
overflow、position、left、right、top、bottom、z-index
float
、clear
table-layout、vertical-align
page-break-after、page-bread-before
unicode-bidi

-常用属性代码演示:
a.background
/*background是复合属性,包含背景颜色和背景图片,其中背景图片默认平铺*/
            /*background: blue;*/
            background: url("img/1.jpg");
            /*设置北京图片不平铺*/
            background-size: cover;
b.visibility 规定元素是否可见
  /*
            visible:可见(默认)
            hidden:元素是不可见的
            collapse:当在表格元素中使用时,此值可删除一行或一列,
                     但是它不会影响表格的布局。被行或列占据的空间会留给其他内容使用。
                      如果此值被用在其他的元素上,会呈现为 "hidden"。
            inherit: 规定应该从父元素继承 visibility 属性的值。
            */
            visibility: hidden;
c.cursor规定要显示的光标的类型(形状)
 /*
            常用的有:
            crosshair:光标呈现为十字线。绘图的时候多用
            pointer: 光标呈现为指示链接的指针(一只手)
            move: 此光标指示某对象可被移动。
            help: 帮助
            */
            cursor: pointer;
d .overflow:处理超出的内容
 /*
             hidden:超出隐藏 
             scroll:超出滚动 
             auto:超出滚动
             */
            overflow: auto;
其他常用属性:
/* 设置字体样式 */
            font-family: "Times New Roman";

            /* 设置段落的字体的粗细 */
            font-weight: bolder;

            /* text-decoration:设置元素的文本修饰 */
            text-decoration: underline;

            /*通常用于去除下划线*/
            text-decoration: none;
<span>	</span>    /*首行缩进*/
            text-indent: 30px;
<span>	</span>    text-indent: 7%;
 <span>	</span>    /*list-style:列表类型*/
            /*最主要的用途是去除列表前的符号*/
            list-style: none;
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值