topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday June 2, 2020, 12:26 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: HTML code seems to divide page into 2 columns; why and how to fix?  (Read 327 times)

OptimalDesigns

  • Supporting Member
  • Joined in 2018
  • **
  • Posts: 27
  • retired applied mathematician
    • View Profile
    • Calculus-level Problem Solving; Examples & Compiler
    • Read more about this member.
    • Donate to Member
My HTML code gives a strange response.  After the E-mail </script>, it seems to divide the page into 2 columns, ideas why and how to fix problem?
<h4 style="float:left; padding: 0px 15%">1. E-mail us at <script type="text/javascript"><!--
var name = "aaa"; //
var domain = "goal-driven.net"; //
document.write('<a href=\"mailto:' + name + '@' + domain +
  '?subject=Interest%20in%20...' + '\">');
document.write(name + '@' + domain + '<\/a>');
// --></script></h4>

<!-- problem seems to start here. The 'xxx' lines below show in 'column 2', why and how to fix? The 'zzz' line is okay from there on. -->

<h4 style="float:left; padding: 0px 15%">2. Send us a letter.</h4>
<p style="text-align:center"><b>xxx<br>
xxx<br>
xxx</b></p>

<p>yyy</p>

<h2 style="text-align:center;"><i>zzz</i></h2>

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,656
    • View Profile
    • Donate to Member
The HTML parser in any email client is not nearly as sophisticated as a standard browser is. Better use HTML 4 markup to create/generate messages with HTML styling.

Also, if you think that browsers can be incompatible, because of different HTML/CSS interpretations, you have never tried to send out a HTML newsletter that looks the same in any mail client and/or web-based client like GMail or RoundCube.

You'd better keep it structurally simple, use (nested) tables instead of HTML5 and the least amount of CSS you can get away with. That does keep the layout of your generated HTML message more or less the same between different mail clients.

Yes, I'm fully aware on how the above sounds. Took me hours to design and generate HTML mail messages correctly (using Windows batch script, so you could say I learned this the hard way). Mail is received correctly in the Thunderbird mail client and GMail/RoundCube clients, around 99% of the content shows up correctly in Outlook 2010, Outlook 2013 shows about 95% of the content correctly. Never tried it with newer versions of Outlook.


OptimalDesigns

  • Supporting Member
  • Joined in 2018
  • **
  • Posts: 27
  • retired applied mathematician
    • View Profile
    • Calculus-level Problem Solving; Examples & Compiler
    • Read more about this member.
    • Donate to Member
Thanks for your comments and time.  Found a way around my problem.  Break <br> ... Break ... Break! Problem resolved!

Phil