0

How do units work in css (px,cm,mm,in,pc...)

I am busy with the Text shadow in css .Please assist Thanks .

16th May 2021, 8:35 AM
Philippe
Philippe - avatar
4 Antworten
0
Sam P. Yeah I see😁 This was a mistake I think
18th May 2021, 8:13 PM
🇮🇱 Radin Masiha 🇮🇱
🇮🇱 Radin Masiha 🇮🇱 - avatar
- 1
Philippe You can just add it alongside (no spaces) a value of a proprety so for example the thickness (2px), color blue of a border and font size (0.5 cm) of a paragraph would be : p { border: 2px blue; font-size: 0.5cm;} If you want a text shadow (you can use different units when specifying a proprety value, to a certain degree for text shadow ex. inches are too big so they cannot be used), Text shadow of 2cm x 2pc x 6pt with color blue for paragraph: p { text-shadow: 2cm 2pc 6pt blue;} You can use other units like inches (in), milimiters (mm), points (pt) and picas (PC). If you want to learn more, I suggest going to W3schools website for CSS units: https://www.w3schools.com/cssref/css_units.asp
17th May 2021, 7:48 PM
Sam P.
Sam P. - avatar
- 1
In text-shadow? <h1> Text Shadow Example </h1> <style> h1 {text-shadow: 3px 3px 6px rgba(0,0,0,.5);} </style> (edited)
18th May 2021, 11:13 AM
🇮🇱 Radin Masiha 🇮🇱
🇮🇱 Radin Masiha 🇮🇱 - avatar
- 1
Radin Masiha check again your statement is false, you can use cm mm and pc in text shadow, you can even mix them together in a css declaration. Go try this code (below) and you will see! https://code.sololearn.com/W1m7Riiu0a71/?ref=app
18th May 2021, 6:01 PM
Sam P.
Sam P. - avatar