Adding style to a watermark

Learning Resources
 

Adding style to a watermark


WatermarkCssClass - The CSS class to apply to the TextBox when it has no value (e.g. the watermark text is shown).

TextBox also has CssClass property to attach a CSS class to it for styling but WatermarkCssClass only apply styles when TextBox is empty. Following are an example CSS class used :

.csswatermarked
{
   background-color: #E1E1E1;
   border: solid 1px #808080;
   padding: 2px;
}

You can add the above CSS classes into an external CSS file and can attach the CSS file with ASP.NET page using link tag.

 

 

 For Support