
css
goengjin
这个作者很懒,什么都没留下…
展开
-
width: auto、width: 100%、max-width
<div class="parent"> <div class="child"> </div> </div> <style> .parent { width: 100px; background-color: red; } .child { width: 100%; background-color: blue; } </style> 上面代码中child的宽度设置为100%,意思是child的content的宽度等于parent的原创 2020-12-16 16:36:26 · 626 阅读 · 0 评论 -
鼠标移入div显示按钮,移出隐藏按钮
鼠标移入时: 鼠标移出时: 实现: <div class="father"> <button class="son">我是按钮</button> </div> .father{ background-color: burlywood; height: 30px; &:hover .son{ display: block; // 设置父元素hover时子元素的样式 } } .s原创 2020-12-11 11:15:32 · 4004 阅读 · 0 评论