文章面向开发人员分享五个简短实用的CSS技巧:用scroll-behavior实现平滑滚动,用max-width和height:auto让图片自适应,用cursor自定义光标,用Flex布局三行代码居中元素,以及用
html {scroll-behavior: smooth;}
img {max-width:100%;height:auto;}
body {cursor: url("images/cursor.png"), auto;}
.center {width: 300px;height: 300px;display: flex;justify-content: center;align-items: center;}
p {-webkit-line-clamp: 5;}
评论