【HTML+CSS】锚点链接、透明度、滤镜

锚点链接

同一个页面不同位置的跳转

<style>
        div{
            width: 80%;
            height: 1990px;
            background-color: pink;
            margin: auto;
        }
</style>
<div id="return">这里是顶部</div>
<p><a href="#return">返回顶部</a></p>

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

不同页面某一个位置的跳转
直接在超链接后面加#锚点名字

<p><a href="./001-task10.html#new">跳转</a></p>
<p id="new">跳转到这里</p>

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

透明度

opcity 0-1

  • 0 透明
  • 1 不透明

opcity: 0

  • 元素以及内容物全部消失不可见
  • 仍然占据空间
  • 结果不可逆(例如给子元素设置opcity: 1无效)

兼容ie低版本浏览器
filter: alpha(opacity=30) opacitiy取值0-100 0不透明 100透明

<style>
        .father{
            width: 300px;
            height: 300px;
            background-color: green;
            opacity: 0;
        }
        .son{
            width: 200px;
            height: 200px;
            background-color: blue;
            /* 无效 */
            opacity: 1;
        }
        .other{
            width: 200px;
            height: 200px;
            background-color: pink;
        }
</style>
<div class="father">
        <div class="son"></div>
</div>
<div class="other"></div>

滤镜-filter

  • 灰色滤镜
    • filter: grayscale(80%)
  • 高斯模糊
    • filter: blur(5px)
<style>
        html{
            filter: grayscale(80%);
        }
        body{
            filter: blur(2px);
        }
</style>
<div>123123</div>
<img src="./image/001.png" alt="">

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

芒果Cake

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值