Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Tuesday, June 28, 2016

HTML: Changing colors of specific words in a string of text

Enter the competition by January 30, 2011 and you could win up to $$$$ ? including amazing summer trips!

Answer by Damien-at-SF for HTML: Changing colors of specific words in a string of text


Enter the competition by January 30, 2011 and you could win up to $$$$ ? including amazing summer trips!

The span elements are inline an thus don't break the flow of the paragraph, only style in between the tags.

Answer by brian_d for HTML: Changing colors of specific words in a string of text


use spans. ex) January 30, 2011

Answer by Juan Pablo Pinedo for HTML: Changing colors of specific words in a string of text


You could use the HTML5 Tag :

Enter the competition by January 30, 2011 and you could win up to $$$$ ? including amazing summer trips!

And use this in the CSS:

p {      font-size:14px;      color:#538b01;      font-weight:bold;      font-style:italic;  }    mark.red {      color:#ff0000;      background: none;  }    mark.blue {      color:#0000A0;      background: none;  }  

The tag has a default background color...at least in Chrome.

Answer by otis answer for HTML: Changing colors of specific words in a string of text


You could use the longer boringer way

Enter the competition by

summer

you get the point for the rest

Answer by JayMcpeZ_ for HTML: Changing colors of specific words in a string of text


You can also make a class:

I am in yellow color!!!!!!

then in a css file do:

.mychangecolor{ color:#ff5 /* it changes to yellow */ }  

Answer by Trevor Lee for HTML: Changing colors of specific words in a string of text


Tailor this code however you like to fit your needs, you can select text? in the paragraph to be what font or style you need!:

        

This is your text. Typewhat you like

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.