美化网页元素

美化网页元素

1.span 标签

重点要突出的字,使用span套起来

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        #title1{
    
            font-size: 50px;
        }
    </style>

</head>
<body>

欢迎学习 <span id="title1">Java</span>

</body>
</html>

图1----------------------------------------------------------------------

2.字体样式

<!--
font-family: 字体
font-size:  字体大小
font-weight: 字体粗细
color : 字体颜色

-->
<style>
    body{
    
        font-family: "Arial Black", 楷体;
        color: #a13d30;
    }
    h1{
    
        font-size: 50px;
    }
    .p1{
    
        font-weight: bolder;
    }
</style>

图2-------------------------------------------------------------------------

3.文本样式

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>


<h1>故事介绍</h1>

<p class="p1">
    平静安详的元泱境界,每隔333年,总会有一个神秘而恐怖的异常生物重生,它就是魁拔!魁拔的每一次出现,都会给元泱境界带来巨大的灾难!即便是天界的神族,也在劫难逃。在天地两界各种力量的全力打击下,魁拔一次次被消灭,但又总是按333年的周期重新出现。魁拔纪元1664年,天神经过精确测算后,在魁拔苏醒前一刻对其进行毁灭性打击。但谁都没有想到,由于一个差错导致新一代魁拔成功地逃脱了致命一击。很快,天界魁拔司和地界神圣联盟均探测到了魁拔依然生还的迹象。因此,找到魁拔,彻底消灭魁拔,再一次成了各地热血勇士的终极目标。
</p>

<p>
    在偏远的兽国窝窝乡,蛮大人和蛮吉每天为取得象征成功和光荣的妖侠纹耀而刻苦修炼,却把他们生活的村庄搅得鸡犬不宁。村民们绞尽脑汁把他们赶走。一天,消灭魁拔的征兵令突然传到窝窝乡,村长趁机怂恿蛮大人和蛮吉从军参战。然而,在这个一切都凭纹耀说话的世界,仅凭蛮大人现有的一块冒牌纹耀,不要说参军,就连住店的资格都没有。受尽歧视的蛮吉和蛮大人决定,混上那艘即将启程去消灭魁拔的巨型战舰,直接挑战魁拔,用热血换取至高的荣誉。
</p>

<p class="p3">
    Since there’s no help, come let us kiss and part;Nay, I have done, you get no more of me,And I am glad, yea glad with all my heartThat thus so cleanly I myself can free;Shake hands forever, cancel all our vows,And when we meet at any time again,Be it not seen in either of our browsThat we one jot of former love retain.Now at the last gasp of Love’s latest breath,When, his pulse failing, Passion speechless lies,When Faith is kneeling by his bed of death,And Innocence is closing up his eyes,Now if thou wouldst, when all have given him over,From death to life thou mightst him yet recover.
</p>

</body>
</html>

图3--------------------------------------------------------------------

  • 颜色

  • 文本对齐的方式

    <style>
        /*颜色:
            RGB 0~F 十六进制
            RGBA A(透明度):0~1
        */
    
        /*text-align: 排版,居中*/
    
        h1{
         
            color:rgba(0,255,0,0.5);
            text-align: center;
        }
    
    </style>
    

    图4----------------------------------------------------------------------------

  • 首行缩进

    .p1{
         
        text-indent: 2em;
    }
    
    .p3{
         
        background: chartreuse;
        height:300px;/*背景(块)高度*/
        line-height: 300px;/*行高*/
        /*行高和块的高度一致就可以将单行文字上下居中*/
    }
    
  • 下划线

    text-decoration: underline;/*下划线*/
    text-decoration: line-through;/*中划线*/
    text-decoration: overline;/*上划线*/
     /*a标签(超链接)去下划线*/
            a{
         
                text-decoration: none;
            }
    
  • 文本图片水平对齐

    vertical-align: middle;
    
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    
        <style>
            img,span{
                vertical-align: middle;
            }
        </style>
    
    </head>
    <body>
    <p>
        <img src="images.PNG" alt=""><!--注意存放图片的路径-->
        <span>image</span>
    </p>
    </body>
    </html>
    

    图5-------------------------------------------------------------

  • 总代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <!--
    颜色:
        单词
        RGB 0~F
        RGBA  A:0~1

    text-align : 排版,居中,
    text-indent: 2em;  段落首行缩进
    height: 300px;
    line-height: 300px;
        行高,和 块的高度一致,就可以上下居中
    -->
    <style>
        h1{
    
            color: rgba(0,255,255,0.9);
            text-align: center;
        }
        .p1{
    
            text-indent: 2em;
        }
        .p3{
    
            background: #2700ff;
            height: 300px;
            line-height: 300px;
        }
        /*下划线*/
        
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值