- Find broken stylesheet links, selector mismatches, and inline CSS overrides.
- Use Live CSS and Inspect to identify the winning rule.
- Refresh, save, and test the exact edited book format.
- Confirm the Symptom With a Small Safe Test
- Verify That the Correct Stylesheet Is Linked
- Find the Rule That Is Overriding Your CSS
- Check Whether the Selector Matches the Book's HTML
- Check Missing Resources and Invalid References
- Refresh the Preview and Open the Saved Book Correctly
- Make Sure You Are Editing and Opening the Same Book Format
- Account for Reader and Device Limitations
- Use Diagnostics Only When the Basic Tests Fail
- Run a Clean Temporary Test Before Reinstalling
- Quick Fix Checklist
- Frequently Asked Questions
You change a rule in calibre's Edit book tool, wait for the preview to update, and nothing seems to happen. This usually does not mean calibre is broken. In most cases, the HTML file is linked to a different stylesheet, a more specific rule is winning, an inline style is overriding your change, the selector does not match the intended element, or the viewer is displaying an older copy of the book.
The fastest way to solve the problem is to make one unmistakable test change, identify the exact element and stylesheet involved, and follow the CSS cascade rather than changing several unrelated settings. The steps below apply to Windows, macOS, and Linux and focus specifically on CSS inside calibre's e-book editor.

Start with free Canva bundles
Browse the freebies page to claim ready-to-use Canva bundles, then get 25% off your first premium bundle after you sign up.
Free to claim. Canva-ready. Instant access.
1. Confirm the Symptom With a Small Safe Test
Before investigating complex selectors, confirm whether any CSS change can reach the page you are viewing. Create a checkpoint in Edit book first so that you can reverse the test cleanly. Then open the HTML chapter where the problem appears and identify a visible element, such as a paragraph or heading.
Add a temporary rule to a stylesheet you believe is connected to that chapter:
body { background-color: #fff3a6 !important; }
p { color: #c00000 !important; }Pause typing for a moment because the live preview normally updates only after you stop entering text. A pale background or red paragraphs should be obvious. The use of !important is appropriate for this short diagnostic test because it helps determine whether another ordinary declaration is winning. It should not automatically become part of the permanent fix.
1.1 What the test result means
- Neither change appears: The HTML file probably does not load that stylesheet, live preview may be disabled, or you are viewing a different content file.
- The background changes but paragraph text does not: A stronger paragraph rule, inline style, or viewer-level rule may be taking precedence.
- The preview changes but the saved book does not: The edit may not have been saved, or the viewer or device may have an older copy.
- Only some paragraphs change: Those elements probably use different classes, inline declarations, or more specific selectors.
Once the result points to a failure category, stop making broad changes. Remove the diagnostic rule and investigate that category directly.
2. Verify That the Correct Stylesheet Is Linked
An EPUB or similar reflowable e-book can contain many HTML files and several stylesheets. A stylesheet listed under Styles in the file browser is not necessarily applied to every chapter. Each HTML file normally needs its own valid reference to the relevant CSS resource.
2.1 Inspect the HTML link element
Open the affected chapter and look near the top of the document for a link similar to this:
<link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css"/>Confirm that the filename and relative path point to the stylesheet you edited. Paths are relative to the location of the HTML file. If the chapter is in a Text folder and the CSS file is in a Styles folder, the reference may need to move up one directory before entering Styles.
Calibre helps identify broken internal references. A missing target may be visibly marked in the code editor, and you can use the editor's link-related tools to move between a reference and its destination. You can also select HTML files in the file browser, right-click, and use Link stylesheets to add the correct stylesheet efficiently.
Success means the temporary test rule affects the selected chapter after the link is corrected. At that point, do not relink every stylesheet in the book unless other chapters have the same problem. Multiple active stylesheets can create additional conflicts.
2.2 Check for chapter-specific stylesheets
Some books deliberately use one stylesheet for front matter, another for chapters, and another for special pages. Compare the affected HTML file with a chapter where your CSS works. If their link elements differ, edit the stylesheet actually used by the problem chapter or link the intended shared stylesheet to it.
Also search for embedded <style> blocks in the HTML. A page-level style block may contain rules that override the external file. The presence of both is valid, but you must account for their order and specificity.
3. Find the Rule That Is Overriding Your CSS
When a stylesheet is connected but a particular property does not change, the cause is usually the CSS cascade. The winning declaration may be more specific, appear later, carry !important, or be attached directly to the HTML element.
3.1 Look for inline styles
An inline style appears inside the element itself:
<p class="body-text" style="margin-left: 2em; text-align: left;">A general rule such as p { margin-left: 0; } will not normally override that inline margin. The cleanest fix is usually to remove the unwanted property from the inline style or convert repeated inline formatting into a reusable class.
Search the book for the property you are trying to change, such as margin-left, font-size, or text-align. Search both HTML and CSS files. This is often faster than guessing which selector is responsible.
3.2 Compare selector specificity
Suppose you add this rule:
p { text-indent: 0; }It may lose to a more specific existing rule:
body.calibre .chapter p.body-text { text-indent: 1.2em; }Instead of adding increasingly complicated selectors at random, target the actual class:
p.body-text { text-indent: 0; }If that still loses, determine where the winning declaration is defined. Calibre's Live CSS panel is designed for this job. Enable it from View > Live CSS, select the relevant tag, and review the matching and calculated styles. Superseded properties are shown as overridden, and links can take you to the rule's definition.
3.3 Use Inspect-like reasoning
You do not need to be a developer to reason through an element inspection. Right-click the problem area in the preview and choose Inspect. Then answer four questions:
- What HTML tag is this, such as
p,h2, ordiv? - Which classes are attached to it?
- Which rules match it?
- Which declaration is crossed out or replaced by a higher-priority value?
The inspector can be used to experiment with styles, but experimental changes made there do not necessarily modify the book's files. Once you identify the correct property, make the permanent change in the HTML or stylesheet editor.
4. Check Whether the Selector Matches the Book's HTML
A valid CSS rule has no effect if it does not match any element. This commonly happens when a book uses generated class names, inconsistent capitalization, or different classes in different chapters.
For example, this rule matches only paragraphs carrying the exact bodytext class:
p.bodytext { line-height: 1.5; }It will not match any of these:
<p class="body-text">
<div class="bodytext">
<p class="BodyText">Copy the class name directly from the affected HTML rather than typing it from memory. Remember that .note p means a paragraph inside an element with the note class, while p.note means a paragraph that itself has that class.
4.1 Test the selector separately from the property
Temporarily give the selector an obvious outline:
p.body-text { outline: 3px solid magenta !important; }If the outline appears around the intended paragraphs, the selector matches and you can investigate the original property. If it does not appear, correct the selector before changing anything else. Remove the outline after the test.
Calibre also provides tools for finding unused CSS. Use them carefully. A rule reported as unused is a strong clue that its selector does not match the current content, but do not perform a mass removal until you have created a checkpoint and reviewed the proposed changes.
5. Check Missing Resources and Invalid References
CSS can appear to fail when it depends on a missing font, image, or imported stylesheet. A rule may be loaded correctly while one of its values cannot be rendered.
5.1 Review imported stylesheets and fonts
Search CSS files for @import, @font-face, and url(...). Verify that every referenced file exists inside the book and that the relative path is correct. Pay special attention after renaming or moving files outside calibre, because manual file operations can leave old paths behind.
Run calibre's Check book tool and review errors involving missing files, broken links, malformed CSS, or font declarations. Fix the first relevant structural error, rerun the check, and test again. One broken brace or malformed rule can sometimes cause later declarations in the same block to be ignored.
Success means Check book no longer reports the relevant missing reference and the resource appears in preview. If a font still differs only on a physical reading device, test a basic property such as color or spacing before concluding that the entire stylesheet is failing.

6. Refresh the Preview and Open the Saved Book Correctly
The editor preview, calibre E-book viewer, Content server, and a connected reading device are separate display environments. A change visible in one may not immediately appear in another.
6.1 Refresh the editor preview
Confirm that live preview has not been disabled using the controls beneath the preview panel. Stop typing and allow a moment for the preview to update. If necessary, move to another HTML file and return, or close and reopen the preview.
Make sure the preview is showing the chapter you edited. Long books can contain nearly identical title pages, chapter templates, or duplicated text files. Click the relevant HTML file in calibre's file browser rather than relying only on the current reading position.
6.2 Save before testing in the viewer
The preview can display unsaved editor changes, but another application needs the saved book. Use File > Save, close or reload the copy already open in the E-book viewer, and then test again. The viewer provides a reload-book command, and its command-line interface also includes a force-reload option.
If viewer preferences contain a user stylesheet, it may override some book styles. Temporarily disable only the viewer style relevant to the failing property. Do not reset every viewer preference unless a controlled test proves the viewer is responsible.
Success means the saved book shows the same test change after a reload. Stop changing the book's CSS if the editor preview and a freshly reloaded viewer both display it correctly.
7. Make Sure You Are Editing and Opening the Same Book Format
A calibre library record can contain EPUB, AZW3, KEPUB, PDF, and other formats at the same time. Editing the EPUB does not alter a separate AZW3 or PDF stored under the same title. Similarly, converting the original source again may create a new output that does not contain your manual edits.
Verify the format shown in Edit book, save it, and open that exact format for testing. If you send a book to a device, confirm which format calibre selected for transfer. Remove the old test copy from the device before sending the edited one again if the device keeps its own imported copy.
Avoid repeatedly converting the book while troubleshooting an editor CSS problem. Conversion can transform styles, add generated classes, apply Extra CSS, or filter style information. First prove the manual edit works in the edited format. Convert only afterward if another format is required.
8. Account for Reader and Device Limitations
The calibre preview is useful, but it is not identical to every e-reader. A device may apply publisher-style controls, user font settings, margin preferences, night mode rules, or limited support for particular CSS properties.
If the CSS works in Edit book and in calibre's viewer but not on a device, test a simple rule such as a text color or border. Then check the device's reading settings for options that replace publisher fonts, alignment, margins, line spacing, or themes. Send a newly saved copy and verify that the device opened the replacement rather than an older cached import.
Cloud storage can create a similar mismatch. If the calibre library or exported book is synchronized through a cloud service, wait for synchronization to complete and confirm the file's modification time. Avoid letting two computers edit the same library file simultaneously. Operating system permissions are relevant only if calibre cannot save the book or reports a file-access error. They do not normally explain why one valid CSS property loses to another.
9. Use Diagnostics Only When the Basic Tests Fail
Most cases of calibre Edit book CSS not applying can be solved with stylesheet links, Live CSS, Inspect, Check book, and a forced viewer reload. Debug tools become useful when the editor does not refresh, saving fails, the same valid test behaves differently in every book, or calibre closes unexpectedly.
Start calibre in debug mode and reproduce the problem once. Review the output for file-access errors, plugin failures, or editor exceptions. A CSS rule merely being overridden will not usually create a useful debug message, so do not treat an empty log as evidence that the cascade is correct.
Temporarily disable recently added plugins only if the problem affects the editor interface or saving process. Plugins are unlikely to explain why a selector fails in one chapter while other CSS in the same book works.
10. Run a Clean Temporary Test Before Reinstalling
Do not reinstall calibre, delete your library, or reset every preference as an early troubleshooting step. Those actions do not fix a broken stylesheet reference or an overridden declaration.
Instead, make a temporary duplicate of the affected book and perform this controlled test:
- Create an editor checkpoint.
- Open one ordinary chapter.
- Confirm which stylesheet that chapter links.
- Add one unique test class to a paragraph.
- Add a matching high-visibility rule to the linked stylesheet.
- Wait for preview, save, and reload the exact format in the viewer.
For example:
<p class="css-test">Temporary test paragraph</p>
p.css-test {
color: blue !important;
border: 2px solid blue !important;
}If this works, calibre's editor and renderer are functioning. The original problem is in the book's selectors, cascade, references, or resources. Remove the test and repair the narrow cause. If it fails even though Live CSS shows the rule attached to the correct element, try a small known-good book or a temporary clean calibre configuration before considering reinstallation.
11. Quick Fix Checklist
- Save a checkpoint before changing several files.
- Add one obvious temporary CSS test.
- Confirm the preview is showing the affected HTML file.
- Verify that the HTML links to the stylesheet you edited.
- Check for embedded style blocks and inline declarations.
- Use Live CSS to identify the winning property.
- Inspect the element and copy its exact class name.
- Test the selector with a temporary outline.
- Run Check book for missing resources and malformed CSS.
- Save before opening the book in another viewer.
- Reload the viewer instead of trusting an already open copy.
- Confirm you edited and opened the same book format.
- Resend a fresh copy before troubleshooting the reading device.
- Use debug mode only for editor, saving, plugin, or file-access failures.
12. Frequently Asked Questions
12.1 Why does my CSS work in one chapter but not another?
The chapters may link to different stylesheets or use different classes. Compare their <link> elements and inspect the affected HTML tags. Apply the rule to the stylesheet and selector actually used by the second chapter.
12.2 Why does adding !important make the rule work?
Another declaration was probably winning through specificity, source order, inline styling, or its own !important flag. Use Live CSS to locate that declaration. Then fix the conflict cleanly and remove unnecessary diagnostic flags.
12.3 Why does the editor preview change but the E-book viewer does not?
The edited book may not have been saved, or the viewer may still have an older copy open. Save the book and reload it. Also confirm that the viewer opened the same format you edited.
12.4 Can conversion overwrite my manual CSS edits?
Yes. If you reconvert from an unedited source format, the new output is based on that source and its conversion settings. Finish and save edits in the chosen source format before producing any required output format.
12.5 Should I reinstall calibre when CSS changes are ignored?
Usually not. Reinstallation does not repair selectors, stylesheet links, inline styles, or missing resources inside a book. Use a controlled test in a duplicate book and a temporary clean configuration first.
12.6 When should I stop changing settings?
Stop when the intended rule appears in Live CSS, wins the calculated property, survives saving, and displays after reloading the same book format. If only a physical reader differs after that, troubleshoot the device's style controls and format support rather than changing unrelated calibre settings.