
HTML&CSS
网站制作中的相关问题
hello王富贵
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
css3实现多个li纵向排列且可以自动换行
html代码:实现方法:通过height来控制行数。原创 2022-07-12 10:30:11 · 1561 阅读 · 0 评论 -
CSS3字号11/10/9/8px实现方法
font-size: 12px;transform: scale(0.91,0.91) ;首先自定义字号为12像素,因为浏览器支持的最小就是12像素,之后通过缩放来实现想要的字号:11px = 11/12=0.916666666666666710px = 10/12=0.8333333333333333我们取小数点后2位替换scale的值即可。...原创 2021-07-31 15:43:23 · 4143 阅读 · 0 评论 -
css3 鼠标经过PNG图片变纯色
<div class="demo"><img src="1.png" alt=""></div><style type="text/css"> /*无用的样式*/ .demo{width: 100px;height: 100px;border-radius: 50%;text-align: center;display: flex;align-items: center;justify-content: center;border: 2px solid原创 2021-01-30 14:04:26 · 266 阅读 · 0 评论 -
<pre>标签内文字的字体字号及换行等样式定义
.demo pre { /*字体样式*/ font-family: micsoft yahei; font-size: 16px; line-height: 2; color: #FFF; /*定义宽度*/ width: 800px; margin: auto; padding: 10px; /*背景色*/ background: #000; /*pre文字自动换行*/ white-space: pre-wrap; wh原创 2020-11-25 10:10:43 · 4271 阅读 · 0 评论 -
CSS实现页面滚动时body背景不动
body{ background-image: url(../img/bg.jpg); background-position: center center; background-repeat: no-repeat; background-attachment: fixed; background-size: cover; }原创 2020-11-13 13:50:10 · 1693 阅读 · 0 评论 -
CSS3 图片保持原有尺寸比例同时进行剪切主要内容
该属性用于解决网站缩略图固定宽高的变形img{ width: 200px; height: 400px; object-fit: cover; }原创 2020-07-13 16:29:09 · 430 阅读 · 0 评论 -
css3 垂直居中
垂直居中display: flex;align-items: center;justify-content: center;原创 2020-06-24 08:24:49 · 170 阅读 · 0 评论 -
CSS3 animation动画使用方法
.demo.on{ animation-name: rotateInDownLeft;/*所需运行的动画名称*/ animation-duration: 5s;/*在5秒内完成动画*/ animation-delay: 3s;/*等待3秒开始动画*/ animation-iteration-count: 1;/*动画运行次数,最后停止,数字或infinite(无限次),*/ 下面尚未测试 /*animation-direction: alternate;轮流反向播放动画*/ /*anima原创 2020-06-22 16:51:59 · 241 阅读 · 0 评论 -
input常用功能
关闭历史搜索:<input type="text" class="text" autocomplete="off"/>原创 2020-06-15 16:43:45 · 319 阅读 · 0 评论 -
哀悼期间CSS3调整网站为灰白色
html { -webkit-filter: grayscale(1); -moz-filter: grayscale(1); -ms-filter: grayscale(1); -o-filter: grayscale(1); filter: grayscale(1); filter: progid: DXImageTransform.Microsoft.BasicImage(gra...原创 2020-04-03 15:22:43 · 235 阅读 · 0 评论 -
CSS超出文本省略号...
一行文本超出显示省略号,仅需要三个属性① 溢出隐藏② 溢出省略号显示③ 溢出不换行.demo{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}原创 2020-01-10 11:21:47 · 289 阅读 · 0 评论 -
CSS 颜色黑白
.demo { -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: grayscale(100%); filter: gray;}原创 2020-01-08 09:04:48 · 413 阅读 · 0 评论 -
video标签隐藏全屏和下载按钮
nofullscreen隐藏全屏按钮,nodownload隐藏下载按钮,可单独使用也可以一起使用。<video width="600" height="400" controls controlsList='nofullscreen nodownload' > <source src="mp4/01.mp4" type="video/mp4"></video...原创 2019-12-24 09:33:27 · 1999 阅读 · 0 评论 -
html返回上一页
<a href="javascript:history.go(-1);">返回</a>原创 2019-12-23 15:52:58 · 194 阅读 · 0 评论 -
font-face使用方法
@font-face{ font-family: name1; src: url('../fonts/font1.otf');}@font-face{ font-family: name2; src: url('../fonts/font2.ttf');}.demo1{font-family: name1;}.demo2{font-family: name2;}原创 2019-12-23 15:50:59 · 288 阅读 · 0 评论 -
css图片最大不超过容器宽度
img{max-width: 100%;height: auto!important;width: auto\9!important;}最大宽度不超过容器,高度自适应,“\9”是只有IE8,IE9及以上版本识别原创 2019-12-23 09:51:18 · 2118 阅读 · 0 评论 -
background-color没有none?
我们想给一个类加上背景颜色为“none”时,会发现并没有这个属性,这时我们就该用到:background-color: transparent;原创 2019-12-21 16:24:56 · 7080 阅读 · 0 评论 -
rem 750设计稿用js
+ function() { remLayout(); function remLayout() { var w = document.documentElement.clientWidth; w = w > 768 ? 768 : w; w = w <= 320 ? 320 : w; document.documentElement.style.fontSize ...原创 2019-12-09 10:10:07 · 366 阅读 · 0 评论 -
CSS3中 :nth-child()选择器的应用
ul下的第12个li字体颜色为红色ul li:nth-child(12){color: red;}ul下的前10个li字体颜色为红色ul li:nth-child(-n+10){color: red;}原创 2019-11-27 13:40:43 · 248 阅读 · 0 评论 -
CSS3 翻转镜像
垂直翻转,例:" 士 " 变 " 干 ".demo{transform: rotateX(180deg);}水平翻转,例:" > " 变 " < ".demo{transform: rotateY(180deg);}原创 2019-12-18 14:09:09 · 918 阅读 · 0 评论 -
CSS英文大小写
英文大写text-transform: uppercase;英文小写text-transform: lowercase;单词首字母大写text-transform: capitalize;原样式text-transform: none;原创 2019-12-18 14:16:33 · 710 阅读 · 0 评论 -
CSS中display: inline-block;缝隙问题
有缝隙的原因是因为html中把换行当做一个字符,解决方法如下:1、父元素设置字号为0,个人比较推荐这个。font-size: 0;2、html不换行,这个不适合强迫症的我。<div class="box"> <span>发布:2019-12-12</span> <span>阅读:1175次</span></div&g...原创 2019-12-19 09:53:29 · 121 阅读 · 0 评论 -
CSS背景颜色渐变
背景颜色渐变,白色过度到黑色,从上到下垂直渐变。.demo{background: -webkit-gradient(linear, left top, left bottom, from(#FFF), to(#000));}原创 2019-12-27 10:00:49 · 422 阅读 · 0 评论