How to change color after select a text or line?

0 votes
36 views
Ravi Vishwakarma asked 12 days ago in Web Application by Ravi Vishwakarma

How to change color after select a text or line?

1 Answer

0 votes
Ethan Karla answered 9 days ago by Ethan Karla
::selection use to select a paragraph and then change the color
The ::selection pseudo-element matches the portion of an element that is selected by a user.
The following CSS properties can be applied to ::selection: color, background, cursor, and outline.
The following example makes the selected text white on a orange background:
<!DOCTYPE html>

<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
    <meta charset='utf-8' />
    <title></title>
    <style>
        ::selection {
            background-color:orange;
            color:white;
        }
    </style>
</head>
<body>
    <p><strong>Note : </strong> Select some data of text</p>
    <b>Windows App Development Solution</b><br />
MindStick is examining enhanced ideas to create user interference more fertile with our enthralled windows application development services.
    Although inadequate, windows have a faithful user base, growing mobile apps for this program unleashes vast business possibilities.
     we are identified for producing reliable and results-oriented Windows Phone Apps Development solutions.
     Our Windows developer team is centered to create windows mobile apps that will deliver user experience and interaction enlightening, connected, and supportive.
</body>
</html>