在shopify网站上,我有一些标签代码,用于提取产品说明。大多数都被切断,因为容器有一定的宽度,但我不明白为什么它不会垂直运行并增加容器的高度?我试过overflow-x:hidden,overflow-y:可见但是没有做到。即使我将容器设置为具有固定高度,文本也不会垂直运行。我在这里缺少什么?
<li class="grid-item one-fifth product-excerpt">
{% assign featured = link.title | append: ' featured' | handleize %}
{% if linklists[featured].links %}
{% assign featured_object = linklists[featured].links.first %}
<a href="#">Featured</a>
<img src="{{ featured_object.object.featured_image | product_img_url: 'medium'}}" />
<a href="{{featured_object.url}}">{{featured_object.object.title}}</a>
//need this text to run vertically
<span>{{featured_object.object.description | strip_html | slice: 0, 100 | append: '...' }}</span>
{% endif %}
</li>
CSS
.site-nav--dropdown .product-excerpt span {
font-size: 14px;
font-family: 'Open Sans';
display: block;
width: 100%;
overflow: hidden;
padding: 0px 0px 13px 0px;
}
.site-header .grid>.grid-item, .site-header .grid--rev>.grid-item, .site-header .grid--full>.grid-item {
float: none;
display: table-cell;
vertical-align: middle;
}
答案 0 :(得分:3)
将此overflow: hidden;
更改为overflow: auto;