如何在这两个图像下放置文本

时间:2013-08-04 16:07:05

标签: css image

这是我正在处理的部分我想在记录封面的图像下面添加标题/文字。

CSS样式

img
{
  float: right; 
  padding: 10px; 
  float: right; 
  text-align: bottom; 
}       

#box1
{
  height:220px; 
  width: auto;
  padding-left:20px; 
  border: none; 
}
#box2
{
  height:230px; 
  width: auto;
  padding-left:20px; 
  border: none;
}

我的HTML代码

<a href ="http://nervoustwitch.bandcamp.com/album/this-modern-world-ep"><img    src="modworldsmall.jpg"></a>
<a href="http://nervoustwitch.bandcamp.com/album/bad-reputation-ep"><img src="badrepep.jpg"></a>

<H1> Releases</H1>

<p>Nervous Twitch released <B>Bad Reputation</B> their 1st EP at the beginning of 2013.            Made up of tracks recorded the previous year, featuring previous band members and Erin on drums, the 'Bad Reputation' Ep used lo-fi production to good effect and featured 5 catchy, garage punk numbers most of which remain in the live set today</p>
<p>In June 2013 the band released <B>This Modern World</B>, with a  fuller sound the band continued to experiment with their songwriting style whilst maintaining their pop sensibilities.</p>

</div>

如果您需要查看更多样式表以回答我的问题,请告诉我。谢谢

1 个答案:

答案 0 :(得分:0)

取消图像上的float并将其放在#box1 div上。添加了text-align:center;,以便下方的文字居中。

Here's and example。我在图像周围放了一个边框,所以你可以看到它们,因为没有来源。