<html>
<head>
<meta charset="utf-8">
<title>table</title>
<style>
table td{ width:100px height:30px line-height:30px border:1px solid #063 text-align:left}
</style>
<!--直接设置td text-align:left就可以了,默认情况下text-align:left,如果其它没有设置可以不用设置这个属性(深圳网站建设:www.sz886.com)-->
</head>
<body>
<table>
<tr>
<td align="center">1</td>
<td>2</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.d1{
width: 400px
height: 250px
background-color: red
text-align: center
}
</style>
</head>
<body>
<div>
<img width="200px" height="150px" src="dddd.png" />
<br/>
你啥时候嫁给我,hahahahaahahahahahaah
</div>
</body>
</html>
————————————————
这样就会能够将文字放在图片的正下方,得到以下图片:
文字位于正右边的方法:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.d1{
width: 400px
height: 250px
background-color: red
}
.d2{
vertical-align: middle
}
</style>
</head>
<body>
<div>
<img width="200px" height="150px" src="dddd.png" />
你啥时候嫁给我
</div>
</body>
</html>