网页制作 
首页 > 网页制作 > 浏览文章

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

(编辑:jimmy 日期: 2024/9/29 浏览:3 次 )

先看效果图吧:
用CSS实现文本左右对齐且首行缩进的代码

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

复制代码代码如下:
<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样式就实现了文本的左右对齐,并且段落的首行是缩进的.

上一篇:HTML meta content 提供页面信息代码
下一篇:针对chrome的css hack 使用方法
一句话新闻
Windows上运行安卓你用过了吗
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。