建站软件 优化软件 编程软件 网页辅助 站群程序 网站程序 图像处理 资源教程 字体下载 推荐软件


您的位置:首页 > div+css > css怎么让文本对齐

css怎么让文本对齐

时间:2015-06-05 16:10:06  来源:免费模板网 作者:风雪 阅读次数 tags对齐

一个div标签里面有一段文字,怎么让文字居中对齐呢
这个时候我们可以用 style="text-aligh"center"


<html>
 2 <head>
 3     <style type="text/css">
 4         h1 {text-align: center}
 5         h2 {text-align: left}
 6         h3 {text-align: right}
 7     </style>
 8 </head>
 9 
10 <body>
11     <h1>这是标题 1</h1>
12     <h2>这是标题 2</h2>
13     <h3>这是标题 3</h3>
14 </body>
15 </html>
修饰文本
<html>  2 <head>  3  <style type="text/css">  4  h1 {text-decoration: overline}  5  h2 {text-decoration: line-through}  6  h3 {text-decoration: underline}  7  h4 {text-decoration: blink}  8  a {text-decoration: none}  9  </style> 10 </head> 11 12 <body> 13  <h1>这是标题 1</h1> 14  <h2>这是标题 2</h2> 15  <h3>这是标题 3</h3> 16  <h4>这是标题 4</h4> 17  <p><a href="http://www.w3school.com.cn/index.html">这是一个链接</a></p> 18 </body> 19 </html>

本文地址:https://www.freemoban.com/bjrm/2015/0605/2119.html

猜你喜欢
栏目推荐
模板推荐

Copyright:www.freemoban.com 免费模板网 All Rights Reserved 网站备案:辽ICP备19014872号-2   辽公网安备 21010602000376号  辽公网安备:42900402000182号

免责声明:本站部分资源来自互联网收集,版权归原创者所有,如果侵犯了你的权益,我们会及时删除侵权内容,联系QQ:1615187561 谢谢合作!