gpt4 book ai didi

html - 宽度不起作用

转载 作者:行者123 更新时间:2023-11-28 01:24:27 25 4
gpt4 key购买 nike

抱歉这个愚蠢的问题,但我坚持因为这个问题, anchor 标签的宽度不起作用,基本上我想增加 anchor 标签的高度所以写在里面的文本不会换行

.filteredRestBody {
background: none repeat scroll 0 0 white;
border: 1px dotted #5bc0de;
border-top-left-radius: 23px;
box-shadow: 0 0 0 grey;
height: auto;
margin-left: -14%;
padding: 0 0 47px 8px;
position: relative;
top: 30px;
width: 115%;
}

.filterThumbnails {
background-position: 2px -19px;
background-repeat: repeat;
border-top-left-radius: 10%;
border-top-right-radius: 10%;
height: 300px;
margin-left: 4.3%;
margin-top: 50px;
width: 234px;
}

.restaurantThumbnailsTitle {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.6);
color: white;
font-size: 1.6em;
height: 95px;
margin-left: -14px;
position: relative;
top: 44.7%;
width: 114%;
}


.restaurantThumbnailsTitle > a {
color: white;
font-weight: bold;
}

.restaurantThumbnailsTitleText {
font-size: 1em;
font-weight: unset;
left: 0;
text-shadow: 1px 1px 0 red;
top: 0;
width: auto;
}
<div id="filteredRestBody" class="row filteredRestBody">
<div id="row1" class="row">
<div id="indianchilly" class="col-sm-4 filterThumbnails" style="background:url('images/yochinathumbbck.jpg')">
<img src="images/bestoffers.png">
<div id="discountNum">Discount 15%</div>
<div class="ratingsContainer">
<div id="restaurantThumbnailsTitle" class="restaurantThumbnailsTitle">
<a href="viewRestaurant.php?rest=yochina">Indian Chilly</a>
<p class="restaurantThumbnailsTitleText">chilled out chinese</p>
</div>
</div>
</div>
</div>
</div>

我已经尝试了很多东西,但唯一的解决方案是通过增加我不想增加的 filterThumbnails 的宽度,请任何人帮助我

提前致谢

最佳答案

参见 spec :

'width'

  • Value: <length> | <percentage> | auto | inherit
  • Initial: auto
  • Applies to: all elements but non-replaced inline elements, table rows, and row groups
  • Inherited: no
  • Percentages: refer to width of containing block
  • Media: visual
  • Computed value: the percentage or 'auto' as specified or the absolute length

a 元素默认是不可替换的内联元素。所以 width 属性不适用。

关于html - 宽度不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51325281/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com