CSS
Mengzy007
这个作者很懒,什么都没留下…
展开
-
background
background background:背景颜色 背景图片地址 背景平铺 背景滚动 背景位置background-color background-color: red background-image background-image : url( …….. )background-repeat background-repeat : repeat | no-repeat原创 2017-06-11 21:11:08 · 449 阅读 · 0 评论 -
文本超出出现省略号...
overflow: hidden; text-overflow:ellipsis; white-space: nowrap;原创 2017-10-31 13:47:18 · 333 阅读 · 0 评论 -
CSS两双列布局
1、使用绝对定位.aside{ position: absolute; top: 0; left: 0; bottom: 0; width: 180px;}.main{ width: 100%; margin-left: 180px;}2、使用浮动.aside{ width: 100px; background-color原创 2017-06-13 23:30:18 · 697 阅读 · 0 评论 -
内部盒子居中
1、水平居中:margin必须是块级元素盒子必须指定了宽度(width)原创 2017-06-11 21:35:53 · 444 阅读 · 0 评论 -
vertical-align和text-align
1、vertical-aligna:取值:vertical-align : baseline |top |middle |bottomb:适用于行内元素或者行内块元素(input、img)c:去除图片底侧空白缝隙(3像素)2、text-aligna:取值:vertical-align : left | center | rightb:作用于块元素原创 2017-06-13 00:36:55 · 419 阅读 · 0 评论 -
cursor
cursor :default pointer :小手 move :移动 text :文本原创 2017-06-13 00:28:38 · 209 阅读 · 0 评论 -
元素显示方式
1、displaydisplay:none 隐藏(消失,不占位置)display:block 显示或转换为块元素2、visibility visible : 对象可视hidden : 对象隐藏(占位置)3、overflow 溢出visible : 不剪切内容也不添加滚动条。auto : 超出自动显示滚动条,不超出不显示滚动条hidden : 不显示超过对象尺寸的内容,超出的部分原创 2017-06-13 00:25:52 · 306 阅读 · 0 评论 -
position
1、属性例:position:absolute;static 自动定位(默认定位方式)relative 相对定位absolute 绝对定位,相对于其上一个已经定位的父元素进行定位(不占位置)fixed 固定定位,相对于浏览器窗口进行定位(不占位置)2、relative相对于元素本身的位置进行移动(不脱流)3、absolutea:当没有父元素或父元素没有定位元素时,相对于窗口定位(脱流)b:当父元原创 2017-06-12 23:42:50 · 255 阅读 · 0 评论 -
float
1、浮动:使元素脱离标准普通流,移动到其父元素中相应位置left 元素向左浮动right 元素向右浮动none 元素不浮动(默认值)2、范围:不会超出父元素范围(包含padding)3、浮动位置1、和前一个(块元素)是否浮动有关2、如果其中一个子级有浮动的,则其他子级都需要浮动3、浮动脱离标准流,不占位置,会影响后面的标准流(父元素失去高度)4、元素添加浮动后,元素会具有行内块元素原创 2017-06-11 22:41:46 · 314 阅读 · 0 评论 -
border
1、语法border : border-width || border-style || border-colornone:没有边框即忽略所有边框的宽度(默认值)solid:边框为单实线(最为常用的)dashed:边框为虚线dotted:边框为点线double:边框为双实线原创 2017-06-11 21:20:13 · 309 阅读 · 0 评论 -
margin
1、相邻块元素垂直外边距的合并 当上下相邻的两个块元素相遇时,如果上面的元素有下外边距margin-bottom,下面的元素有上外边距margin-top,则他们之间的垂直间距不是margin-bottom与margin-top之和,而是两者中的较大者。这种现象被称为相邻块元素垂直外边距的合并(也称外边距塌陷)。2、嵌套块元素垂直外边距的合并对于两个嵌套关系的块元素,如果父元素没有上内边距及边原创 2017-06-11 21:49:13 · 781 阅读 · 1 评论 -
a:focus 和 a:active 区别
a:focus 获得焦点的时候 鼠标松开时显示的颜色a:active 当前活动元素 鼠标在元素上按下还没有松开原创 2017-06-11 21:31:27 · 4959 阅读 · 0 评论 -
tab切换
/tab切换/.tab-common { width: 100%; background-color: #25303c;}.tab-common .tab-nav { display: inline-block;}.tab-common .tab-nav li { width: 100px; height: 40px; text-align:原创 2017-10-24 10:48:30 · 327 阅读 · 0 评论