文本样式

1、颜色 color rgb  rgba

2、文本对齐的方式   text-align = center

3、首行缩进  text-indent:2em

4、行高 line-height:当行文字上下居中,行高line-height等于height

5、装饰  text-decoration 

6、文本图片水平对齐: vertical-align:middle

 

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Title</title>
 6 
 7 <!--    颜色:
 8             RGB  0-F
 9             RGBA 透明度 A:0~1
10         text-align: 排版居中
11         text-indent: 2em 首行缩进
12 
13         行高,和块的高度一致,就可以上下居中
14         height: 300px;
15         line-height: 300px;
16 
17         text-decoration:underline 上划线
18         text-decoration:line-through 中划线
19         text-decoration:overline 下划线
20 
21    -->
22     <style>
23         h1{
24             color: rgba(0,255,255,0.4);
25             text-align: center;
26 
27 
28         }
29         .p1{
30             text-indent: 2em;
31         }
32 
33         .p3{
34             background: #3cbda6;
35             height: 300px;
36             line-height: 300px;
37         }
38 
39     </style>
40 </head>
41 <body>
42 
43 <h1>
44     介绍
45 </h1>
46 <p class="p1">Java是一门面向对象的编程语言,不仅吸收了C++语言的各种优点,还摒弃了C++里难以理解的多继承、指针等概念,
47     因此Java语言具有功能强大和简单易用两个特征。</p>
48 
49 <p class="p3">Java语言作为静态面向对象编程语言的代表,极好地实现了面向对象理论,允许程序员以优雅的思维方式进行复杂的编程。
50     Java具有简单性、面向对象、分布式、健壮性、安全性、平台独立与可移植性、多线程、动态性等特点。
51     Java可以编写桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等。</p>
52 </body>
53 </html>
文本样式
 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Title</title>
 6 <!--
 7 
 8     水平对齐~参照物  a,b
 9 -->
10     <style>
11         img,span{
12             vertical-align: middle;
13         }
14         /*a标签链接去除下划线*/
15         a{
16             text-decoration: none;
17         }
18     </style>
19 </head>
20 <body>
21 <p>
22     <img src="../static/imgs/1.jpg" alt="">
23     <span>asdasdassddasdasd</span>
24 
25 </p>
26 <a href="">123</a>
27 </body>
28 </html>
文本样式2

 

posted @ 2022-03-27 22:21  doremi429  阅读(48)  评论(0编辑  收藏  举报