the Web, unplugged

  1. Search
  2. About
  3. Ask me anything
  4. Subscribe
  5. Archive
  6. Random

the Web, unplugged

News and opinion for developers on HTML5, CSS3, JavaScript, devices, platforms, games and the web of applications

Newer
Older
  • border-radius background bleed

    If you’ve used CSS3 border-radius, particularly with webkit browsers, you may have seen something like this

    When the background color or image of an element with border-radius applied is quite distinct from the background color of the element it is on top of, this nasty bled effect can potentially make the use of border-radius impossible.

    What’s actually happening is that the background color (or image) is being clipped to the border box (which is the default border clip). With anti aliasing, some of the background color or image is visible outside the curved border (this doesn’t happen with square borders). But with CSS3 we can also clip the border to the padding box, and the content box (though not the margin box) using the background-clip property, and the keywords padding-box, border-box and content-box (as of September 2010, this potentially requires a vendor specific extension)

    We can use this to largely get rid of the background bleed by setting the background-clip to padding-box like so


    background-clip: padding-box

    Perfect? no. Improved? Sure. Hope this comes in handy some day!

    Posted on September 17, 2010 with 40 notes

    1. throttlesewn liked this
    2. lollopmethod liked this
    3. sidebarrespo liked this
    4. urbanizeforg liked this
    5. achetervefa liked this
    6. dsampaolo liked this
    7. enpause liked this
    8. telephonie-mobile liked this
    9. recette-tagada liked this
    10. designerbeta reblogged this from johnallsopp
    11. designerbeta liked this
    12. strangepants liked this
    13. catharsis liked this
    14. jayrobinson said: I was just writing something up on this one minute ago!
    15. jayrobinson liked this
    16. johnallsopp posted this
  • nevver
  • marco
  • journo-geekery
  • jakebresnehan
  • cameronmoll
  • inkbase
  • wpbasti
  • adactio
  • finette
  • 9-bits
  • gilmore
  • webkitbits
  • mozidentity
  • devexp
  • new-aesthetic
  • okito
  • badassjs
  • craftyjs
  • stateless-co
  • maxinesherrin
  • small-mammal
  • jqtouch
  • graphicpeel
  • julio-ody
  • iosapps
  • shortlogic
  • webintents
  • pinchzoom

Field Notes Theme. Designed by Manasto Jones. Powered by Tumblr.