
选中样式

<template>
<div class="wrapper">
<div>
<p>默认高亮</p>
<p class="custom-highlighting">自定义高亮</p>
</div>
</div>
</template>
<script>
export default {
name: "Table",
components: {},
data() {
return {};
},
methods: {
jsFun() {
console.log(1);
},
},
mounted() {
this.jsFun();
},
};
</script>
<style lang="scss" scoped>
.wrapper {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
p {
font-size: 2rem;
font-family: sans-serif;
}
.custom-highlighting::selection {
background-color: #8e44ad;
color: #fff;
}
</style>
最后
以上就是活泼小土豆最近收集整理的关于CSS 自定义选中样式: 伪元素::selection,可以用来自定义用户选中文档的高亮样式的全部内容,更多相关CSS内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复