html - 框内段落旁边的图像

标签 html css position

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

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/

相关文章:

javascript - jQuery 在悬停时改变背景

javascript - 固定位置不适用于模态窗口

javascript - 自动将徽章定位在图像的 Angular 上

HTML/CSS : Common border around overlapping texts

javascript - 如果 child 悬停在 mouseover 事件上的 jQuery 再次触发

html - Safari 无法识别样式为按钮的链接的边框半径

css - 如何在 Flex Layout 中的单个元素上启用滚动?

html - 谷歌风格的 Bootstrap 主题会抛出大量 CSS 验证错误。使用样式表安全吗?

javascript - 文本框长整数值在 angularjs 中显示为指数类型

css - 停止文本围绕 css 生成的内容?