Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-28-2013, 12:02 PM   #1
MrB
Very Slow Learner
MrB has learned how to read e-booksMrB has learned how to read e-booksMrB has learned how to read e-booksMrB has learned how to read e-booksMrB has learned how to read e-booksMrB has learned how to read e-booksMrB has learned how to read e-books
 
Posts: 51
Karma: 788
Join Date: Jul 2012
Location: UK
Device: none
Single words in different colours

Please can anyone give me some simple HTML code to put individual words in the same paragreaph in different colours? e.g. If I wanted to write 'Richard Of York Gave Battle In Vain' in red, orange, yellow, green, blue, violet, indigo respectively, how would I go about it?

Many thanks (again!) for your advice.
MrB is offline   Reply With Quote
Old 02-28-2013, 01:13 PM   #2
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 3,490
Karma: 9127314
Join Date: Dec 2010
Device: Kindle PW2
IMHO, the easiest way to achieve this is to define span styles for each color and assign them to each word.
For example, add the following styles to the style section of the .html file or the stylesheet:

Code:
<style type="text/css">

  span.red { color: red; }
  span.blue { color: blue; }

</style>
and the following code in the .html file:

Code:
<p>This is a <span class="red">red word</span> and this a <span class="blue">blue one</span>.</p>
For more information, see this website.
Doitsu is offline   Reply With Quote
Old 02-28-2013, 01:17 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 19,816
Karma: 19044546
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Astak Pocket Pro, K4NT,Galaxy Tab 2
Code:
<p><span style="color: red;">Red</span><span style="color: green;">Green</span><span style="color: blue;">Blue</span><span style="color: yellow;">Yellow</span></p>
You can use the names :
black
silver
gray
white
maroon
red
purple
fuchsia #FF00FF
green
lime
olive
yellow
navy
blue
teal
aqua

for any other shade, you will need to code the RGB values
theducks is offline   Reply With Quote
Old 02-28-2013, 01:57 PM   #4
MrB
Very Slow Learner
MrB has learned how to read e-booksMrB has learned how to read e-booksMrB has learned how to read e-booksMrB has learned how to read e-booksMrB has learned how to read e-booksMrB has learned how to read e-booksMrB has learned how to read e-books
 
Posts: 51
Karma: 788
Join Date: Jul 2012
Location: UK
Device: none
Thank you both for your suggestions.
MrB is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Background and Font Colours Brianrh General Discussions 1 10-23-2012 11:02 AM
PDF invert colours. Nexutix PDF 5 06-22-2011 07:51 PM
icon colours Brandobras Calibre 2 07-22-2010 04:58 AM
Colours? griffonwing Astak EZReader 29 09-13-2009 09:22 PM
Background 'colours' AlexBell Calibre 3 07-15-2009 07:42 PM


All times are GMT -4. The time now is 12:33 AM.


MobileRead.com is a privately owned, operated and funded community.