如何让我的文字位于图像下方,而不是与其相邻?
问题描述:
在下面的HTML标记中,我需要做些什么才能获得文本这是什么?定位在图像之下?最初,我将文本放置在< p>
标签中,但是,尽管文本被定位为correclty,我却失去了我想要的超链接行为。
In the HTML markup below, what do I need to do in order to get the text, "What is this?" to be positioned BELOW the image? Initially, I placed the text in <p>
tags but, although the text was positioned correclty, I lost my desired hyperlink behavior.
谢谢!
Thanks!
<div class="HorizontallyCentered">
<a href="qr.aspx">
<img alt="Image of JA10" src="files/ja10.png" height="150" width="150" />
What is this?
</a>
</div>
答
试试这个css
.HorizontallyCentered
{
text-align: center
}
.HorizontallyCentered img
{
display: block
}
这会强制文本在下面的行。
that should force the text on to the line below.