![]() |
#1 |
Zealot
![]() Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
|
How to convert to an Epub file without css and class?
I hope that the converted epub file does not contain any format other than html tags, that is, no class and css. What should I do?
|
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,057
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Just Convert and see
![]() Most browsers (book viewers) have built in defaults for common tags. If you don't like what you see, then add a CSS to put your spin on the tag. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
If the eBook has inline styles, then those will be converted to CSS and can be edited from there as needed.
|
![]() |
![]() |
![]() |
#4 |
Zealot
![]() Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
|
What I mean is, for example, when I convert a txt/markdown file to Epub by Calibre, class and css will be added by Calibre. Is there a opinion in Calibre that I can use to convert to a Epub without css and class?
|
![]() |
![]() |
![]() |
#5 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Why do you want an ePub with no CSS? The defaults are not all good. You do need CSS to fix up some of the defaults.
You really should not be trying to do ePub with no CSS. It just isn't a good idea. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,210
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Why bother converting then? The use of classes and stylesheets is what makes epub worthwhile.
|
![]() |
![]() |
![]() |
#7 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,587
Karma: 14328510
Join Date: Nov 2019
Device: none
|
If necessary you could open the epub in Calibre's editor and delete the css file. There might be class= stuff in the html but they won't have any effect since there isn't a css file.
|
![]() |
![]() |
![]() |
#8 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,210
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Code:
<style> @font-face {font-family: 'Shift Light'; font-style: normal; font-weight: bold; src: url('../Fonts/Shift-Bold.otf');} @font-face {font-family: 'Shift Light'; font-style: italic; font-weight: bold; src: url('../Fonts/Shift-BoldItalic.otf');} div {margin: 0; padding: 0; line-height: inherit; text-indent: 0;} h1 {font-size: 1.5em; text-align: center; margin: 0 0 1em 0; font-weight: bold; font-style: italic; line-height: inherit; text-indent: 0; font-family: 'Shift Light', Palatino, 'Palatino Linotype', 'Palatino LT STD', 'Book Antiqua', Georgia, serif;} p {text-align: center; text-indent: 0; margin: 1em 0 0 0; font-family: 'Shift Light', Palatino, 'Palatino Linotype', 'Palatino LT STD', 'Book Antiqua', Georgia, serif;} .center{text-align: center;} .x-small {font-weight: bold; font-size: 1em; margin: 0; padding: 0;} .image_h12{font-size: 1em; height: 12em; max-width: 100%;} a, a:link, a:visited, a:hover, a:active {font-weight: bold; font-size: 1.2em; color: #fa6400; text-decoration: underline;} .rule {font-size: 1em; margin: 1.2em 5% 0 5%; border-top: 1px solid #636363;} </style> Last edited by DNSB; 05-12-2021 at 05:09 PM. |
|
![]() |
![]() |
![]() |
#9 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
What's the point of an ePub with no CSS?
|
![]() |
![]() |
![]() |
#10 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
|
Saved searches - I actually use all these on some files:
<div.*?> replace with nothing <span.*?> replace with nothing <a.*?> replace with nothing id=".*?" replace with nothing <p.*?> replace with <p> That gives you a pretty unstyled document in a few seconds. |
![]() |
![]() |
![]() |
#11 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,587
Karma: 14328510
Join Date: Nov 2019
Device: none
|
|
![]() |
![]() |
![]() |
#12 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#13 |
Zealot
![]() Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
|
|
![]() |
![]() |
![]() |
#14 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,587
Karma: 14328510
Join Date: Nov 2019
Device: none
|
There's also the thing where you can have css in the head. But the OP said he's converting from text/markdown with calibre. Does Calibre add in-line styles inside the resulting html/xhtml files?
|
![]() |
![]() |
![]() |
#15 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
So why don't you want any CSS in the epub? Calibre won't convert a book without generating a basic CSS. But, you can remove or replace it. If you remove it, you are completely dependent on how what you are reading it with decides to style the tags.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Converting ePub to Mobi reducing margin-top on CSS class | battle_brother | Conversion | 4 | 06-20-2019 08:31 AM |
Convert Several Html and Css files into one Epub File? | MarjaE | Editor | 3 | 04-04-2017 03:20 PM |
add css file to epub conversion | VICTORSJG | Calibre | 0 | 09-21-2011 07:38 AM |
epub.css file in OpenInkpot | cloggy | OpenInkpot | 1 | 11-09-2010 07:28 PM |
How can i convert HTML or txt file to EPUB file ? | guguqiaqia | ePub | 7 | 05-28-2010 09:15 PM |