码迷,mamicode.com
首页 > 其他好文 > 详细

文本缩进

时间:2018-06-10 23:09:08      阅读:279      评论:0      收藏:0      [点我收藏+]

标签:oct   charset   mos   示例   head   http   ber   body   bec   

使用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>

 

文本缩进

标签:oct   charset   mos   示例   head   http   ber   body   bec   

原文地址:https://www.cnblogs.com/qq3069418554/p/9164718.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!