linecap方法html,CSS stroke-linecap用法及代码示例

butt:它用于指示笔划不会超出笔划的端点。它使笔划看起来以锐利的直角结束。

例:

CSS | stroke-linecap

/* Assume the round

value for

demonstration */

.stroke-round {

stroke-linecap:round;

stroke-width:20px;

stroke:green;

}

.stroke-butt {

stroke-linecap:butt;

stroke-width:20px;

stroke:red;

}

GeeksforGeeks

CSS | stroke-linecap

xmlns="http://www.w3.org/2000/svg"

version="1.1">

x2="350" y1="30" y2="30" />

x2="350" y1="60" y2="60" />

输出:将舍入值与对接值进行比较

6e6c9c31f3cc11c99fba88598a36f42d.png

round:它用于指示笔划的末端以直径等于笔划宽度的半圆延伸。长度为零的子路径将具有一个以子路径的点为中心的完整圆。

例:

CSS | stroke-linecap

/* This is the

default value */

.stroke-butt {

stroke-linecap:butt;

stroke-width:20px;

stroke:green;

}

.stroke-round {

stroke-linecap:round;

stroke-width:20px;

stroke:red;

}

GeeksforGeeks

CSS | stroke-linecap

xmlns="http://www.w3.org/2000/svg"

version="1.1">

x2="350" y1="30" y2="30" />

x2="350" y1="60" y2="60" />

输出:将对接值与舍入值进行比较

183c5a0bae943037225bbe35b01a5fe8.png

square:它用于指示笔划的末端延伸有一个矩形,该矩形的高度等于笔划的宽度,而宽度等于笔划的宽度的一半。长度为零的子路径将具有一个以子路径的点为中心的正方形。

例:

CSS | stroke-linecap

/* This is the default

value */

.stroke-butt {

stroke-linecap:butt;

stroke-width:20px;

stroke:green;

}

.stroke-square {

stroke-linecap:square;

stroke-width:20px;

stroke:red;

}

GeeksforGeeks

CSS | stroke-linecap

xmlns="http://www.w3.org/2000/svg"

version="1.1">

x2="350" y1="30" y2="30" />

x2="350" y1="60" y2="60" />

输出:比较对接值和平方值

cbfc9eda092ae7892704fd5505193254.png

initial:用于将属性设置为其默认值。

例:

CSS | stroke-linecap

/* Assume the round

value for

demonstration */

.stroke-round {

stroke-linecap:round;

stroke-width:20px;

stroke:green;

}

.stroke-butt {

stroke-linecap:butt;

stroke-width:20px;

stroke:red;

}

GeeksforGeeks

CSS | stroke-linecap

xmlns="http://www.w3.org/2000/svg"

version="1.1">

x2="350" y1="30" y2="30" />

x2="350" y1="60" y2="60" />

输出:将舍入值与初始值进行比较

1447da0dfc41dfca2cea4af302618da6.png

inherit:它用于将属性设置为从其父项继承。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值