文本缩进

Posted qq3069418554

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了文本缩进相关的知识,希望对你有一定的参考价值。

使用text-align属性表示文本缩进,其中属性值为负值向左移动,正值表示向右移动

 

示例:

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>文本缩进</title>
 6     <style type="text/css">
 7         h1 {
 8             background-image: url("images/logo.gif");
 9             background-repeat: no-repeat;
10             text-indent: -9999px;
11             width: 165px;
12             height: 100px;
13         }
14 
15         .credits {
16             text-indent: 20px;
17         }
18     </style>
19 </head>
20 <body>
21 <h1>Briards</h1>
22 <p class="credits">by Ivy Duckett</p>
23 <p class="intro">The <a class="breed" href="http://en.wikipedia.org/wiki/Briard">briard</a>, or berger de brie, is a
24     large breed of dog traditionally used as a herder and guardian of sheep.</p>
25 <h2>Breed History</h2>
26 <p>The briard, which is believed to have originated in France, has been bred for centuries to herd and to protect sheep.
27     The breed was used by the French Army as sentries, messengers and to search for wounded soldiers because of its fine
28     sense of hearing. Briards were used in the First World War almost to the point of extinction. Currently the
29     population of briards is slowly recovering. Charlemagne, Napoleon, Thomas Jefferson and Lafayette all owned
30     briards.</p>
31 </body>
32 </html>

 

以上是关于文本缩进的主要内容,如果未能解决你的问题,请参考以下文章

markdown怎样让代码缩进

CSS CSS - 用徽标替换标题文本 - 文本缩进 - 文本缩进

CSSCSS 文本样式 ④ ( CSS 外观属性 | color 文本颜色 | text-align 文本对齐方式 | line-height 行间距设置 | 首行缩进设置 | 文本装饰设置 )

在 python 中使用 beautifullsoup4 抓取网页时出现奇怪的文本缩进

实现CSS文本缩进?

微信小程序rich-text 文本首行缩进和图片居中