前端css效果复习

  1. 页面毛玻璃

在这里插入图片描述

<style>
    .bg {
        width: 400px;
        height: 200px;
        background-image: url('http://api.wx0725.top/sjbz?type=image&image=small');
        background-size: 100% 100%;
    }

    .mao {
        width: 300px;
        height: 150px;
        backdrop-filter: blur(5px);
    }
</style>
<div class="bg">
    <div class="mao">
        
    </div>
</div>
  1. 字母大小写

在这里插入图片描述

<style>
   .lower {
       text-transform: lowercase;
   }

   .upper {
       text-transform: uppercase;
   }

   .upperBegin{
       text-transform: capitalize;
   }
</style>
<div class="lower">ionwkefONBJ</div>
<div class="upper">ienenipeOINOINO</div>
<div class="upperBegin">anfoenwinonINONndinowni</div>
  1. 自定义首字母的样式

在这里插入图片描述

<style>
  .beginFont::first-letter{
        font-size: 30px;
        color: blueviolet;
    }
</style>
<div class="beginFont">
    我试试送你点
</div>
  1. 绘制正方形

在这里插入图片描述

<style>
    .zheng {
        height: 50px;
        background: rgb(212, 0, 0);
        aspect-ratio: 5/2;
    }

    .fang {
        height: 50px;
        background: black;
        aspect-ratio: 1/1;

    }
</style>
<div class="zheng">
</div>
<div class="fang">
</div>
  1. 指定元素样式:元素div.title 和 span 有active的样式变红,其他的active不管

在这里插入图片描述

 <style>
    .ul {
        background: blueviolet;
    }

    .ul li {
        color: rgb(9, 239, 166);
    }

    .ul li :where(div.title.active, span.active, ) {
        color: brown;
        font-weight: bold;
        font-size: 20px;
    }
</style>
<ul class="ul">
    <li>
        <div class="title">
            123
            <div><span class="active">456</span></div>
        </div>
    </li>
    <li class="active">
        <div class="title">123</div>
    </li>
    <li>
        <div class="title active">123</div>
    </li>
</ul>
  1. 图片背景和颜色背景混合显示

在这里插入图片描述
在这里插入图片描述

<style>
    .bgAndColor{
        width: 500px;
        height: 300px;
        background-image: url('http://api.wx0725.top/sjbz?type=image&image=small');
        background-color: rgba(191, 16, 16, 0.4);
        background-blend-mode: overlay;
    }
</style>
<div class="bgAndColor"></div>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

跨端蝴蝶

篮球弹弹弹

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值