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

In summary, you will need to format the ebook itself in html in order to make it reflow based on screen size.
  • #1
christian0710
409
9
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
  • #2
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
  • #3
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?
 
  • #4
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.
 
  • #5
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.
 

1. What is HTML, PHP, and CSS code?

HTML, PHP, and CSS are coding languages used to create and design websites. HTML (Hypertext Markup Language) is used for creating the structure and content of a webpage. PHP (Hypertext Preprocessor) is a server-side scripting language used for creating dynamic web pages. CSS (Cascading Style Sheets) is used for designing and styling the visual layout of a webpage.

2. How do I properly format an eBook with HTML, PHP, and CSS code?

To properly format an eBook, you will need to have a good understanding of HTML, PHP, and CSS coding. You will need to use HTML to structure the content of your eBook, PHP to add dynamic elements, and CSS to style the layout and design. It is important to follow the proper syntax and coding conventions for each language to ensure your eBook is formatted correctly.

3. Can I use HTML, PHP, and CSS code in an eBook?

Yes, you can use HTML, PHP, and CSS code in an eBook. These coding languages are commonly used to create digital books and other online publications. However, it is important to note that not all eBook formats support these languages, so it is best to check the specific requirements for the platform you are publishing on.

4. Are there any special considerations for formatting an eBook with HTML, PHP, and CSS code?

Yes, there are a few special considerations to keep in mind when formatting an eBook with HTML, PHP, and CSS code. Firstly, make sure to use responsive design techniques so that your eBook can be easily viewed on different devices. Secondly, consider the file size of your eBook and optimize your code to keep it as small as possible for faster loading times. Lastly, test your eBook on different devices and platforms to ensure it is displaying correctly.

5. Where can I learn more about HTML, PHP, and CSS code for eBook formatting?

There are many online resources available for learning HTML, PHP, and CSS code for eBook formatting. You can find tutorials, courses, and forums dedicated to these coding languages. Additionally, many eBook publishing platforms offer support and resources for formatting eBooks with HTML, PHP, and CSS code.

Similar threads

  • Programming and Computer Science
Replies
3
Views
320
  • Computing and Technology
Replies
8
Views
2K
  • Feedback and Announcements
2
Replies
38
Views
4K
  • Programming and Computer Science
Replies
4
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
275
Replies
2
Views
1K
  • General Discussion
Replies
3
Views
1K
  • Beyond the Standard Models
Replies
2
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Back
Top