[vue]提供一种网站底部备案号样式代码

演示

在这里插入图片描述

vue组件型(可直接用)

组件代码:copyright-icp.vue

<template>
    <div class="icp">{{`© ${year} ${author} ` }}<a href="http://beian.miit.gov.cn/" target="_blank">{{ record }}</a></div>
</template>

<script setup>
let year = new Date().getFullYear();        // 一般都是最新的一年
let author = 'alsoeasy';					// 作者名
let record = '湘ICP备2023xxxxxx号';			// 备案号
</script>

<style>
.icp {
	position: absolute;
	bottom: 0;
	right: 0;
	margin: 10px 0;
	width: 100%;
	height: 36px;
	white-space: pre;
	text-align: center;
	color: gray;
	z-index: 1000;
}
.icp > a {
    color: gray;
    text-decoration: none;
}
.icp > a:hover {
    color: aqua;
    text-decoration: none;
}
</style>

直接在页面中调用(注意这里是setup写法)

<script setup>
import CopyrightIcp from '@/components/copyright-icp.vue';
</script>

<template>
    <router-view />
    <!-- 配置备案号 -->
    <CopyrightIcp></CopyrightIcp>
</template>

html代码型

注意如果要设置为绝对定位,记得设为bfc或者添加占位块,防止阻挡问题

<html>
	<style>
		.icp {
            /*position: absolute;
            bottom: 0;
            right: 0;*/
            margin: 10px 0;
            width: 100%;
            height: 36px;
            white-space: pre;
            text-align: center;
            color: gray;
            z-index: 1000;
        }
        .icp > a {
            color: gray;
            text-decoration: none;
        }
        .icp > a:hover {
            color: aqua;
            text-decoration: none;
        }
	</style>
	<body>
		<div>这里是内容部分</div>
		<div class="icp">© 2023 alsoeasy  <a href="http://beian.miit.gov.cn/" target="_blank"> 湘ICP备2023xxxxxx号</a></div>
    </body>
</html>
  • 7
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值