.icon-img-content的宽度问题
来源:7-5 Vue项目首页 - 图标区域页面布局
慕虎5515243
2020-11-18
热门景点
热门景点
热门景点
热门景点
热门景点
热门景点
热门景点
热门景点
老师 我看你 .icon-img-content没有加width:100%
是可以的,但是我这里怎么不加上就会有出现图片中的问题
2回答
-
这个可能是浏览器或者调试工具的问题,你不用管我的,版本有些老了,你用你的环境跑正确即可。
012020-11-19 -
慕虎5515243
提问者
2020-11-18
<template>
<div class="icons">
<div class="icon">
<div class="icon-img">
<img class="icon-img-content"
src="https://imgs.qunarzz.com/p/tts3/2011/a0/4aaf7e284da44402.jpg_224x148_450bfa61.jpg">
</div>
<p class="icon-desc">热门景点</p>
</div>
<div class="icon">
<div class="icon-img">
<img class="icon-img-content"
src="https://imgs.qunarzz.com/p/tts3/2011/a0/4aaf7e284da44402.jpg_224x148_450bfa61.jpg">
</div>
<p class="icon-desc">热门景点</p>
</div>
<div class="icon">
<div class="icon-img">
<img class="icon-img-content"
src="https://imgs.qunarzz.com/p/tts3/2011/a0/4aaf7e284da44402.jpg_224x148_450bfa61.jpg">
</div>
<p class="icon-desc">热门景点</p>
</div>
<div class="icon">
<div class="icon-img">
<img class="icon-img-content"
src="https://imgs.qunarzz.com/p/tts3/2011/a0/4aaf7e284da44402.jpg_224x148_450bfa61.jpg">
</div>
<p class="icon-desc">热门景点</p>
</div>
<div class="icon">
<div class="icon-img">
<img class="icon-img-content"
src="https://imgs.qunarzz.com/p/tts3/2011/a0/4aaf7e284da44402.jpg_224x148_450bfa61.jpg">
</div>
<p class="icon-desc">热门景点</p>
</div>
<div class="icon">
<div class="icon-img">
<img class="icon-img-content"
src="https://imgs.qunarzz.com/p/tts3/2011/a0/4aaf7e284da44402.jpg_224x148_450bfa61.jpg">
</div>
<p class="icon-desc">热门景点</p>
</div><div class="icon">
<div class="icon-img">
<img class="icon-img-content"
src="https://imgs.qunarzz.com/p/tts3/2011/a0/4aaf7e284da44402.jpg_224x148_450bfa61.jpg">
</div>
<p class="icon-desc">热门景点</p>
</div><div class="icon">
<div class="icon-img">
<img class="icon-img-content"
src="https://imgs.qunarzz.com/p/tts3/2011/a0/4aaf7e284da44402.jpg_224x148_450bfa61.jpg">
</div>
<p class="icon-desc">热门景点</p>
</div>
</div>
</template>
<script>
export default {
name: "HomeIcons"
}
</script>
<style lang="stylus" scoped>
@import '~styles/varibles.styl'
.icons
overflow: hidden
height: 0
padding-bottom 50%
.icon
overflow: hidden
float: left
width: 25%
height: 0
padding-bottom 25%
position: relative
.icon-img
position: absolute
top: 0
right: 0
left: 0
bottom: .44rem
box-sizing border-box
padding: .1rem
.icon-img-content
display: block
margin: 0 auto
height: 100%
/*width:100%*/
.icon-desc
position: absolute
right: 0
left: 0
bottom: 0
height .44rem
line-height: .44rem
color:$darkTextColor
text-align :center
</style>00
相似问题