I'm new to WindowsXP and the following tag which ran perfectly well in Windows98 doesn't work with XP:

<style type="text/css">
p { text-indent: 1em; margin-top: 0; margin-bottom: 0; }
p.fst { text-indent: 0em; margin-top: 0; margin-bottom: 0; }
</style>

I'd appreciate a simple explanation and remedy - if there's any.

Dani AI

Generated

As discovered (and as suspected), the problem was not Windows XP but malformed HTML: an attribute mix-up that some browsers tolerate and others do not. The style attribute is for inline CSS declarations like property: value; — it does not name a CSS class. Class names belong in the class attribute, and attribute values should be quoted for predictable parsing.

Browsers and ebook converters handle invalid markup differently. Missing quotes, using deprecated tags like <font>, or omitting a DOCTYPE can force "quirks" behavior or cause stricter parsers (often used by ebook tools) to ignore intended rules. Converting HTML to an ebook format frequently exposes these issues because converters often require valid HTML or XHTML.

Checklist for a reliable fix and cleaner output:

  1. Use class="name" to apply a CSS class; use style="..." only for actual inline declarations.
  2. Quote all attribute values (e.g., class="lead", align="justify").
  3. Add a modern DOCTYPE (for predictable layout use <!DOCTYPE html>).
  4. Remove deprecated tags (replace <font> with CSS).
  5. Validate markup with the W3C Markup Validation Service.
  6. Re-run the ebook conversion after fixing markup and test in the target reader.

Example (different names from the thread) showing the correct approach:

<style>
p { margin: 0 0 1em; text-indent: 1em; }
.lead { text-indent: 0; }
</style>

<p class="lead" align="justify">First paragraph of a chapter, not indented.</p>
<p align="justify">Second paragraph, indented normally.</p>

These steps clarify why the same file could behave differently on two machines and make the HTML robust for browsers and ebook tools. For markup validation, see W3C Markup Validation Service.

Recommended Answers

All 5 Replies

I think it'll be the browser version, not the version of windows, which is causing you problems. That is, IE5 or 5.5 on the 98 machine, and 6 on the XP machine?

There's no real reason why it should stop working.
What code are you using with it, and what do you intend it to look like?

I understand it's a browser problem, but I also used IE6 on Windows98. Anyway, I use these html pages to build MSebooks (using ReaderWorks) for myself. style tag is generally for making first line of a chapter unindented.
Here's what I do:
<html>
<head>
<title>Pagan and Christian Creeds</title>
<style type="text/css">
p { text-indent: 1em; margin-top: 0; margin-bottom: 0; }
p.fst { text-indent: 0em; margin-top: 0; margin-bottom: 0; }
p.note { text-indent: 0em; margin-top: 3; margin-bottom: 3; }
</style>
</head>

<body>

<p style="page-break-before:always">

<br><br><br><center><font size=2>INTRODUCTORY</font></center><br><br>
<p style=fst align=justify><font size=2>THE SUBJECT</font> of Religious Origins is a ...
<p align=justify>There is also in these matters ...

</body>
</html>

Apparently the browser doesn't see <p style=fst align=justify> tag and the line appears with 1em indent on html page and of course in the ebook.

Thanks a lot for your prompt reply. I don't know if above information is enough to give you a better idea.

I'm so much ashamed and terribly sorry!
I guess I worked too much.

Does that mean you've spotted your style should be a class?

We all have those moments...

Yes, I realized it seconds after I had posted my reply to you. I am really very sorry. Thank you so much for your patience and consideration.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.