简体   繁体   中英

How to Change blue background selection color from image using css

Can any one help me how to remove blue color from image on selection you can see screenshot from here...

在此处输入图片说明

You can use the user-select property (though pressing CTRL + A will still cause the blue selection background to appear as @WebDesignerRDj pointed out):

img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
     user-select: none;
    }

http://jsfiddle.net/rU2y4/2/

Use

::selection {
color: #e2e2e2;
background-color: #999;
}  

Note : This only changes the font properites. Not the images.
However if you want to remove some background from image its Impossible with CSS. CSS is meant to edit the HTML style not the images. For that use Adobe Photoshop! I am seriously not able to understand, why do you want to change the background of the image.
Ok there can be a solution. You create an image with transparent background! And change its background. A little more elaboration please.

Edit: You can use this for image background. But the div background will be changed. Use

background-color: none;

or

background-color: transparent;

This will not select the image. Not change the background to blue!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM