How to Change the Color of Selected Content


Tags: css,css3,css-selectors

Problem :

Can anyone tell me how to change the color of the selected content?? em using this css for it

::selection {
        background: #ffb7b7; /* Safari */
        }
::-moz-selection {
        background: #ffb7b7; /* Firefox */
}

It works good but not what I want, it change the color of selected text but the spaces/gaps are not select, spaces/gaps are select with the default blue color, any remedy for it?? Check my Blog and try to select the spaces/gaps then u know exactly whats wrong with it.. Waiting for ur help :) http://kownleg.blogspot.com



Solution :

There are some areas that are highlighted in the darker blue colour, but I don't think there's much you can do about that if I'm being honest.

It actually looks like the ::selection pseudo element is supported experimentally by only a few browsers, and it doesn't look like it will be added to any others any time soon. See this link for more info


    CSS Howto..

    How to control dojo widget classes, or how to get fine-grained control of style

    Image Filter and Show text on Mouseover

    How to remove IconTabFilter icons using css?

    How do I tile background images in this specific way?

    3 column layout, same height, middle column full size. How to do it without “table-cell”

    How to display an image from a dropdown menu selection?

    How can I prevent the seconds portion from displaying on the HTML5 time input element?

    How to change css for active link based on the hashtag

    How to add border for html tr

    How To Embed font-awesome CSS into DOM Scripting (javascript)?

    How to add and remove a current state to a link when another is clicked using jQuery

    how I can change the size of font inside PHP

    How to show a div on click of an li element using css?

    How can I keep the progress bar number value centered and on top?

    How to center this grid layout with css? [closed]

    How to use the Javascript to add/remove the CSS/colour style to the html page?

    How to switch images on click in html and css

    How do I edit the CSS of the Html.DisplayFor method in MVC 3?

    CSS - How do I float one element to the right inside the other div?

    How to correctly set the column widths on my HTML table?

    select tag in Google Chrome shows lowercase options

    css - can't get dropdown nav to show above content below it

    How to create smooth headlines with HTML and CSS?

    How to access an object from a webpage in selenium

    How to remove the margin top from a div with display table-cell?

    How to create specified distance between the end of a line and the baseline of the second line using css

    How to make div height 100% inside relative div?

    How to positioning the tooltip above cursor

    How do I get an html/css form to post to Gravity Forms?

    How to hide `
  • ` drop down menu in Nav bar in Desktop view?