首页 > Web开发 > 详细

用CSS实现文本左右对齐且首行缩进的代码

时间:2015-12-31 07:01:28      阅读:239      评论:0      收藏:0      [点我收藏+]

先看效果图吧:
技术分享

其源代码就比较干净了,源码如下:

复制代码
代码如下:

<p class="elegant">Our online order form allows you to order directly in the internet, saving your time and offering you convenience. Here’s how you do it.</p>
<p class="elegant">When you want to buy our commodities, please register first. After you create your account successfully, you can directly order our products and pay for them. Next time you just click “log in”, you can enter your account, then shopping simply and conveniently.</p>

最重要的就是CSS了,代码如下:

复制代码
代码如下:

<style type="text/css">
*.elegant
{
margin-left: 40px;
margin-right: 80px;
letter-spacing: 1px;
word-spacing: 2px;
line-height: 1.7em;
text-indent: 40px;
text-align: justify;
}
</style>

上面简单的CSS样式就实现了文本的左右对齐,并且段落的首行是缩进的.

用CSS实现文本左右对齐且首行缩进的代码

原文:http://www.jb51.net/css/25624.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!