Rajeev Rajeev - 3 months ago 19
CSS Question

add title attribute from css

How to add title='mandatory' from css to the following

<label class='mandatory'>Name</label>

.mandatory
{
background-image:url(/media/img/required.gif);
background-position:top right;
background-repeat:no-repeat;
padding-right:10px;
font-weight:bold;
}

Answer

You can't. CSS is a presentation language. It isn't designed to add content (except for the very trivial with :before and :after).

Comments