Deprecated: Assigning the return value of new by reference is deprecated in /home/bahus/data/www/fixblog.ru/css/wp-settings.php on line 468 Deprecated: Assigning the return value of new by reference is deprecated in /home/bahus/data/www/fixblog.ru/css/wp-settings.php on line 483 Deprecated: Assigning the return value of new by reference is deprecated in /home/bahus/data/www/fixblog.ru/css/wp-settings.php on line 490 Deprecated: Assigning the return value of new by reference is deprecated in /home/bahus/data/www/fixblog.ru/css/wp-settings.php on line 526 Deprecated: Assigning the return value of new by reference is deprecated in /home/bahus/data/www/fixblog.ru/css/wp-includes/cache.php on line 103 Deprecated: Assigning the return value of new by reference is deprecated in /home/bahus/data/www/fixblog.ru/css/wp-includes/query.php on line 21 Deprecated: Assigning the return value of new by reference is deprecated in /home/bahus/data/www/fixblog.ru/css/wp-includes/theme.php on line 618 Fix Blog - CSS Справочник » font-weight

font-weight

font-weight

Браузер Internet Explorer Netscape Opera Safari Mozilla Firefox
Версия 5.5 6.0 7.0 7.0 8.0 7.0 8.0 9.0 2.0 3.0 1.7 1.0 2.0 3.0
Поддерживается Да Да Да Да Да Да Да Да Да Да Да Да Да Да

Краткая информация

CSS CSS1
Значение по умолчанию normal
Наследуется Да
Применяется Ко всем элементам
Аналог HTML <B>
Ссылка на спецификацию http://www.w3.org/TR/CSS21/fonts.html#propdef-font-weight

Описание

Устанавливает насыщенность шрифта. Значение устанавливается от 100 до 900
с шагом 100. Сверхсветлое начертание, которое может отобразить браузер, имеет
значение 100, а сверхжирное — 900. Нормальное начертание шрифта (которое
установлено по умолчанию) эквивалентно 400, стандартный полужирный текст —
значению 700. Другие аргументы (bolder и lighter)
позволяют менять жирность текста относительно насыщенности родительского элемента.

Синтаксис

font-weight: bold | bolder | lighter | normal | 100 | 200 | 300 | 400 | 500
| 600 | 700 | 800 | 900.

Аргументы

Насыщенность шрифта задается с помощью ключевых слов: bold
— полужирное, bolder — жирное; lighter
— светлое, normal — нормальное начертание.
Также допустимо использовать условные единицы от 100 до 900.

Пример

Валидный HTML Валидный CSS

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>font-weight</title>
<style type="text/css">
H1 {

 font-weight: normal; /* Нормальное начертание */
}

.select {
 color: maroon; /* Цвет текста */
 font-weight: 600; /* Жирное начертание */

}
</style>
</head>
<body>

<h1>Duis te feugifacilisi</h1>

<p><span class="select">Lorem ipsum dolor sit amet</span>,
consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet
dolore magna aliguam erat volutpat. Ut wisis enim ad minim veniam, quis nostrud
exerci tution ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>

</body>
</html>

Результат данного примера показан ни рис. 1.

Рис. 1

Рис. 1. Применение параметра font-weight

Объектная модель

[window.]document.getElementById("elementID").style.fontWeight

Примечание

Браузер не всегда может адекватно показать требуемую насыщенность шрифта,
это зависит от размеров текста и вида шрифта.

Filed under font-weight