html - 怎么把文字放在图片下面

标签 html css text alignment

我想知道如何让文字像图片一样居中。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Title</title>
</head>

<body>
  <center>
    <img src="http://www.wikima4.com/assets/templates/wikima4/css/images/red.jpg" width=
    "1200" height="150" />
  </center>

  <div align="justified">
    <font size="3" face="calibri">text text text text The quick brown fox jumps over the
    lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over
    the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps
    over the lazy dog The quick brown fox jumps over the lazy dog<br />
    <br />
    You can download the documentation from this link: Download</font>
  </div>
</body>
</html>

最佳答案

text-align:center;<center>margin:0 auto

看看这个。 http://jsfiddle.net/VnRRA/这是你想要的吗?

更新:http://jsfiddle.net/VnRRA/1/

基本上我所做的是,给父 div 一个 id centerize并告诉它 text-align:center;

关于html - 怎么把文字放在图片下面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8755688/

相关文章:

jquery - 隐藏输入值更改时未调用的函数 Jquery

Python 或 R 的可读性

qt - 如何在获得的框架上添加文本?

javascript - id下自定义selectmenu jquery

javascript - Material CSS : FABs button trigger nothing happens

javascript - 使用 javascript(jquery) 从外部 SVG 文件获取或设置 css 类值

javascript - 带有图像的 JQM 可折叠标题

python - 如何检查 txt 文件中的每一行是否有正确的用户名和密码

php - Opencart 3.x 为 'Search on homepage' 和 'admin page' 生成 SEO 友好链接

css - 我如何找到文本消息的 css 选择器