html与css笔记
文章平均质量分 60
web前端定做
这个作者很懒,什么都没留下…
展开
-
Vue 深度作用选择器 /deep/穿透 与scoped
使用 scoped 后,父组件的样式将不会渗透到子组件中。<template> <div id="app"> <el-input class="text-box" v-model="text"></el-input> </div></template><script>export default { name: 'App', data() { return { text转载 2021-11-23 21:23:03 · 1913 阅读 · 0 评论 -
子元素在父元素中定位:居中显示
水平居中(margin:0 auto;)关于这个,大家应该是最不陌生的,不管是在培训班还是自己自学的话 。这个应该是老师讲的第一个方法了(水平方向上),但是其有一个前提,就是被包裹的元素不能有浮动的属性。否则的话这个属性就会失效。具体如下图代码:<style> body{margin: 0;} .box{ width: 400px; height: 400px; border:1px so原创 2021-07-19 14:05:27 · 336 阅读 · 0 评论 -
关于overflow:hidden的作用(溢出隐藏、清除浮动、解决外边距塌陷等等)
overflow 属性: 规定当内容溢出元素框时发生的事情。一. overflow:hidden 溢出隐藏给一个元素中设置overflow:hidden,那么该元素的内容若超出了给定的宽度和高度属性,那么超出的部分将会被隐藏,不占位。/*css样式*/<style type="text/css"> div{ width: 150px; height: 60px; background: skyblue; overflow: hidden; /*溢出隐藏*/转载 2021-07-19 14:04:31 · 801 阅读 · 0 评论 -
实现播放遮罩:css中的显示与隐藏,通过定位position【子绝父相】
点击前画面:鼠标移动进来的画面:素材: * { margin: 0; padding: 0; } .box { position: relative; height: 225px; width: 400px; background-color: #00FF00; margin: 20px auto; } img { width: 100%; } #zheZhao{ displa原创 2021-07-19 14:02:52 · 151 阅读 · 0 评论