Tuesday, 5 July 2016

Text highlighting using CSS on selection (Instead of blue color):

Step 1: Add the style in your web page head section . Its highlighted all texts.

<style type="text/css">
   
    ::selection {background:transparent; text-shadow:#000 0 0 2px;}
::-moz-selection {background:transparent; text-shadow:#000 0 0 2px;}
::-webkit-selection {background:transparent; text-shadow:#000 0 0 2px;}
::-o-selection {background:transparent; text-shadow:#000 0 0 2px;}
a object {background:#000;}
</style>

For Example:


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">

    
    ::selection {background:transparent; text-shadow:#000 0 0 2px;}
::-moz-selection {background:transparent; text-shadow:#000 0 0 2px;}
::-webkit-selection {background:transparent; text-shadow:#000 0 0 2px;}
::-o-selection {background:transparent; text-shadow:#000 0 0 2px;}
a object {background:#000;}
        </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align:left">
        

        <p>
            CSS is designed primarily to enable the separation of document content from document presentation, 
            including aspects such as the layout, colors, and fonts.[3] This separation can improve content accessibility, 
            provide more flexibility and control in the specification of presentation characteristics, enable multiple HTML pages to share 
            formatting by specifying the relevant CSS in a separate .css file, and reduce complexity and repetition in the structural content.
        </p>
        
    </div>
    </form>
</body>
</html>

Screen Shots:

Normal :



After applying CSS:





No comments:

Post a Comment

How to create a simple Hello World website in ASP.NET MVC using Razor Syntax: (Note: I am using Visual Studio 2012 ) Step 1: ...