css border-right-width属性怎么用


本文摘自PHP中文网,作者silencement,侵删。

css border-right-width属性定义及用法

在css中,border-right-width属性是用来设置元素右边框宽度的,当我们要单独调整元素右边框的宽度的时候就可以使用该属性(注意:在使用border-right-width属性设置元素边框宽度之前,必须定义右边框(border-right-style属性),不然没有边框就没有边框宽度,border-right-width属性就不会有效果)。

css border-right-width属性语法格式

css语法:border-right-width: thin / medium / thick / length / inherit

JavaScript语法:object.style.borderRightWidth="thin / medium / thick / length / inherit"

css border-right-width属性值说明

thin:设置右边框为细小的

medium:设置右边框为中等(默认)

thick :设置右边框为粗大的

length:自定义右边框的宽度(如:10px;)

inherit:从父元素继承右边框宽度

实例

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title>css border-right-width设置右边框宽度属性笔记</title>

<style type="text/css">

body{background: #ddd;font-size:20px;}

#a,#b,#c,#d{margin-top:10px;width:300px;border-right-style:solid;}

#a{border-right-width:thin;}

#b{border-right-width:thick;}

#c{border-right-width:8px;}

</style>

</head>

<body>

<div id = "a">thin:设置右边框为细小的;</div>

<div id = "b">thick:设置右边框为粗大的;</div>

<div id = "c">自定义右边框的宽度为8px;</div>

</body>

</html>

运行结果

ee1b98882fee1d67254d1aefe3bab9c.png


以上就是css border-right-width属性怎么用的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

常见的css框架有哪些

css怎么在文字两边加上横线

css border-image-slice属性怎么用

怎样建立新的css规则

通过示例来了解css background强大的用法(值得收藏)

css怎么给按钮加图标

深入了解css中的计数函数

几种关于html和css的使用方法

vue的源码解析(代码示例)

:not()是什么?:not()的简单使用

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...