图像将我的段落隐藏在 prestashop 中
An image is hidding my paragraph in prestashop
我坚持这个并尝试了很多东西,所以我不知道究竟尝试了什么,但我想我几乎尝试了 css 中的所有可能性,但我对其他想法持开放态度。
问题是类别图像隐藏了描述文本,正如您在此看到的
picture.
img 在与段落不同的 div 中具有绝对位置,因此如果我将其设为相对位置,则无法将一个放在另一个的一侧(或者可能不知道如何) .
我不会 post 代码,因为它是 prestashop,而且很长,但这是网站:
www.tienda.hostman.es
如果您进入类别 'cocinas',您就会明白我在说什么。
谢谢。
ps:无法编辑 html 文件,因为它是由 prestashop
自动生成的
我认为如果我在这里删除部分代码会更好:
这是 html:
<div class="block-category card card-block hidden-sm-down">
<h1 class="h1">Cocinas</h1>
<div id="category-description" class="text-muted"><p>En esta sección se encuentran todos nuestros productos para la limpieza y cuidado de cocinas</p></div>
<div class="category-cover">
<img src="http://tienda.hostman.es/img/c/14-category_default.jpg" alt="Productos cocinas">
</div>
</div>
这是 css
p{
display: block;
margin-block-start:
margin-block-end:
margin-inline-start:
margin-inline-end: 0px;
}
.block-category .category-cover {
position: absolute;
right: .75rem;
bottom: 0;
}
html:
<div class="block-category card card-block hidden-sm-down">
<h1 class="h1">Cocinas</h1>
<div id="category-description" class="text-muted"><p>En esta sección se encuentran todos nuestros productos para la limpieza y cuidado de cocinas</p></div>
<div class="category-cover">
<img src ="http://tienda.hostman.es/img/c/14-category_default.jpg" alt="Productos cocinas">
</div>
</div>
布局css改为使用:
.card {
display:flex;
flex-wrap:wrap;
justify-content:space-between;
}
.h1 {
flex:1 0 100%;
}
#category-description {
flex:1;
}
.block-category .category-cover {
/* delete this don't need it
position: absolute;
right: .75rem;
bottom: 0; */
margin-right: .75em;
}
您只需删除 "position: absolute;" 或通过添加新的 css 文件来覆盖它。
根据 Carol McKay 发布的解决方案,对我有用的 css 代码是:
.card{
-ms-box-orient: horizontal;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -moz-flex;
display: -webkit-flex;
display: flex;
-webkit-justify-content: space-around;
justify-content: space-around;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
-webkit-align-items: stretch;
align-items: stretch;
}
.h1{
flex: 1 100%;
}
.text-muted{
display:inline;
flex:1;
}
.block-category .category-cover{
display:inline;
position:relative;
float:right;
margin-top:-6%;
}
我坚持这个并尝试了很多东西,所以我不知道究竟尝试了什么,但我想我几乎尝试了 css 中的所有可能性,但我对其他想法持开放态度。 问题是类别图像隐藏了描述文本,正如您在此看到的 picture.
img 在与段落不同的 div 中具有绝对位置,因此如果我将其设为相对位置,则无法将一个放在另一个的一侧(或者可能不知道如何) .
我不会 post 代码,因为它是 prestashop,而且很长,但这是网站: www.tienda.hostman.es
如果您进入类别 'cocinas',您就会明白我在说什么。
谢谢。 ps:无法编辑 html 文件,因为它是由 prestashop
自动生成的我认为如果我在这里删除部分代码会更好: 这是 html:
<div class="block-category card card-block hidden-sm-down">
<h1 class="h1">Cocinas</h1>
<div id="category-description" class="text-muted"><p>En esta sección se encuentran todos nuestros productos para la limpieza y cuidado de cocinas</p></div>
<div class="category-cover">
<img src="http://tienda.hostman.es/img/c/14-category_default.jpg" alt="Productos cocinas">
</div>
</div>
这是 css
p{
display: block;
margin-block-start:
margin-block-end:
margin-inline-start:
margin-inline-end: 0px;
}
.block-category .category-cover {
position: absolute;
right: .75rem;
bottom: 0;
}
html:
<div class="block-category card card-block hidden-sm-down">
<h1 class="h1">Cocinas</h1>
<div id="category-description" class="text-muted"><p>En esta sección se encuentran todos nuestros productos para la limpieza y cuidado de cocinas</p></div>
<div class="category-cover">
<img src ="http://tienda.hostman.es/img/c/14-category_default.jpg" alt="Productos cocinas">
</div>
</div>
布局css改为使用:
.card {
display:flex;
flex-wrap:wrap;
justify-content:space-between;
}
.h1 {
flex:1 0 100%;
}
#category-description {
flex:1;
}
.block-category .category-cover {
/* delete this don't need it
position: absolute;
right: .75rem;
bottom: 0; */
margin-right: .75em;
}
您只需删除 "position: absolute;" 或通过添加新的 css 文件来覆盖它。
根据 Carol McKay 发布的解决方案,对我有用的 css 代码是:
.card{
-ms-box-orient: horizontal;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -moz-flex;
display: -webkit-flex;
display: flex;
-webkit-justify-content: space-around;
justify-content: space-around;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
-webkit-align-items: stretch;
align-items: stretch;
}
.h1{
flex: 1 100%;
}
.text-muted{
display:inline;
flex:1;
}
.block-category .category-cover{
display:inline;
position:relative;
float:right;
margin-top:-6%;
}