Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-28-2013, 11:02 AM   #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, 12:13 PM   #2
Doitsu
Grand Sorcerer
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: 5,680
Karma: 23983815
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
Advert
Old 02-28-2013, 12: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: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
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 online now   Reply With Quote
Old 02-28-2013, 12: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


Forum Jump

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


All times are GMT -4. The time now is 12:29 PM.


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