摘要: 标签转换成行内块 display:inline-block; 可以使标签获得宽和高 阅读全文
posted @ 2022-05-10 16:42 hi123hi159 阅读(42) 评论(0) 推荐(0)
摘要: box-sizing: border-box盒子内边距不增大 *{ /*不增大*/ box-sizing: border-box; } 设置后父元素就不会跟着增大了 阅读全文
posted @ 2022-05-10 16:38 hi123hi159 阅读(67) 评论(0) 推荐(0)
摘要: 字体垂直居中 /*文字垂直居中,50为盒子的高度*/ line-height:50px 阅读全文
posted @ 2022-05-10 16:18 hi123hi159 阅读(59) 评论(0) 推荐(0)
摘要: list-style:none去掉列表的符号: ul{ list-style:none; } 阅读全文
posted @ 2022-05-10 16:12 hi123hi159 阅读(246) 评论(0) 推荐(0)
摘要: 代码如下: a{ text-decoration: none; width: 100px; height: 50px; background-color: red; display: inline-block; color: white; text-align: center; line-heigh 阅读全文
posted @ 2022-05-10 13:18 hi123hi159 阅读(69) 评论(0) 推荐(0)
摘要: a标签转块 a{ text-decoration: none; width: 100px; height: 50px; background-color: red; display: inline-block; color: white; text-align: center; line-heigh 阅读全文
posted @ 2022-05-10 13:13 hi123hi159 阅读(71) 评论(0) 推荐(0)
摘要: display: inline-block: 将多个div转换成在同一行 代码如下: div{ /*将多个块转换成在同一行*/ display: inline-block; } 阅读全文
posted @ 2022-05-10 12:55 hi123hi159 阅读(158) 评论(0) 推荐(0)
摘要: 去除html页面和body之间的空白 代码如下: * { margin: 0; padding: 0; } 阅读全文
posted @ 2022-05-10 12:39 hi123hi159 阅读(123) 评论(0) 推荐(0)
摘要: 背景图垂直水平居中: background-position: center; 阅读全文
posted @ 2022-05-10 12:29 hi123hi159 阅读(94) 评论(0) 推荐(0)
摘要: 背景图拉伸铺满 background: url("img.jpg") no-repeat; background-size:100% 100%; 阅读全文
posted @ 2022-05-10 12:24 hi123hi159 阅读(194) 评论(0) 推荐(0)
摘要: 超链接去下划线: a{ /*超链接去下划线*/ text-decoration: none; } 阅读全文
posted @ 2022-05-10 11:56 hi123hi159 阅读(160) 评论(0) 推荐(0)
摘要: 让div(盒子)水平居中 可以通过margin: 0 auto 实现 文字居中 text-align: center; 阅读全文
posted @ 2022-05-10 09:18 hi123hi159 阅读(49) 评论(0) 推荐(0)
摘要: 取值: 1.数字+px 2.倍数(当前标签font-size的倍数) p{ /*line-height: 50px; */ line-height: 1.5; //字体的1.5倍 } 字体行的间距 阅读全文
posted @ 2022-05-10 08:26 hi123hi159 阅读(23) 评论(0) 推荐(0)
摘要: 代码如下: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <style> p{ /*首行缩进2个字的大小*/ text-indent: 2em; } </style> <body> <p> 总 阅读全文
posted @ 2022-05-10 08:17 hi123hi159 阅读(102) 评论(0) 推荐(0)
摘要: 下面就是复合属性的写法: p{ /* font:style样式 weight粗细 size大小 字体 */ font: italic 700 66px 宋体 /*上面就是复合属性的写法*/ } 阅读全文
posted @ 2022-05-10 08:06 hi123hi159 阅读(70) 评论(0) 推荐(0)