Html中常用的操作
1、鼠标变成小手
style="cursor:pointer"
2、html怎么在网页标题栏上显示图标
<link rel="icon" href="图标地址" type="image/x-icon">
<link rel="shortcut icon" href="图标地址" type="image/x-icon">
3、去掉a标签的下划线并修改a标签字体颜色
text-decoration:none;color:black
4、去除ul前面的空格
margin: 0;padding: 0;
5、文字超出不换行
white-space: nowrap;text-overflow: ellipsis;
6、内容垂直居中
display: flex;justify-content: center;align-items: center;
7、文字超出内容隐藏并并显示省略号
overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
overflow: hidden;text-overflow: ellipsis;display: -webkit-box-orient: vertical;-webkit-box;
-webkit-line-clamp: 3;
overflow:auto;
overflow:scroll;
overflow:visible;
overflow:hidden;
8、p标签间距
margin: 0;
padding: 5px;
9、内容分布两边
display: flex;justify-content: space-between;
10、页面边距空白和x轴显示滚动条处理
body,
html {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow-x: hidden;
}
11、图片比例占满整个页面
width: 100vw;height: 100vh;
12、文字浮动在图片上方
position: absolute;
width: 100%;
height: 50px;
left: 0px;
bottom: 15px;
z-index: 100;
text-align: center;
color: white;
font-size: 25px;
font-family: "黑体";
font-weight: bold;
X、滚动条显示及样式美化
overflow-y: scroll;
overflow-x: scroll;
::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
border-radius: 0;
}
::-webkit-scrollbar {
-webkit-appearance: none;
width: 2px;
height: 2px;
}
::-webkit-scrollbar-thumb {
cursor: pointer;
border-radius: 5px;
background: rgba(0, 0, 0, 0.15);
transition: color 0.2s ease;
}