开发者

How do i make a background image right click able?

开发者 https://www.devze.com 2022-12-24 01:01 出处:网络
I gave up on trying to center an image vert开发者_开发百科ically and horizontally. I seen solutions that require you to know the size of the image. I do know background-image will center it properly.

I gave up on trying to center an image vert开发者_开发百科ically and horizontally. I seen solutions that require you to know the size of the image. I do know background-image will center it properly. However i cannot right click the image and hit save as. Is there a trick i can use to allow this?


You can always add an <img> in the <div> that you are setting the background for. And set the opacity to 0.

Users can't see it but they can still right click and save it.


No, this is not possible.
Background images are not intended to be any more than a pretty surrounding for the important parts and there is no reason why they should be easily downloadable.


Have you taken a look at this potential answer?

http://www.brunildo.org/test/img_center.html

His solution is pure HTML+CSS, doesn't require foreknowledge of the image height and works in: Opera 6+. Safari, IE5+/Win, and IE5/Mac.


In firefox you can view background images. Then you can save the image


Use Firebug plugin for Firefox. You can browse to the DOM element and then find the background image. Then there's an option to "open image in tab". From there saving it is simple.

I assume this is for development purposes and not something you want end users to do.


That depends on your browser -- in Firefox3, you may use Tools->Page Info->Media, locate the image from the list and hit "Save As..."

I think an HTML/CSS option is not possible, but I'm not completely sure.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号