记录:border-radius 多个值,带/的值

记录:border-radius 多个值,带/的值

1.单一值

border-radius最常用的方式就是 圆形

border-radius:50%

其次就是0~100%、px、em…各种圆

2.两个值

border-radius: 80px 180px;

在这里插入图片描述
两个值:

第一个值代表左上角 右下角

第二个值代表右上角 左下角

记忆:左上角起,对角,顺时针

3.带/的两个值

border-radius: 80px/180px;

在这里插入图片描述

/之前的值是水平半径,/之后 的值是垂直半径,如果没有/,就会默认两个值相等。

4.3个值

border-radius: 80px 180px 120px;

在这里插入图片描述

记忆:左上角起,对角,顺时针

5.4个值

除了设置单一值,我们还可以设置4个值

border-radius: 10% 20% 30% 40%;

在这里插入图片描述

四个值分别是 左上角 右上角 右下角 左下角

记忆:左上角起,顺时针

6.带/的4个值 6个值 8个值…

此处不举例子了

有一个可以自己在线调试的网站: https://9elements.github.io/fancy-border-radius/

可以调整出来花瓣形、叶子形、盾牌形、水滴型…

在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<script setup> import useGetUrl from "@/hooks/useGetUrl"; import { reactive ,onMounted} from "vue"; const state = reactive({ inputText: "", isKeyboardVisible: false, messages: [ { content: "施主你好,很高兴为您服务!", msg: { time:"" } }, ], sendMessage: () => { const content = state.inputText.trim(); if (content) { const time = new Date(); const message = { id: state.messages.length + 1, content, time, isUser: true, }; state.messages.push(message); state.inputText = ""; state.replyMessage(); } }, replyMessage: () => { const content = "尊敬的施主,您好。我们已收到您的咨询,请稍后。"; const time = new Date(); const message = { id: state.messages.length + 1, content, time, isUser: false, }; setTimeout(() => { state.messages.push(message); }, 1000); }, formatDate: (time) => { const date = time?new Date(time):new Date(); const hours = date.getHours().toString().padStart(2, "0"); const minutes = date.getMinutes().toString().padStart(2, "0"); return ${hours}:${minutes}; }, showKeyboard() { state.isKeyboardVisible = true; document.querySelector("input").focus(); }, hideKeyboard() { state.isKeyboardVisible = false; document.activeElement.focus(); }, // handleScroll() { // const chatList = this.$refs.chatList; // const scrollTop = chatList.scrollTop; // const scrollHeight = chatList.scrollHeight; // const clientHeight = chatList.clientHeight; // if (scrollTop === 0) { // // 聊天列表滚动到了顶部,需要加载更多聊天记录 // // TODO: 加载更多聊天记录 // // 滚动到之前的位置,避免列表跳动 // chatList.scrollTop = chatList.scrollHeight - scrollHeight; // } else if (scrollTop + clientHeight >= scrollHeight) { // // 聊天列表滚动到了底部,需要将列表自动上滑 // chatList.scrollTop = chatList.scrollHeight - clientHeight; // } // }, }); onMounted(() => { state.messages[0].msg.time = state.formatDate() }) </script>在该段代码中增加列表置底后上滑
06-12

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值