HTML Help indenting first line in <dd>

1.6k Views Asked by At

I'm creating an HTML Help file (yeah, yeah, I know it's old fashioned but Microsoft has yet to provide a newer replacement).

When I open the file in a normal browser, the text appears how I expect. But when I open the file in the HTML help viewer, the first line within each <dd> element is indented, which I don't want.

enter image description here

Here's my CSS file.

body 
{
  color: #111;
  font-family: Arial, Helvetica, Sans-Serif;
  font-size: 12px;
}
dt {
  font-weight: bold;
  margin-top: 8px;
  margin-bottom: 8px;
}
dd {
  margin-left: 18px;
}
pre {
  color: blue;
}

And here's part of my HTML.

<!doctype html public "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="Content-Type" Content="text/html; charset=Windows-1252">
<title>CYGNUSSTATEINFO Structure</title>
<link href="Style.css" rel="stylesheet" type="text/css" />
</head>

<h1>CYGNUSSTATEINFO Structure</h1>

<p>
The CYGNUSSTATEINFO structure contains information about the current state and settings of the Cygnus application. This information may be useful for programming extensions that need more information about the data being processed. This structure contains the following members.
</p>

<dt>HWND hCygnusWnd</dt>
<dd>
A handle to the main Cygnus window.
</dd>

<dt>LPWSTR lpszCurrFile</dt>
<dd>
A Unicode string that specifies the name of the current file being edited. Note that this member is for display purposes only and does not contain a fully qualified path.
</dd>

<dt>int nStartOffset</dt>
<dd>
Specifies the offset of the start of any selection. This may be useful when it is necessary to know the offset of the data being processed. This member is zero if there is no selection associated with the current task.
</dd>

<dt>int nBytesPerRow</dt>
<dd>
Specifies the current number of bytes per row.
</dd>

<dt>int nOffsetRadix</dt>
<dd>
Specifies the current offset radix. This is the notation used to show the offset of each row. It will be 16 for hexadecimal, 10 for decimal.
</dd>

<dt>int nGroupBy</dt>
<dd>
Specifies the number of bytes per group in the hex portion of the display. This value is one if there is no byte grouping.
</dd>

<!-- Etc.... -->

</body>
</html>

Can anyone understand why the first line is being indented here? I've tried setting text-indent: 0 with no success. I also tried changing the DOCTYPE to <!doctype html>, but nothing changes this.

2

There are 2 best solutions below

1
On BEST ANSWER

Add the following statement to the <head> section of all your HTML files. This works if the HTML topic files are encapsulated in a .chm help file.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11"/>

e.g.:

<!doctype html public "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="Content-Type" Content="text/html; charset=Windows-1252">
<title>CYGNUSSTATEINFO Structure</title>
<link href="Style.css" rel="stylesheet" type="text/css" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11"/> 
</head>

enter image description here

For further information have a look at our FAR HTML knownledge base CSS3 in FAR Browser

and Rick Strahl's Web log Make your CHM Help Files show HTML5 and CSS3 Content

5
On

You can add text-indent:0; to the CSS rule for dd, and maybe also try to add !important if it doesn't work as is.

If that doesn't work, it might be due to specifity (a more complex selector overriding it).

You could also

  1. Try to use inline styles in the HTML, like <dd style="text-indent: 0;"> A handle ...

  2. Try to use a more specific CSS selector in your stylesheet, like body dt dd {...}

By the way: I just saw that - at least in your example code above - you don't have a body tag...