gpt4 book ai didi

html - 使用 Rails 进行敏捷 Web 开发示例在文本上显示图像

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

我正在阅读一本书(使用 Rails 进行敏捷 Web 开发),但我在第 96 页遇到了一个问题。

我完全遵守书中的代码,但我明白了。

Rendered Output

我知道另一种方法是使用表格,但我想先知道是否有其他解决方案。

最佳答案

我会使用 div 组织这些评论。第一个存放图片和评论的 div。用于存放图像的第二个 div。第三个用于放置评论。

html:

<div class="comment-container">

<div class="comment-img">
<!whatever code you use to pull images from the database>
</div><!ENDcomment-img>

<div class="comment-field">
<!whatever code you use to pull comment content from the database>
</div><!ENDcomment-field>

</div><!ENDcomment-container>

CSS:

 .comment-container{
padding: 5px;
border-bottom: 1px dashed #009fe4;
margin: 2px 0 5px 0;
}

.comment-img{
float: left;
width: 80px;
height: auto;
}

.comment-field{
width: 700px;
height: auto;
padding: 0 0 0 10px;
}

希望对您有所帮助。

@subm0ral

关于html - 使用 Rails 进行敏捷 Web 开发示例在文本上显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10853933/

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