CSS border-top-width Свойство
Пример
Задайте ширину верхней границы:
div {border-top-width: thin;}
Подробнее примеры ниже.
Определение и использование
Свойство border-top-width
задает ширину верхней границы элемента.
Примечание: Перед свойством всегда объявляйте свойство border-style или Top-Style border-top-width
. Элемент должен иметь границы, прежде чем можно изменить ширину.
Значение по умолчанию: | medium |
---|---|
Inherited: | no |
Animatable: | yes. Читайте о animatable |
Version: | CSS1 |
Синтаксис JavaScript: | object.style.borderTopWidth="5px" |
Поддержка браузера
Номера в таблице указывают первую версию браузера, которая полностью поддерживает свойство.
Свойство | |||||
---|---|---|---|---|---|
border-top-width | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Синтаксис CSS
border-top-width: medium|thin|thick|length|initial|inherit;
Значения свойств
Значение | Описание | |
---|---|---|
medium | Задает среднюю верхнюю границу. Это значение по умолчанию | |
thin | Задает тонкую верхнюю границу | |
thick | Задает толстую верхнюю границу | |
length | Позволяет определить толщину верхней границы. Читать о единицах длины | |
initial | Присваивает этому свойству значение по умолчанию. (Читайте о initial) | |
inherit | Наследует это свойство из родительского элемента. (Читайте о inherit) |
Другие примеры
Пример
Установите ширину верхней границы в среднее:
div {border-top-width: medium;}
Пример
Задайте ширину верхней границы толщиной:
div {border-top-width: thick;}
Пример
Задайте ширину верхней границы для 1px:
div {border-top-width: 1px;}
Пример
Задайте ширину верхней границы для 15пкс:
div {border-top-width: 15px;}
Похожие страницы
CSS Справочник: CSS Border
CSS Справка: border-top Свойство
HTML DOM Справочник: borderTopWidth Свойство