View Full Version : How do I assign different colors to different sections of text?

06-12-2013, 12:20 PM
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]

06-12-2013, 01:18 PM
Color in bookview can be done via CSS. Change of color in codeview is not possible.

06-12-2013, 01:57 PM
If it is important to you, you can right click to open your text in an external editor which does have this capability.

06-13-2013, 10:56 AM
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?

06-13-2013, 11:32 AM
In notepad++, you can get a similar effect by choosing Language, flash actionscript.

06-13-2013, 11:45 AM
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.

06-13-2013, 12:42 PM
Nothing stopping you from creating .green, .yellow classes in the stylesheet, if you want to color the text displayed in the final document. See
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.