【发布时间】:2016-02-08 20:17:27
【问题描述】:
我有两张图片被放置在页面上距顶部 37% 和距左侧 25% 的位置。所以css代码是这样的:
.christmas-circle{ //image 1 class
border-radius: 50%; //makes the image a circle
position:absolute;
top:37%;
left:25%;
}
.shipment-circle{ //image 2 class
border-radius: 50%;
position:absolute;
top:37%;
}
这是html代码
<div class = "christmas-inst">
<img src="christmas-circle.jpg" class="christmas-circle" style="width:256px;height:256px;">
<p> First, build your desired tree</p>
</div>
<div class = "shipment-inst">
<img src="shipment-circle.png" class="shipment-circle" style="width:256px;height:256px;">
<p> Then, we'll deliver all materials</p>
</div>
我将图像放置在正确的空间中,但现在我想在每个图像下添加文本。我希望第一张图片下面有文字,例如“下订单”,我希望第二张图片下面有文字,上面写着“我们会发货”。我不完全确定如何创建它,以便文本位于图像下方,同时还将图像放置在我想要的位置。
【问题讨论】:
-
用 html 代码编辑了我的帖子
-
这不是 CSS cmets 的正确语法。试试 /* */
标签: html css image text alignment