Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 01-07-2026, 08:04 AM   #1
Urnoev
Junior Member
Urnoev began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Mar 2024
Device: Kobo Libra 2
Stylesheet/CSS syntax highlighting: green text for invalid properties?

Hello,

I am editing an ebook with Calibre and have a question regarding the syntax highlighting of CSS code / stylesheets.

Properties are usually highlighted with blue text, but some are displayed with green text.

For example:

Code:
.box {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  word-wrap: break-word;
}
Does this difference have any significance?
Maybe the properties highlighted in green are invalid/unsupported for epub files? Or is it because of a CSS version difference?

The property does exist and works fine, even in the Calibre editor preview.

Thanks!
Urnoev is offline   Reply With Quote
Old 01-07-2026, 03:15 PM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,739
Karma: 9501032
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
I thought word-wrap was deprecated or non-standard.
Try overflow-wrap... https://developer.mozilla.org/en-US/.../overflow-wrap

You can also use <wbr/> and insert that where you want the break to occur. eg...
This<wbr/>isa<wbr/>long<wbr/>sentence
Karellen is offline   Reply With Quote
Advert
Old 01-07-2026, 10:08 PM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 81,527
Karma: 150265873
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Karellen View Post
I thought word-wrap was deprecated or non-standard.
Try overflow-wrap... https://developer.mozilla.org/en-US/.../overflow-wrap

You can also use <wbr/> and insert that where you want the break to occur. eg...
This<wbr/>isa<wbr/>long<wbr/>sentence
<wbr/> does nothing in calibre, Throium, and ADE. So I suggest ignoring it as it doesn't work well enough.
JSWolf is offline   Reply With Quote
Old 01-07-2026, 10:19 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,837
Karma: 28586150
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
word-wrap is deprecated and non-standard. Use overflow-wrap
kovidgoyal is offline   Reply With Quote
Old 01-09-2026, 02:50 AM   #5
Urnoev
Junior Member
Urnoev began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Mar 2024
Device: Kobo Libra 2
Thank you all, I will use overflow-wrap instead.

But word-wrap was only an example and my question is rather what the green highlighting's meaning is.
Urnoev is offline   Reply With Quote
Advert
Old 01-09-2026, 03:00 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,837
Karma: 28586150
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It's meaning in that context is its not a recognized property name
kovidgoyal is offline   Reply With Quote
Reply

Tags
css, stylesheet, syntax


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code syntax highlighting banana8281982 Editor 3 07-25-2024 11:48 AM
pagestyle.css extra / integrated in stylesheet.css / or not at all? chaot Workshop 14 02-25-2017 12:10 AM
Missing CSS properties roger64 KOReader 0 06-01-2016 07:39 AM
Syntax Highlighting extra feature jackie_w Editor 4 12-23-2013 04:33 AM
Invalid Syntax Error msprang Sony Reader 7 11-07-2009 02:11 PM


All times are GMT -4. The time now is 11:39 PM.


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