HTML/CSS HTML, php and css code in ebook, proper formatting?

Click For Summary
Writing an ebook on CSS, HTML, and PHP using MS Word may lead to formatting issues, as Word documents do not reflow well on different screen sizes. Instead, utilizing HTML and CSS for ebook formatting is recommended to ensure proper display across devices. However, challenges exist, such as the lack of support for the <pre> tag in Kindle, which complicates code formatting. Learning LaTeX could be beneficial for those unfamiliar with ebook publishing, as it offers better control over formatting. Overall, understanding HTML and CSS is crucial for creating a well-formatted ebook.
christian0710
Messages
407
Reaction score
8
Hi, I want to write an ebook on CSS, HTML and php, and I'm using a RTF copy/paste plugin to my code editor so i can copy and paste code directly into MS Word from my code editor.

I'm just wondering: Can i write the whole book in MS Word and then directly upload it to amazon, for ebook readers, or what would i need to get or do in order to assure proper formatting for the ebook readers?

I'm using Verdana font for the text and for the and copy paste code the default is Curier new.
 
Technology news on Phys.org
I don't think MS Word will do a good job. MS word documents aren't designed to reflow based on the size of the screen. Why not use HTML and CSS?
 
  • Like
Likes christian0710
Khashishi said:
I don't think MS Word will do a good job. MS word documents aren't designed to reflow based on the size of the screen. Why not use HTML and CSS?

That's very nice to know. I know a lot about html and css but very little about ebook publishing. How can CSS and HTML help me make an ebook that reflows based on screen size?
 
Ok, I don't actually know anything about ebook publishing, but it looks like you can format the ebook itself in html.
http://webdesign.about.com/od/mobi/a/html-for-kindle.htm
Unfortunately, it says pre is not supported by kindle, so you'll have to figure out some way of formatting code.
 
Khashishi said:
Ok, I don't actually know anything about ebook publishing, but it looks like you can format the ebook itself in html.
http://webdesign.about.com/od/mobi/a/html-for-kindle.htm
Unfortunately, it says pre is not supported by kindle, so you'll have to figure out some way of formatting code.

Thank you for the reply, I might have to learn latex, seems like there is scarce guidance on proper formatting for ebook publishers who want to publish code language.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 38 ·
2
Replies
38
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 13 ·
Replies
13
Views
4K