Ictus - Trucchi CSS

Anonim

La strokeproprietà in CSS serve per aggiungere un bordo alle forme SVG.

.module ( stroke: black; )

Ricorda:

  • Questo sarà sovrascrivere un attributo di presentazione
  • Questo non sovrascriverà uno stile in linea ad es

Valori

La strokeproprietà può accettare qualsiasi valore di colore CSS.

  • Colori nominati - orange
  • Colori esadecimali - #FF9E2C
  • Colori RGB e RGBa - rgb(255, 158, 44) and rgba(255, 158, 44, .5)
  • Colori HSL e HSLa - hsl(32, 100%, 59%) and hsla(32, 100%, 59%, .5)

Abbastanza incredibilmente, strokeaccetta anche i modelli di forme SVG che sono definiti all'interno di un defselemento:

.module ( stroke: url(#pattern); )

Vedi la proprietà Tratto penna di CSS-Tricks (@ css-tricks) su CodePen.

Relazionato

  • fill
  • stroke-dasharray
  • stroke-dashoffset
  • stroke-linecap
  • stroke-width

Maggiori informazioni

  • Specifiche SVG 1.1
  • MDN su riempimenti e tratti

Supporto browser

Cromo Safari Firefox musica lirica IE Android iOS
9+ 4.4+