摘要: Flex是Flexible Box的缩写,意为"弹性布局",用来为盒状模型提供最大的灵活性。设为Flex布局以后,子元素的float、clear和vertical-align属性将失效。它即可以应用于容器中,也可以应用于行内元素。 常用例子 子元素在容器中心位置(垂直居中、水平居中) display 阅读全文
posted @ 2022-09-06 09:30 huangchun0121 阅读(649) 评论(0) 推荐(0)
摘要: 2、溢出隐藏 文字溢出操作 效果图:单行+溢出隐藏 .nameBox { // 文字不允许换行(单行文本) white-space: nowrap; // 溢出部分隐藏 overflow: hidden; // 文本溢出后,使用 ... 代替 text-overflow: ellipsis; mar 阅读全文
posted @ 2022-09-05 23:15 huangchun0121 阅读(449) 评论(0) 推荐(0)
摘要: <script> var t=null; t=setTimeout(time,1000); function time(){ clearTimeout(t);//清除定时器 dt=new Date(); var y=dt.getFullYear(); var mt=dt.getMonth()+1; 阅读全文
posted @ 2022-09-05 23:09 huangchun0121 阅读(58) 评论(0) 推荐(0)
摘要: /* 背景图片 */ background-image:url('../images/bg2.jpg'); /* 背景图片位置固定 */ background-attachment:fixed; /* 背景不重复 */ background-repeat:no-repeat; /* 背景位置居中 * 阅读全文
posted @ 2022-09-05 22:58 huangchun0121 阅读(679) 评论(0) 推荐(0)
摘要: 点击查看代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" cont 阅读全文
posted @ 2022-09-05 22:44 huangchun0121 阅读(239) 评论(0) 推荐(0)