Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

line breaks with netscape 1

Status
Not open for further replies.

occas

Technical User
Jan 14, 2004
164
US
i have simple code that uses a p {font: 10pt times; }. when i view the page with explorer, no break before text appears. at the very top of page. when i view with netscape, a line break has been created. is this just something you live with?
ty
 
I think we'll at least need to see the code you use for output to help you out.
 
Yes, the code is going to be necessary.

I actually had the exact same problem some time ago. Chances are, your page will not render properly in Opera either. IE tends to be less rigourous than the other browsers in its rendering. (ie: more forgiving of mistakes).

Unfortunately, I can't remember which page it was much less my solution, but there is a solution.

I'm truly sorry for being so vague, but we old farts tend to have memory problems ;).

But I did want to assure you it's not something you have to live with.

I will continue looking for my solution and post it here if someone else doesn't solve it first once you post your code.

RKM
 
Code:
%@ Page Language="VB"  debug="False" %>
<%@ Register TagPrefix=&quot;uc0&quot; TagName=&quot;Header&quot; Src=&quot;Header.ascx&quot; %>
<%@ Register TagPrefix=&quot;uc0&quot; TagName=&quot;wwdmenu&quot; Src=&quot;wwdmenu.ascx&quot; %>
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
&quot;[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;>[/URL]
<html xmlns=&quot;[URL unfurl="true"]http://www.w3.org/1999/xhtml&quot;>[/URL]
<head>
<style>
<!--
p {
font: 10pt times;
}
h5 {
font: 12pt times;
      text-decoration: underline;
}
-->
</style>
</head>
<body bgcolor=&quot;#aead99&quot;>
  <table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; bgcolor=&quot;#aead99&quot;>
      <tr><td><uc0:Header id=&quot;UserControl1&quot; runat=&quot;server&quot;></uc0:Header></td></tr>
  </table>
  <table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; bgcolor=&quot;#aead99&quot;>
      <tr>
         <td width=&quot;100&quot; valign=&quot;top&quot;><uc0:wwdmenu id=&quot;UserControl2&quot; runat=&quot;server&quot;></uc0:wwdmenu></td>
         <td width=&quot;650&quot; valign=&quot;top&quot;>
             <table width=&quot;650&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; bgcolor=&quot;#aead99&quot;>
                <tr>
                   <td><asp:Image id=&quot;homepic&quot; ImageUrl=&quot;homepic.gif&quot; runat=&quot;server&quot;></asp:Image></td>
                </tr>
             </table>
             <table width=&quot;650&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;1&quot; height=&quot;500&quot; bordercolor=&quot;gray&quot; bgcolor=&quot;#ffffff&quot;>
               <tr>
                 <td valign=&quot;top&quot;><p>Hello world</p></td>
               </tr>
             </table>
         </td>
      </tr>
  </table>
</body>
</html>
not much to it. don't know if the <p> is doing it. ty.
 
Default styling for paragraph element is margin at the top and bottom. If you want your text to jump all the way up, just add:

p {
font: 10pt &quot;Times New Roman&quot;, serif;
margin-top: 0px;
}

Also, there is usually no font named times. You need to write complete font name (if it contains multiple words it must be enclosed in quotes) and preferably end the font statement with a generic family (serif, sans-serif, cursive, fantasy, monospace). In your specific case, html document was looking for a font named 'times' and upon not finding it went with default, which incidentally was Times New Roman.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top