gpt4 book ai didi

html - 框内段落旁边的图像

转载 作者:行者123 更新时间:2023-11-28 13:38:35 25 4
gpt4 key购买 nike

我最近尝试编写一个框,在左侧包含一个图像,在它旁边是一个标题和右下方的段落,如下所示:

http://gyazo.com/c5165fa45c32f69499768ba95d815328

这是我所做的:

       <div class="span4">
<div class="box">
<img src="img/share.png" class="image_margin"/>
<span class="box_title">SHARE</span>
<span id="texting">Upload files straight from you hard disc. Up to 600MB per file upload! the more you earn the more file storage you get.</span>
</div>
</div>

CSS:

.box {
background-image: url("../img/box.png");
width: 305px;
height: 117px;
}
#texting {
font-size: 14px;
}

.image_margin{
margin-top: 25px;
margin-left: 25px;
}
.box_title{
font-size: 24px;
color: #8d8d8d;
margin-left: 15px;
margin-top: 20px;
position: absolute;
}

这是结果:

http://gyazo.com/f600c42f86b51e52de436631fc96656d

为什么文本超出盒子但它在盒子的类中?我做错了什么?如何在 CSS 中像第一张图片那样对齐标题 + 段落,使其适合所有屏幕?

非常感谢!

最佳答案

img 标签中使用 align="left"

<img src="img/share.png" class="image_margin" align="left"/>

希望对你有帮助

关于html - 框内段落旁边的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12683059/

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