如何设置⽂字上下移动html,HTMLCSS在换⾏时向上移动⽂本使⽤内联块
你可以试试这个:
.produto-ind {
xxposition: relative;
手机上可以打html与css的app
width:300px;
height:400px;
xxfloat: left;
margin:50px 30px 0px 0px;
border: 1px dotted blue;
display: inline-block;
}
⽽不是使⽤浮点数,使⽤display:inline-block.⽂本块将与其底部基线对齐.
还有其他与div的⾼度有关的⼩问题,但这些可以修复,特别是如果你知道.fk-img的⾼度.
使⽤花车
如果您知道图像容器的⾼度,也可以使⽤浮点数:
.produto-ind .img-produto-ind {
height:290px;
width:100%;
position: absolute;
left: 0;
bottom: 0;
}
.
produto-ind h2 {
background-color: yellow;
position: absolute;
bottom: 290px;
}
.produto-ind .fk-img {
height:100%;
width:auto;
background-color:gray;
}
在这种情况下,如果你知道.fk-img将是290px⾼度,你可以使⽤绝对定位将图像容器放在⽗.produto-img块的底部
然后将h2元素290px从底部定位.
内联块和浮动之间的选择很⼤程度上取决于你希望li块如何排列,顶部的参差不齐的空间或底部的参差不齐的空间,这是你的⼀个设计决定.
如果您将内容包装在块级元素宽度显⽰周围,则可以使⽤display:table-cell的解决⽅案:table-cell; vertical-align:bottom;但这也将假设所有图像块具有相同的⾼度.