CSS学习记录2

1、分组选择器

标记选择器    类选择器    ID选择器    搭配使用

span,p,h1{color:#eee;}

<span></span>

<p></p>

<h1></h1>


2、派生选择器

通过父级找子级

div span{color:#eee;}

<div><span></span></div>


3、属性选择器

[name]{color="#eee";}

[name="username"]{color="#eee";}

input[name="username"]{color="#eee";}


<input type="text" name="username" value="" />

<input type="passwords" name="psd" value="" />

<textarea name="username"></textarea>


1、字体样式

颜色      color:

字号      font-size:

字体      font-family:Arail 

             font-family:"微软雅黑","隶书","楷书";

加""  中文;带有空格或者其它符号

风格      font-style:normal;改斜归正

             font-style:italic;文字倾斜

             font-style:oblique;文本倾斜

字体粗细  font-weight:normal;由粗变细  

                font-weight:bold;由细变粗


2、文本样式

首行缩进                 text-indent:2em;   em是一个字号大小  1em=16px

对齐方式                 text-align:left/center/right;

行高                        line-height:30px;

字间距                     word-sapcing:10px; 在中文(有空格的地方)

字母间距                 letter-spacing:10px;中文(每个字)

字母大小写的转换   text-transform:uppercase  大写

                                text-transform:lowercase  小写

                                textt.-transform:capitalize 首字母大写

文本修饰        text-decoration:underline;下划线

                      text-decoration:overline;上划线

                      text-decoration:line-through;贯穿线(删除线)


3、背景

背景色

background-color:

英文

十六进制

rgb(0,0,0) 0-255

rgba(0,0,0,0.5) 带有透明,0-1 1没有透明度(背景色透明,字不透明)

opacity:0.5 背景色和字都透明

width:100px  height:100px

背景图片

background-image:url(图片路径)

background-repeat:no-repeat;    不重复

background-repeat:repeat-x;      水平方向重复

background-repeat:repeat-y;      垂直方向重复

定位:background-position:100px 100px

background-position:100px        水平方向和垂直方向都是移动100px

固定数字 100px 50px;                水平向右移100px 垂直向下移动50px

百分比 10% 50%;                    当前容器的百分比

关键字 left top; bottom center;right

background-position:left  另外一个值默认为center

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值