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

网站建设 2023-01-28 20:49www.1681989.com免费网站

先看效果图吧:

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

复制代码
代码如下:

<p class="elegant">Our onle order form allows you to order directly the ter, savg your time and offerg you convenience. Here’s how you do it.</p>
<p class="elegant">When you want to buy our modities, please register first. After you create your aount suessfully, you can directly order our products and pay for them. Next time you just click “log ”, you can enter your aount, then shoppg simply and conveniently.</p>

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

复制代码
代码如下:

<style type="text/css">
.elegant
{
marg-left: 40px;
marg-right: 80px;
letter-spacg: 1px;
word-spacg: 2px;
le-height: 1.7em;
text-dent: 40px;
text-align: justify;
}
</style>

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

Copyright © 2016-2025 www.1681989.com 推火网 版权所有 Power by