头闻号

邢军学

清洁用具|室内涂料|防水涂料|室外涂料|木器涂料|防水、防潮材料

首页 > 新闻中心 > 科技常识:用CSS实现文本左右对齐且首行缩进的代码
科技常识:用CSS实现文本左右对齐且首行缩进的代码
发布时间:2023-02-01 10:11:50        浏览次数:4        返回列表

今天小编跟大家讲解下有关用CSS实现文本左右对齐且首行缩进的代码 ,相信小伙伴们对这个话题应该有所关注吧,小编也收集到了有关用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样式就实现了文本的左右对齐,并且段落的首行是缩进的.

来源:爱蒂网