Fixing the background ‘bleed’

I recently came up against an issue in Safari where the background colour of an element seemed to ‘bleed’ through the edge of the corners when applying both borders and a border-radius (see the image above). After seeing David Cole tweet about the same issue I resolved to find a solution, and it came in the form of the -webkit-background-clip property.
-webkit-background-clip: padding-box;
It’s important to note that if you are using the shorthand notation to specify your other background properties then this should be added after those. It seems that the shorthand notation implies a default clip value which will override one that’s previously set. Your mileage may vary, but it worked a treat for me. Read more about the available values for the property here.
Update: This post has been generously translated into Bulgarian by Albert Ward.
531 notes
-
kataskeuh-istoselidwn reblogged this from sneak
-
margo-cosmetics reblogged this from sneak
-
tigari--electronice reblogged this from sneak
-
tigari-eletronice reblogged this from sneak
-
kataskeuh-istoselidon liked this
-
kataskeuh-istoselidon reblogged this from sneak
-
travelsim reblogged this from sneak
-
fish-knife liked this
-
prowthish-istoselidon reblogged this from sneak
-
escortei reblogged this from sneak
-
1article-mania reblogged this from sneak
-
webmadrid reblogged this from sneak
-
cheap-papers reblogged this from fabbrikk
-
robbieloggia liked this
-
rgre1 liked this
-
blinds-and-curtains reblogged this from sneak
-
olegpro reblogged this from sneak
-
cheap-papers reblogged this from sneak
-
cheap-papers reblogged this from jonathanlane
-
cheap-papers reblogged this from webkitbits
-
itsjaylin liked this
-
the-topten reblogged this from sneak
-
panouriradiante reblogged this from owltastic
-
uebersetzer-probst reblogged this from webkitbits
-
paginas-web-uruguay reblogged this from sneak
-
nhmortgagebroker reblogged this from sneak
-
astro2k reblogged this from sneak
-
weddingphotographersdublin reblogged this from sneak
-
htmlheroblog reblogged this from sneak and added:
Для тех, кому лень читать, скажу, что нужно использовать: background-clip:
-
romani-in-uk reblogged this from sneak
-
kitsunde liked this