## border-top 屬性
### 屬性定義及使用說明
border-top 簡寫屬性把上邊框的所有屬性設置到一個聲明中
可以按順序設置如下屬性: border-top-width, border-top-style, and border-top-color.
如果不設置其中的某個值,也不會出問題,比如 border-top:solid #ff0000; 也是允許的。
JavaScript 語法:object.style.borderTop="3px solid blue"
* * *
## 瀏覽器支持
表格中的數字表示支持該屬性的第一個瀏覽器版本號。
| 屬性 | ? | ? | ? | ? | ? |
| --- | --- | --- | --- | --- | --- |
| border-top | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
* * *
## 屬性值
| 值 | 描述 |
| --- | --- |
| *border-top-width* | 規定上邊框的寬度。參閱:[border-top-width](https://www.w3cschool.cn/cssref/pr-border-top-width.html "CSS border-top-width 屬性") 中可能的值。 |
| *border-top-style* | 規定上邊框的樣式。參閱:[border-top-style](https://www.w3cschool.cn/cssref/pr-border-top-style.html "CSS border-top-style 屬性") 中可能的值。 |
| *border-top-color* | 規定上邊框的顏色。參閱:[border-top-color](https://www.w3cschool.cn/cssref/pr-border-top-color.html "CSS border-top-color 屬性") 中可能的值。 |
| inherit | 規定應該從父元素繼承 border-top 屬性的設置。 |
* * *
## 實例--設置上邊框的樣式:
```
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>W3Cschool教程(w3cschool.cn)</title>
<style>
p
{
border: medium double rgb(250,0,255)
}
</style>
</head>
<body>
<p>This is some text in a paragraph.</p>
</body>
</html>
```
- CSS常用樣式控制
- background--背景
- Text--文本
- CSS屬性
- align-*
- animation-*
- appearance
- backface-visibility
- background
- background-attachment
- background-blend-mode
- background-clip
- background-color
- background-image
- background-origin
- background-position
- background-repeat
- background-size
- border
- border-bottom
- border-bottom-color
- border-bottom-left-radius
- border-bottom-right-radius
- border-bottom-style
- border-bottom-width
- border-collapse
- border-color
- border-image
- border-image-outset
- border-image-repeat
- border-image-source
- border-image-width
- Border-left
- border-left-color
- border-left-style
- border-left-width
- border-image-slice
- border-radius
- border-right
- border-right-color
- border-right-style
- border-right-width
- border-spacing
- border-style
- border-top
- border-top-color
- border-top-left-radius
- border-top-right-radius
- border-top-style
- border-top-width
- border-width
- bottom
- box-shadow
- box-sizing
- caption-side
- clear
- clip
- color
- column-count
- column-gap
- column-rule
- column-rule-color
- column-rule-style
- column-rule-width
- column-span
- column-width
- columns
- content
- counter-increment
- counter-reset
- cursor
- direction
- display
- Empty-cells
- filter(濾鏡)
- CSS 偽元素選擇器
- :active 選擇器
- :after 選擇器
- :before 選擇器
- :checked 選擇器
- :disabled 選擇器
- :empty 選擇器
- :enabled 選擇器
- :first-child 偽元素
- :first-letter 偽元素
- :first-line 偽元素
- :first-of-type 選擇器
- :focus 選擇器
- :hover 選擇器