Skip navigation

I rarely get to make new HTML pages, in fact on a job interview the interviewer, who was a really cool down to earth guy, chuckled when I used the font tag to set text color. I knew it was depreciated, but all the sites I work on daily still use do it this way and have not been updated.

So, being the expert googler that I am I tried to find the correct way to set mixed color. I couldn’t find it, blog opportunity!

So to be clear, all I wanted to do was after my field name, have a red asterisk to indicate that it was a required field, except I do not know the exact color the client wants yet (third party came up with the design, my client uses a lot of different third parties…).

So I only want to define this once in the css for easy changes later.

What I cmae up with is this;

css file:

.required_asterisk {        
     color: #f00; /* red */

Then in my html file;

Name<a class="required_asterisk">*</a>

Leave a Reply

Your email address will not be published. Required fields are marked *