边框属性和用法

border——css的边框属性

borde : 大小 | 线的样式 | 颜色

线的样式

- none:没有边框,即忽略所有边框的宽度(默认值)

-·solid:边框为单实线 ·dashed:边框为虚线

·dotted:边框为点线

·double:边框为双实线

	.boss {
					width: 300px;
					height: 300px;
					margin: 0 auto ;
					border: 10px solid aqua;
				
				}

在这里插入图片描述

border-:top | left | bottom | right

border-加上这四个值可以单个设置大小,颜色和线样式。

	.boss {
					width: 300px;
					height: 300px;
					margin: 0 auto ;
				border-top: 10px solid red;
				border-left: 20px dashed red;
				border-bottom: 30px solid green;
				border-right: 40px solid red; 
				}

在这里插入图片描述

- border-top | left | bottom | right-width

可以单独设置宽度

- border-top | left | bottom | right-style

可以单独设置线的样式

		.boss {
					width: 300px;
					height: 300px;
					margin: 0 auto ;
			border-top-width: 10px;
			border-left-width: 20px;
			border-bottom-width: 30px;
			border-right-width: 40px;
			border-top-style: solid;
			border-left-style: dashed;
			border-bottom-style: dotted;
			border-right-style: double;  
				}

在这里插入图片描述

border-top | left | bottom | right-color

可以单独设置颜色

	.boss {
					width: 300px;
					height: 300px;
					margin: 0 auto ;
					border: 30px solid aqua;
			border-top-color: red;
			border-left-color: orange;
			border-bottom-color: pink;
			border-right-color: aqua;
				}

在这里插入图片描述

border-radius——圆角

两种方法:border-radius: 10px 20px 30px; | border-radius: 50%;
以上两种方法都可以设置圆角,百分比是全局设置,px方法是单个设置。

	.boss {
					width: 300px;
					height: 300px;
					margin: 0 auto ;
					border: 30px solid aqua;
			border-top-color: red;
			border-left-color: orange;
			border-bottom-color: pink;
			border-right-color: aqua;
			 border-radius: 10px 20px 30px;
				}

在这里插入图片描述

			.boss {
					width: 300px;
					height: 300px;
					margin: 0 auto ;
					border: 30px solid aqua;
			border-top-color: red;
			border-left-color: orange;
			border-bottom-color: pink;
			border-right-color: aqua;
			 /* border-radius: 10px 20px 30px; */
			 border-radius: 50%; 
				}

在这里插入图片描述

box-shadow——边框阴影

	.boss {
					width: 300px;
					height: 300px;
					margin: 100px auto ;
					border: 30px solid aqua;
					box-shadow: 10px 20px 30px 40px;
					/* box-shadow: 水平 垂直 大小 颜色; */
				}
			

在这里插入图片描述

border-image——图形边框

.boss {
					width: 300px;
					height: 300px;
					margin: 100px auto;
					border: 30px solid aqua;
					border-image: url("./手机8.webp") 50 50 round;
				}

在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值