+ 2

How to add a transparent border to a heading?

26th Feb 2017, 8:33 PM
Ruth
Ruth - avatar
5 Antworten
+ 18
h1,h2,h3,h4,h5,h6{border:solid rgba(100,100,100,.3)}
26th Feb 2017, 9:01 PM
Valen.H. ~
Valen.H. ~ - avatar
2nd Jan 2018, 2:59 AM
Sreelakshmy
Sreelakshmy  - avatar
+ 3
@VH solution is for semi-transparent border... Transparent border make me thinking 1> that's same as no border, and 2> you can imagine a kind of inner border transparent : https://code.sololearn.com/W5zC8CyAZ5S0/#html
26th Feb 2017, 9:22 PM
visph
visph - avatar
+ 2
@Tomasz Jagus: You haven't enough study my code... You need to set some padding, else you don't have any "transparent inner border" :P [ EDIT ] I make a mistake, sorry... I have missread your answer ^^ But anyway, for @VH answer ( using rgba for border-color ), you don't need to set background-clip to padding-box, as this is the default value ;)
27th Feb 2017, 4:44 AM
visph
visph - avatar
- 1
First use rgba to define border colour and then use background-clip: padding-box.
27th Feb 2017, 1:31 AM
Tomasz Jaguś
Tomasz Jaguś - avatar