Is it possible to show only a part of a backgroundimage when using CSS3? I want to use an image as a background but only show half of it, so is there something like a mask you can define for your backgroundimages?
相关问题
- Views base64 encoded blob in HTML with PHP
- How to get the background from multiple images by
- CV2 Image Error: error: (-215:Assertion failed) !s
- Replace image attributes for lazyload plugin on im
- How to display an image represented by three matri
相关文章
- Use savefig in Python with string and iterative in
- Where does this quality loss on Images come from?
- Specifying image dimensions in HTML vs CSS for pag
- How to insert pictures into each individual bar in
- How do I append metadata to an image in Matlab?
- Img url to dataurl using JavaScript
- Click an image, get coordinates
- How to get a CGImageRef from Context-Drawn Images?
Well only problem is that "clip-path", "mask" and "filter" (no not the IE "filter" but SVG "filter") only works for Firefox and Safari (yes no Chrome). And they do it differently. Firefox needs an svg clippath specified via an id eg:
while Safari just uses the shape itself to create clippath from:
I have yet to discover a way to do it in Opera and Chrome.
But for FF and Safari "cross browser" example i have created this: http://tokimon.dk/testing/css-svg-test.html.
Otherwise maybe you can get something out of the background manipulation in CSS 3: http://www.css3.info/preview/
WebKit now supports alpha masks in CSS SVG images can be used as masks. For example, a partially transparent circle.
-webkit-mask-image: url(circle.svg);
http://webkit.org/blog/181/css-masks/
hope this helps.
Try this:
In Opera you can only use inline SVG in a xhtml page to do that effect. Chuck your image inside SVG, define a mask and do a
<use xlink:href="#image" mask="url(#yourmask)"/>
to get the effect.