This page was translated from English by the community.Learn more and join the MDN Web Docs community.
stroke
Baseline Widely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since июль 2020 г..
* Some parts of this feature may have varying levels of support.
Атрибут обводки определяет цвет контура в данном графическом элементе. Значение по умолчанию для атрибута обводки —None.
In this article
Контекст использования
| Категория | Presentation attribute |
|---|---|
| Значения | <paint>,context-fill,context-stroke |
| Анимируемый | Да |
| Нормативный документ | SVG 1.1 (2nd Edition) |
Примеры
>SVG Line с stroke
Пример 1: Нарисуйте прямую зелёную линию, используяstroke
html
<svg height="50" width="300"> <path stroke="green" d="M5 20 1215 0" /></svg>Пример 2: Нарисуйте чёрный круг с синей рамкой используя stroke
html
<svg height="100" width="100"> <circle cx="50" cy="50" r="40" stroke="blue" stroke-width="2" fill="black" /></svg>Использованиеcontext-stroke
Информацию об использовании значения нестандартного и ограниченногоcontext-stroke (иcontext-fill) смотреть в документации для свойства-moz-context-properties.
Элементы
Следующие элементы могут использовать атрибутstroke.