css(层叠样式表)

<p style="font-size: unset;color: chartreuse">python</p><!--元素内嵌样式表-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>css创建</title>
    <style type="text/css"> /*文档内嵌样式表*/
        p{
            font-size: revert;
            color: #ff4400;
        }
    </style>
</head>
<body>

<p>python</p>
</body>
</html>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>css创建</title>
    <link rel="stylesheet" type="text/css" href="外部样式表.css"><!--引入外部样式表-->
</head>
<body>

<p>python</p>
</body>
</html>

css选择器:

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

    <style type="text/css">
        .class1{
            border-width: 10px;
            border-color: chartreuse;
            border-style: solid;/*solid实线*//*dashed破折线*//*dotted小圆点*/
            padding: 20px;
            margin: 40px;
        }
    </style>
</head>
<body>

<p class="class1">python</p>
<br>
<br>
<a href="http://www.baidu.com">百度</a>
</body>
</html>

<style type="text/css">
        .class1{
            padding: 20px;
            border-width: 10px;
            margin: 40px;
            
            border-top-color: chartreuse;/*上边框颜色*/
            border-left-color: #ff4400;/*左边框颜色*/
            border-right-color: #ff4400;/*右边框颜色*/
            border-bottom-color: #ff4400;/*下边框颜色*/
            
            border-style: solid;/*solid实线*//*dashed破折线*//*dotted小圆点*/
            border-top-style: dotted;/*上边框样式*/
            border-bottom-style: dashed;/*下边框样式*/
            border-left-style: dashed;/*上边框样式*/
            border-right-style: revert;/*右边框样式*/
            
        }
    </style>

<style type="text/css">
        .class1{
            color: #ff4400;
            width: 1024px;
            height: 723px;
            background-color: blue;/*背景颜色*/
            background-image: url("timg.jpg");/*背景图片*/
            background-repeat: no-repeat;/*背景图片只出现一次*/
            background-size:cover;/*背景覆盖整个页面,自适应缩放*/
            background-attachment: fixed;/*背景固定,滚动混轮,图片不动*/
            background-attachment: local;/*滚动混轮,图片也动*/
        }
    </style>

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值