css复习1

*******************页面中引入css将css放入到head中**************************************

1.css样式引入及背景相关设置

<head>

 <style type="text/css">

 h1  { backgroundcolor:yellow; padding: 20px}*****设置了背景色,内边距

span.cs { backgroudcolor:yellow;}

body {background-image:url(/i/eg_bg_04.gif); background-repeat: repeat}--设置背景图片;可以重复背景色;其中repeat-x或者-y可以横向或者纵向重复显示。no-repeat 不重叠显示 background-position:center; 放置位置 ,居中,也可以用%百分比显示,如20% 30% 分别表示居左,居上的距离
也可以用像素表示,如 50px 50px;background-attachment:fixed 背景图片是否随页面进行滚动 scrol

</style>

</head>

<body>

 <span class="cs"> 这是文本</span>  表示文本,一般用span  其的.表示class名称 #中表示id

</body》

2.css文本

文本颜色:color:red; 文本为红色 background-color:yellow; 背景色

letter-spacing:-0.5em;20px 设置字符间距

line-height:100%;200px; 段落中的行间距

text-algin:left;right;center ,justify 两端对齐文本对齐方式

text-decoration:overline,underline,linethrough,none  对文本增加上,下,中,或者没有下划线

text-indent:1cm ;文本缩进

text-transform: uppercase,lowercase,captalize :控制文本中的字母的大小写转换为大写,小写,首字母大写

white-space: nowrap; normal;pre 浏览器不会合并 文本不折行,不换行

word-spacing:30px; 段落中单词的距离

3.css  font 字体

   font-family: 设置字体

font-size:150% 设置字体大小

font-style:normal ;italic;oblique 设置字体风格正常,还是倾斜

font-variant:小型大写字母

font-weight:900设置字体的粗细100到900 bold 粗体

4.css边框 border  生命:所有的边框属性如果想要显示,color,width, 必须要有style

border-style:dotted,double  按照顺序top-right-bottom-left

border-width:5px可以指定长度值,比如 2px 或 0.1em;或者使用 3 个关键字之一,它们分别是 thin 、medium(默认值) 和 thick。

border-color:rgb(250,0,255)

border-top(right-bottom-left)-sytle/color/width 可以分别设置

5.css外边距  指元素边框外的空白区域

margin (-top,right-bottom-left)

6.padding 内边距  值内容和边框之间的距离

padding-(top,right,bottom,left)

7.列表样式 ul  ol

 list-style-type:circle ,square

list-style-image:url() 图片作为列表

8.表格

border-collapse:collapse; 将表格的边框显示为一条边

9.外边框 outLine  sytyle   color

10.display:是否显示:none  默认不显示

11.float;left  right 浮动

12.clear  :left 左侧或者右侧不出现浮动元素

13.cursor : 鼠标指针发生变化
















 









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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值