如何让我的文字位于图像下方,而不是与其相邻? [英] How do I get my text centered below the image, not adjacent to it?
本文介绍了如何让我的文字位于图像下方,而不是与其相邻?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在下面的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.
这篇关于如何让我的文字位于图像下方,而不是与其相邻?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文