css层叠样式表基础知识笔记

css层叠样式表基础知识笔记

1.文字

文字大小:font-size
文字粗细:font-weight:100~900(粗细的值);
文字样式:font-family:样式;
斜体:font-style:italic;
文字居中:text-align:center;
文字垂直:line-height:数值;
文字阴影:text-shadow:x y 大小 颜色 距离;

2.颜色

颜色:color:tranparent(无色);或者 color:rgb;或者 color:rgba;
背景颜色:background-color:rgba;
背景图片:background-image
背景大小:background-size
图片位置:background-position
图片平铺:background-repeat

3.盒子

:width
:height
外边距:margin
内边距:padding
盒子边框:border:边框宽度 样式 颜色 (三个值);

4.浮动

浮动:float:left或者right;

小知识点:清除浮动的代码

.clearfloat::after {
				display: block;
				clear: both;
				overflow: hidden;
				height: 0;
				content: "";
			}
.clearfloat {
				zoom: 1;
			}

5.定位

相对定位:position:relative;
绝对定位:position:absolate;
固定定位:position:fixed;
粘性定位:position:sticky;
默认定位:position:static;

6.表格 table

表格边框:border=“ ”;
单元格间距:cellspacing=“ ”;
距离边框:cellpadding=“ ”;
合并行:colspan=“ ”;
合并列:rolspan=“ ”;

7.选择器

派生选择器:空格;
直接子元素选择器:大于号;
相邻兄弟选择器:加号;
所有兄弟选择器:波浪线;
所有子元素选择器:星号;
并集选择器:逗号;

8.伪类选择器

之后:::after
之前:::before
移入:::hover
焦点:::focus
激活:::active
第一个:::first
最后一个:::last
子类第一个::first-child
子类最后一个::last-child
子类某一个::nth-child

知识小重点:

清除a标签的下划线:

a {
				text-decoration: none;
			}

清除ul小圆点:

ul {
				list-style: none;
			}

鼠标的小手样式:

cursor:pointer;

清除浏览器默认边距:

* {
				margin: 0;
				padding: 0;
			}

本周笔记就到这啦,拜拜!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值