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 06-12-2013, 11:20 AM   #1
krausj
Enthusiast
krausj began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Apr 2013
Device: ipad
How do I assign different colors to different sections of text?

Let's say I have two classes of text on one page. How do I make each a different color. Here is what my xhtml and it's corresponding css file look like for reference.

[overlarge image put in spoiler tags - moderator]
Spoiler:

Last edited by dreams; 06-12-2013 at 12:24 PM. Reason: placed overlarge image in spoiler
krausj is offline   Reply With Quote
Old 06-12-2013, 12:18 PM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Color in bookview can be done via CSS. Change of color in codeview is not possible.
Toxaris is offline   Reply With Quote
Advert
Old 06-12-2013, 12:57 PM   #3
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
If it is important to you, you can right click to open your text in an external editor which does have this capability.
mrmikel is offline   Reply With Quote
Old 06-13-2013, 09:56 AM   #4
krausj
Enthusiast
krausj began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Apr 2013
Device: ipad
I'm actually doing all of this by hand, not using Sigil or anything. Do you know how to make this happen in an editor?
krausj is offline   Reply With Quote
Old 06-13-2013, 10:32 AM   #5
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
In notepad++, you can get a similar effect by choosing Language, flash actionscript.
Attached Thumbnails
Click image for larger version

Name:	notepadexample.jpg
Views:	188
Size:	242.2 KB
ID:	106945  
mrmikel is offline   Reply With Quote
Advert
Old 06-13-2013, 10:45 AM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
What do you exactly want to colour?

The source code? You need some editor with syntax (or ad-hoc) highlight/colouring.

The rendered text? Just add "color: #AA0000;" or whatever to the the CSS class.
Jellby is online now   Reply With Quote
Old 06-13-2013, 11:42 AM   #7
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Nothing stopping you from creating .green, .yellow classes in the stylesheet, if you want to color the text displayed in the final document. See
http://www.w3schools.com/CSSref/pr_text_color.asp
for details. Click the try it yourself button to see how changes will look prior to committing it to your document, if you are uncertain.

BUT for those of us with e-ink readers, please preview in one. Some orange will just disappear completely against grey, etc.

If you just want to color your code for easier readability see my previous text.
mrmikel 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
Troubleshooting K3 KB not fully refreshing, pixelated text, some inverted colors kibbler1138 Amazon Kindle 7 01-09-2013 02:08 PM
Increase Performance of Edit/Assign to Tags convexdezign Library Management 9 04-28-2011 03:10 PM
Assign multiple books to a collection NLight95 Library Management 1 03-31-2011 09:20 PM
PRS-600 Is it possible to assign books to folders designated to various genres? BryanDanielson Sony Reader 6 01-10-2010 01:47 PM
How do you assign categories?? mrsp Fictionwise eBookwise 5 12-20-2007 12:20 PM


All times are GMT -4. The time now is 04:28 AM.


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