正则+点css圆角

匹配分组

字符功能
|匹配左右任意一个表达式
(ab)将括号中字符作为一个分组
\num引用分组num匹配到的字符串
(?P<name>)分组起别名
(?P=name)引用别名为name分组匹配到的字符串

示例1: |

匹配左右任意一个表达式

ret = re.match("[1-9]?\d$|100","8")
print(ret.group())  # 8

答案:
8;
78;

示例2()

将括号中字符作为一个分组
/w:匹配单词字符,即a-z、A-Z、0-9、_

import re

ret = re.match("\w{4,20}@163\.com", "test@163.com")
print(ret.group())  # test@163.com

ret = re.match("\w{4,20}@(163|126|qq)\.com", "test@126.com")
print(ret.group())  # test@126.com

示例3:\

:引用分组num匹配到的字符串
*无限或0次

ret = re.match("<[a-zA-Z]*>\w*</[a-zA-Z]*>", "<html>hh</html>")
print(ret.group())

示例4 (?P)

(?P=name)

分组起别名
引用别名为name分组匹配到的字符串

import re

ret = re.match(r"<(?P<name1>\w*)><(?P<name2>\w*)>.*</(?P=name2)></(?P=name1)>", "<html><h1>www.hpedu.cn</h1></html>")
print(ret.group())

search方法

import re

ret = re.search("\d+", "阅读次数为 9999")
ret.group()

findall方法

import re

ret = re.findall(r"\d+", "python = 9999, c = 7890, c++ = 12345")
print(ret)

sub 将匹配到的数据进行替换

import re

ret = re.sub(r"\d+", '998', "python = 997")
print(ret)

split 根据匹配进行切割字符串,并返回一个列表

import re

ret = re.split(r":| ","info:xiaoZhang 33 shandong")
print(ret)

css 圆角

设置四个角为圆角
border-radius:半径

分别设置四个角的弧度,写出格式
border-radius:30px 40px 50px 60px;

设置右下角的弧度为30px
border-bottom-right-radius: 30px;
border-Y轴位置单词-X轴位置单词-radius:半径

设置一个红色背景颜色,透明度为六成透明
background-color: rgba(255,0,0,0.6)

语法

设置四个角的
border-radius: 半径

<style>
    
    div{
        width: 300px;
        height: 300px;
        background-color: red;
        border-radius:150px;
    }
    
        div{
    width: 300px;
    height: 300px;
    background-color: red;
    border-radius:20px 30px 50px 90px;
}

</style>

单独的设置每一个角的弧度
border-Y轴位置英文-X轴位置英文-radius:半径

<style>
    
    div{
        width: 300px;
        height: 300px;
        background-color: red;
        border-bottom-right-radius:150px;
    }
</style>


<div></div>

css的权重,请列出一万分,一千分,一百分,十分,一分这些权重分值所以应的样式
10000,!important
1000,内联样式
100,ID选择器
10,类与伪类选择器
1,标签选择器
0,其它选择器

<style>

    .box{
        background-color: blue;
    }

    div{
        width: 300px;
        height: 300px;
        background-color: red !important;;
    }

    #outter{
        background-color: yellow !important;
    }
</style>

<div class="wrapper">
    <div class="box" id="outter" style="background-color: green"></div>
</div>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值