Creating a new template in HTML

Friends, hello from The Other Side of the Plague. It’s been awhile and I need your expert guidance once again. I used to post here as ‘semicolon’ — an error on my part when I first registered years ago because on literally every other technical forum I am known as ‘semicodin’: an artful play intended to convey that I have reduced skill when it comes to codin’! Coot still here? I see Paul is (thank God!) and for your benefit Maestro this old Semi-talented Sitepoint Member TIDIED (and did so manfully).

I have to warn you: The code I’m uploading is . . . intricate, so I’m also uploading graphics of both the output and (most importantly) what it is SUPPOSED to look like. I’m also uploading a fancy little ampersand graphic (the only IMG used in this project) for use in testing my code. And let me say this:

I would never attempt something this ambitious as HTML but my infernal Library upgraded from Windows 7 to Windows 10 — quite possibly the most universally-loathed OS _on the planet_semicodin

m locked out of accessing my templates (done in Adobe PageMaker, InDesign & Acrobat Professional) on DVD media because WIN10 can’t read the disks. The three hours I wasted on this is enough: I’m going pure HTML & CSS on this because I never want to be placed in this situation ever again. These templates are extremely important (for reasons I won’t go into) and I need to get them rendered as close to their Adobe originals as can be practical for HTML. Farewell Adobe; Hello HTML.

Friends I’m in a nursing home following a complete hip replacement w/post-op complications and doing this on my SmartPhone which is not as bad as you might think! with a little Android App (regrettably titled “Photo Editor” but whatever lol). The code I’m uploading is the first page of a letter with a 2-Column opening and vertical spacing to accommodate two little USPS Stickers. I’ve floated, blocked, aligned, overflowed, and collapsed until I’m blue in the face and this is as far as I’ve been able to get. I’ve tried to be as helpful as I can with the graphic of what it is supposed to look like and I’m extremely proud that I was able to cough up the Rounded-Corners Box (and more miraculous, the table cells inside it, with both left and right aligned cells) but, as with everything about this project, almost nothing is positioned correctly and much of the text is missing important bordering and size features.

I’ll leave it there and thank you as always for your patience and unrivaled skill. What a life eh? As Freud would say: “If it isn’t one thing, it’s your mother.”

semicodin

I hope I can post this (?) . . .

━ ━ ━ ━ ━ ━ ━ ━ ━ ━

Semicodin’s LETTER w/2-COLUMN HEADER
BODY {
    font-size: 18px;
    line-height: 18px;
    font-family: 'SLAB SERIF', SANS-SERIF;
    margin-left: 4%;
    margin-right: 4%;
    margin-top: 50px;
    margin-bottom: 50px;
    width: 100%;
    overflow: hidden;} 

.ROUND {
    float: LEFT;
    margin-left: 45%;
    margin-right: 4%;
    border-radius: 25px;
    border: 10px SOLID BLACK;
    padding: 10px;
    width: 55%;
    height: AUTO;}

.TOFROM {
    text-align: LEFT;;
    color: #8D8D8D;
    font-size: 28px;
    line-height: 28px;}

.USPS {
    font-size: 16px;
    line-height: 16px;
    font-family: SLAB SERIF, MONOSPACE;
    color: DODGERBLUE;
    text-decoration: UNDERLINE;
    text-align: LEFT;
    margin-top: 20px;
    margin-bottom: 100px;}

.FANCYAMP {
    display: BLOCK;
    text-align: CENTER;
    padding: 100px;
    margin-left: AUTO;
    margin-right: AUTO;}

.LITTLE {
    font-size: 16px;
    line-height: 16px;
    font-family: SLAB SERIF, MONOSPACE;
    color: DODGERBLUE;
    text-align: LEFT;
    margin-top: 10px;
    margin-bottom: 20px;}

.BIGBOLD {
    font-size: 22px;
    line-height: 22px;
    font-weight: BOLD;
    font-family: SLAB SERIF, SANS-SERIF;
    color: BLACK;
    text-align: LEFT;
    margin-top: 10px;}

.ADDRESSEE {
    font-size: 18px;
    line-height: 18px;
    font-family: SLAB SERIF, SANS-SERIF;
    color: BLACK;
    text-align: LEFT;}

TABLE .RIGHT {
    margin-right: 5px;
    text-align: RIGHT;
    color: #8D8D8D;
    font-size: 22px;
    line-height: 22px;}

TABLE .LEFT {
    text-align: LEFT;
    color: BLACK;
    font-size: 22px;
    line-height: 22px;}

.GROOVY {
    display: BLOCK;
    border-top: 20px GROOVE RED;
    width: 100%;
    text-align: CENTER;
    margin-top: 50px;
    margin-bottom: 10px;}

.NOLOBIG {
    display: INLINE-BLOCK;
    font-weight: BOLD";
    font-size: 16px;
    line-height: 12px;
    font-family: NoloSerifBold-Italic, Serif;
    color: BLACK;
    text-align: CENTER;}

.NOLO {
    margin: 30px 10% 5px 10%; 
    font-size: 12px;
    line-height: 12px;
    font-family: NoloSerif-Italic, Serif;
    color: BLACK;
    text-align: CENTER;}

</style>
</head>
<body>
    <div class="TOFROM">
        TO:
    </div>
    <div class="USPS">
        USPS USPS/
    </div>
    <div class="BIGBOLD">
        BIGBOLD<br>
        BIGBOLD
    </div>
    <div class="ADDRESSEE">
        ADDRESSEE<br>
        ADDRESSEE
    </div>
    <div>
        <img src="FANCYAMP_546.png" width="53" height="50" alt="">
    </div>
    <div class="USPS">
        2ND USPS HERE/
    </div>
    <div class="BIGBOLD">
        BIGBOLD<br>
        BIGBOLD
    </div>
    <div class="ADDRESSEE">
        ADDRESSEE<br>
        ADDRESSEE
    </div>
    <div>
        <div class="ROUND">
            <div class="TOFROM">
                FROM:
            </div>
            <div class="BIGBOLD">
                BIGBOLD
            </div>
            <div class="ADDRESSEE">
                ADDRESSEE<br>
                ADDRESSEE
            </div>
            <div class="LITTLE">
                LITTLE LITTLE LITTLE LITTLE
            </div>
            <table>
                <tbody>
                    <tr>
                        <td>
                            <div class="RIGHT">
                                RIGHT-ALIGNED:
                            </div>
                        </td>
                        <td>
                            <div class="LEFT">
                                LEFT-ALIGNED
                            </div>
                        </td>
                     </tr>
                    <tr>
                        <td>
                            <div class="RIGHT">
                                RIGHT-ALIGNED:
                            </div>
                        </td>
                        <td>
                            <div class="LEFT">
                                LEFT-ALIGNED
                            </div>
                        </td>
                     </tr>
                    <tr>
                        <td>
                            <div class="RIGHT">
                                RIGHT-ALIGNED:
                            </div>
                        </td>
                        <td>
                            <div class="LEFT">
                                LEFT-ALIGNED
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="RIGHT">
                                RIGHT-ALIGNED:
                            </div>
                        </td>
                        <td>
                            <div class="LEFT">
                                LEFT-ALIGNED
                            </div>
                        </td>
                     </tr>
                    <tr>
                        <td>
                            OUT OF THE COLUMN NOW (align-left)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            OUT OF THE COLUMN NOW (align-left)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            OUT OF THE COLUMN NOW (align-left)
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="GROOVY"></div>
    <div class="NOLOBIG">
        Unlike most of the text&nbsp;
    </div>
    <div class="NOLO">
        in this document, this block is exclusively in ITALICIZED SERIF, all CENTERED with a 10% MARGIN (the standard 4% used throughout the Body with an additional 6%). If you notice the effect I'm trying to achieve however is the first few words appearing BIGGER + BOLDED using the > SAME LINE HEIGHT and able to accommodate the TOP BORDER which should breach the 4% MARGINS to span 100% of the width of the page.
    </div>
    <div>
        <div class="MAIN">
            Start of the BODY of the letter
        </div>
    </div>
</body>
I hope I can post this (?) . . .

━  ━  ━  ━  ━  ━  ━  ━  ━  ━

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
        <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
        <title>
            Semicolon&rsquo;s LETTER w/2-COLUMN HEADER
        </title>
        <style type="text/css">

    BODY {
        font-size: 18px;
        line-height: 18px;
        font-family: 'SLAB SERIF', SANS-SERIF;
        margin-left: 4%;
        margin-right: 4%;
        margin-top: 50px;
        margin-bottom: 50px;
        width: 100%;
        overflow: hidden;} 

    .ROUND {
        float: LEFT;
        margin-left: 45%;
        margin-right: 4%;
        border-radius: 25px;
        border: 10px SOLID BLACK;
        padding: 10px;
        width: 55%;
        height: AUTO;}

    .TOFROM {
        text-align: LEFT;;
        color: #8D8D8D;
        font-size: 28px;
        line-height: 28px;}

    .USPS {
        font-size: 16px;
        line-height: 16px;
        font-family: SLAB SERIF, MONOSPACE;
        color: DODGERBLUE;
        text-decoration: UNDERLINE;
        text-align: LEFT;
        margin-top: 20px;
        margin-bottom: 100px;}

    .FANCYAMP {
        display: BLOCK;
        text-align: CENTER;
        padding: 100px;
        margin-left: AUTO;
        margin-right: AUTO;}

    .LITTLE {
        font-size: 16px;
        line-height: 16px;
        font-family: SLAB SERIF, MONOSPACE;
        color: DODGERBLUE;
        text-align: LEFT;
        margin-top: 10px;
        margin-bottom: 20px;}

    .BIGBOLD {
        font-size: 22px;
        line-height: 22px;
        font-weight: BOLD;
        font-family: SLAB SERIF, SANS-SERIF;
        color: BLACK;
        text-align: LEFT;
        margin-top: 10px;}

    .ADDRESSEE {
        font-size: 18px;
        line-height: 18px;
        font-family: SLAB SERIF, SANS-SERIF;
        color: BLACK;
        text-align: LEFT;}

    TABLE .RIGHT {
        margin-right: 5px;
        text-align: RIGHT;
        color: #8D8D8D;
        font-size: 22px;
        line-height: 22px;}

    TABLE .LEFT {
        text-align: LEFT;
        color: BLACK;
        font-size: 22px;
        line-height: 22px;}

    .GROOVY {
        display: BLOCK;
        border-top: 20px GROOVE RED;
        width: 100%;
        text-align: CENTER;
        margin-top: 50px;
        margin-bottom: 10px;}

    .NOLOBIG {
        display: INLINE-BLOCK;
        font-weight: BOLD";
        font-size: 16px;
        line-height: 12px;
        font-family: NoloSerifBold-Italic, Serif;
        color: BLACK;
        text-align: CENTER;}

    .NOLO {
        margin: 30px 10% 5px 10%; 
        font-size: 12px;
        line-height: 13px;
        font-family: NoloSerif-Italic, Serif;
        color: BLACK;
        text-align: CENTER;}

    </style>
    </head>
    <body>
        <div class="TOFROM">
            TO:
        </div>
        <div class="USPS">
            USPS USPS/
        </div>
        <div class="BIGBOLD">
            BIGBOLD<br>
            BIGBOLD
        </div>
        <div class="ADDRESSEE">
            ADDRESSEE<br>
            ADDRESSEE
        </div>
        <div>
            <img src="FANCYAMP_546.png" width="53" height="50" alt="">
        </div>
        <div class="USPS">
            2ND USPS HERE/
        </div>
        <div class="BIGBOLD">
            BIGBOLD<br>
            BIGBOLD
        </div>
        <div class="ADDRESSEE">
            ADDRESSEE<br>
            ADDRESSEE
        </div>
        <div>
            <div class="ROUND">
                <div class="TOFROM">
                    FROM:
                </div>
                <div class="BIGBOLD">
                    BIGBOLD
                </div>
                <div class="ADDRESSEE">
                    ADDRESSEE<br>
                    ADDRESSEE
                </div>
                <div class="LITTLE">
                    LITTLE LITTLE LITTLE LITTLE
                </div>
                <table>
                    <tbody>
                        <tr>
                            <td>
                                <div class="RIGHT">
                                    RIGHT-ALIGNED:
                                </div>
                            </td>
                            <td>
                                <div class="LEFT">
                                    LEFT-ALIGNED
                                </div>
                            </td>
                         </tr>
                        <tr>
                            <td>
                                <div class="RIGHT">
                                    RIGHT-ALIGNED:
                                </div>
                            </td>
                            <td>
                                <div class="LEFT">
                                    LEFT-ALIGNED
                                </div>
                            </td>
                         </tr>
                        <tr>
                            <td>
                                <div class="RIGHT">
                                    RIGHT-ALIGNED:
                                </div>
                            </td>
                            <td>
                                <div class="LEFT">
                                    LEFT-ALIGNED
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="RIGHT">
                                    RIGHT-ALIGNED:
                                </div>
                            </td>
                            <td>
                                <div class="LEFT">
                                    LEFT-ALIGNED
                                </div>
                            </td>
                         </tr>
                        <tr>
                            <td>
                                OUT OF THE COLUMN NOW (align-left)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                OUT OF THE COLUMN NOW (align-left)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                OUT OF THE COLUMN NOW (align-left)
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="GROOVY"></div>
        <div class="NOLOBIG">
            Unlike most of the text&nbsp;
        </div>
        <div class="NOLO">
            in this document, this block is exclusively in ITALICIZED SERIF, all CENTERED with a 10% MARGIN (the standard 4% used throughout the Body with an additional 6%). If you notice the effect I'm trying to achieve however is the first few words appearing BIGGER + BOLDED using the > SAME LINE HEIGHT and able to accommodate the TOP BORDER which should breach the 4% MARGINS to span 100% of the width of the page.
        </div>
        <div>
            <div class="MAIN">
                Start of the BODY of the letter
            </div>
        </div>
    </body>
</html>

Whoa! Sorry about that guys. You need to have this little guy to test my code.

Try posting your code on CodePen and other users may be able to offer solutions.

Edit:

The following link demonstrates how CodePen can be used to show your required Template:

iPad Hamburger icon not displaying but ok on everything else - #9 by PaulOB

1 Like

Unfortunately your timing is very bad as I am just about to go on holiday for 2 weeks in a matter of hours and unlikely to have internet access while away apart from a sporadic connection on my mobile.

In order to help anyone else around while I’m away I have tidied up your code a little and put it into a codepen so that others can fork and work with it more easily, I have added some basic layout to get roughly where I think you were going but have not rigidly adhered to your measurements as that is something you can do later.

Note that your code format is ugly and unreadable (to me) and you should use lower case in the css as that is standard practice these days and so much easier to read. Also note that ALL CAPS for your text content should be controlled by the css (text-transform:uppercase) and not by directly TYPING ALL CAPS IN THE PAGE as that is a presentation issue not an html issue.

Generally sentences and paragraphs should be use the p tag although for the odd word or two a div is ok but try to think semantically about the html and if its a paragraph of text or a heading then use the appropriate html element in the correct order. Not everything is a div.

Structure of the html is important so group items properly and try to use classnames that make sense rather than saying big or bigbold because that means you can never change how they look from the css without changing the classname or having a classname that says bigbold but you have styled it small and light.:slight_smile: It’s ok to have a few utility classes but for structural elements use more meaningful classnames (like header, nav, content, main-content, sub-content, footer, highlight and so on… )

I hope the above codepen helps and I don’t mean it to be a full (or fully valid) solution but a starting point for tidying up and working with.

It is unlikely that I will be able to reply for many days as I am leaving in a few hours and as mentioned will have limited internet access (There is no wifi where we are travelling and the mobile signal only works outside).

Useful links:

https://jigsaw.w3.org/css-validator/
https://beautifytools.com/html-beautifier.php

5 Likes

Thank you Paul. I won’t use that Tidier again, completely forgot about all caps! Enjoy your holiday and I/We’ll point ourselves in the right direction. :stuck_out_tongue_winking_eye:

1 Like

*as you can see I’m out of practice with these forum tools, sorry if my replies are out of order! Do you all still have that link for quoting instructions etc.?

━ ━ ━ ━ ━ ━ ━ ━ ━ ━
I will John! I’m pretty sure I even registered with them (in my ‘semicodin’ User name).

And thank you all for giving me Tidy alternatives. When I last did this there was a very clean, well-constructed site you could go to: a box to paste your code in and exactly one button to click to perform the task. Some of these sites may work perfectly but I can’t figure out how the hell to use them (and I don’t usually have trouble in that department).

Paul it’s awesome how you do this so expertly. You never fail to amaze me my friend!

I feel that I’m within striking distance of this and understand most of it.

Where I’m stuck however is getting the lines to show up in my rounded-corners bix. Here is what I added and predictably it doesn’t work. :crazy_face:

Edit —
However! I’m going to work on the table columns for left and right.

  border-top: 2px black; /* added by semicodin */

Hello friends.

Well I don’t believe it. I actually got this to work . . . TIDIED IT (no, really this time) . . . verified it . . . and uploaded everything to my ‘semicodin’ CODEPEN account (Ronpat — there’s some stuff with your name on it too!). I had to do this completely from scratch because Paul’s code looked too alien for me to follow. I’m too stressed to study theory at the moment and just need something that will compile to Acrobat right now. It is no reflection on Paul. I fully intend to pick up the conversation when he returns from vacation.

There are two Pens: One, a colorized replica of how the floats render; the second, how it will look actually.

The general nomenclature is:
semicodin’s 2-Column FLOAT Letter
followed by a 6-digit version count in reverse. So we’re starting with my 999999 and the next should be 999998, then 999997, etc.

What is not working are the rules that should appear in my ‘ROUND’ container — and they are CRITICAL.

The lines need to span the ENTIRE ROW of ‘ROUND’ and the LAST ROW must have an additional line just below it. I need the lines defined by PIXEL SIZE (no thin, heavy etc. crap). And they need the capability of being styled in different ways.

The text should be vertically aligned DEAD CENTER and I want a few pixels between the text and the line, not sitting right on top of it! I experimented with various properties like baseline (or one of the other text tools) and even tried to tighten the letting by giving line-height the same value as the font-size but nothing worked. I was up all night getting it to this point and without going into detail, let’s just say the sh+t is going to hit the fan tomorrow if I don’t cough up these PDFs filled with their respective contents. I lost one day waiting for Sitepoint to send me a password reset before guessing they don’t want yahoo addresses. Thank you in advance everyone. Here are the links:

Edit — okay I don’t know why I couldn’t just display the Codepen links. ERM . . . trying

https://codepen.io/semicodin/pen/yLpJMvP

and

https://codepen.io/semicodin/pen/OJzXpxM

semicodin’s 2-Column FLOAT Letter 999999

━ ━ ━ ━ ━ ━ ━ ━ ━ ━

https://codepen.io/semicodin/pen/yLpJMvP

━ ━ ━ ━ ━ ━ ━ ━ ━ ━

COLORIZED SKELETON

https://codepen.io/semicodin/pen/OJzXpxM

━ ━ ━ ━ ━ ━ ━ ━ ━ ━

Hello Sitepoint. I redesigned this template to give the table a smaller ‘mirrored’ version of its larger parent and simplified style naming. Briefly, #RNDBDR1 is the large container and its junior – #RNDBDR2 – is the table with columns (see the graphic below for what it’s supposed to look like).

Sorry, some of my formatting was lost (but it looks like the code came through). So the skeleton is —

BODY
#TWOCOLUMNS ID
#COLUMN-A ID
#COLUMN-B ID
#RNDBDR1 ID
#RNDBDR2 ID

Contained in the table .RNDBDR2 its 2 columns are —
.LEFTCOL
.RIGHTCOL
the border ‘GROOVY’ initiates the textual content of the letter and clears the floats —

.GROOVY clear: both etc.

— and the two remaining styles seated just below .GROOVY are page headers I can quickly grab and save as their own Templates (not intended to be a part of the lead page, just stored with it for convenience).

━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
There are three problems, chief among them my attempt at border-radius . . .

The table #RNDBDR2

  1. lost its border-radius
  2. TH, TR & TR borders need to span the full width
  3. displays a border-bottom in the last row (it shouldn’t); and
  4. sacré bleu! – displays SQUARE at corners, blocking its
    border-radius: 10px;
    border: 3px solid black
    round style

MAROON is supposed to be a small ‘focus box’ 80% of the width of COLUMN-A and CENTERED. Appearing directly below Maroon the font color for FIVE is supposed to be #353535. They share the same background-color – #CCCCCC

Both NINE and TEN are the same font-size but (for me) NINE is displaying gigantic . . . until I rotate my SmartPhone* to Landscape (Wide) mode, when NINE displays perfectly like TEN.

Thank you in advance for all help. Tidied code below. -semicodin

*I’m designing this on and for a SmartPhone

`<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html lang="en">
<head>
    <meta name="generator" content=
    "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <TITLE>ver. 1 TWO-COLUMN FLOAT &#7172; VALIDATED W3.ORG</TITLE>
    <style type="text/css">

    body {
        margin-top: 40px;
        margin-bottom: 30px;
        font-size: 14px;
        line-height: 15px;
        font-family: 'helvetica', 'robotocondensed-regular', sans-serif;
    }

    /* 2-COLUMN FLOAT */

    #TWOCOLUMNS {
        width: 92%;
        margin-left: 4%;
        margin-right: 4%;
        margin-bottom: 30px;
        overflow: hidden;
    }
    #COLUMN-A {
        height: 100%;
        margin-bottom: 30px;
        float: left;
        max-width: 38%;
    }
    #COLUMN-B {
        height: 100%;
        margin-bottom: 30px;
        float: left;
        max-width: 62%;
        margin-right: -1px;       /* from a stackflow thread */
    }

    /* ROUNDED-CORNERS CONTAINER */

    #RNDBDR1 {
        height: AUTO;
        border-radius: 25px;
        border: 10px solid black;
        padding: 10px;
        width: auto;
    }

    /* THE TABLE */

    #RNDBDR2 {
        height: AUTO;
        background-color: WHITE;
        border-radius: 10px;
        border: 3px solid black;
        padding: 0px;
        border-collapse: collapse;
        width: AUTO;
        margin-left: 0px;
        margin-right: 0px;
        font-family: 'arial', 'helvetica', 'robotocondensed-regular', sans-serif;
        color: black;
    }
    table, th, td {
        border-collapse: collapse;
        border-bottom: 2px solid BLACK;
    }
    .little {
        font-size: 20px;
        line-height: 22px;
        font-weight: BOLD;
        font-style: italic;
        font-family: 'times', 'times new roman', serif;
        color: black;
        text-align: center;
    }
    th {
        background-color: #E3F0FF;
        border-bottom: 2px SOLID BLACK;
        padding: 8px;
        border-collapse: collapse;
        width: 100%;
        margin-left: 0px;
        margin-right: 0px;
        height: AUTO;
        font-size: 18px;
        line-height: 20px;
        font-weight: BOLD;
        font-style: italic;
        font-family: 'times', 'times new roman', serif;
        color: black;
        text-align: center;
    }
    table .leftcol {
        text-align: right;
        color: #828282;
        font-size: 18px;
        line-height: 20px;
        font-weight: bold;
        margin-left: 2px;
        margin-right: 2px;
        font-family: 'helvetica', 'robotocondensed-regular', condensed, sans-serif;
    }
    table .rightcol {
        text-align: left;
        color: black;
        font-size: 18px;
        line-height: 20px;
        font-weight: bold;
        margin-right: 2px;
        font-family: 'helvetica', 'robotocondensed-regular', condensed, sans-serif;
    }

    /* GENERAL STYLING ON BOTH COLUMNS -A and -B */

    .one {
        text-align: left;
        font-family: 'arial', 'helvetica', 'robotocondensed-medium', sans-serif;
        color: #424242;
        font-size: 28px;
        line-height: 30px;
        margin-bottom: 10px;
    }
    .two {
        font-size: 24px;
        line-height: 26px;
        font-family: 'helvetica', 'robotocondensed-regular', sans-serif;
        color: dodgerblue;
        text-align: left;
        margin-top: 20px;
        margin-bottom: 70px;
    }
    .three {
        font-size: 26px;
        line-height: 28px;
        font-weight: bold;
        font-family: 'arial', 'helvetica', 'robotocondensed-medium', sans-serif;
        color: black;
        text-align: left;
    }
    .four {
        margin-left: 30px;
        font-size: 26px;
        line-height: 28px;
        font-weight: bold;
        font-family: 'arial', 'helvetica', 'robotocondensed-medium', sans-serif;
        color: black;
        text-align: left;
    }
    .square {
        color: BLUE;
        font-size: 76px;
        line-height: 76px;
        margin-left: 80px;
        margin-top: 13px;
        margin-bottom: 0px;
    }
    .maroon {
        max-width: 80%;
        margin-left: 10%;
        margin-right: 10%;
        display: block;
        color: MAROON;
        font-style: NORMAL;
        padding: 10px;
        text-align: CENTER;
        font-weight: BOLD;
        background-color: #CCCCCC;
        margin-top: 20px;
        font-size: 26px;
        line-height: 26px;
        font-family: 'arial narrow', 'arial-narrow', 'arialnarrow',  'robotocondensed-regular', sans-serif;
    }
    .five {
        width: 100%;
        color: #353535;
        font-style: OBLIQUE;
        padding: 0px;
        transform: scaleX(0.85);
        transform-origin: 0 100%;
        text-align: CENTER;
        font-weight: BOLD;
        background-color: #CCCCCC;
        margin-top: 0px;
        font-size: 23px;
        line-height: 23px;
        font-family: 'arial narrow', 'arial-narrow', 'arialnarrow',  'robotocondensed-regular', sans-serif;
    }
    .six {
        margin-left: 50px;
        margin-top: 20px;
        font-size: 21px;
        line-height: 23px;
        font-weight: bold;
        font-family: 'helvetica', 'robotocondensed-regular', sans-serif;
        color: black;
        text-align: left;
    }
    .seven {
        margin-left: 50px;
        margin-top: 10px;
        margin-bottom: 10px;
        font-size: 24px;
        line-height: 26px;
        font-family: 'helvetica', 'robotocondensed-regular', condensed, sans-serif;
        color: BLACK;
        text-align: left;
    }
    .eight {
        font-size: 19px;
        line-height: 21px;
        margin-top: 20px;
        margin-bottom: 15px;
        font-family: 'arial', 'helvetica', 'robotocondensed-regular', sans-serif;
        color: #686868;
        text-align: left;
    }
    .nine {
        margin-top: 40px;
        color: #A3A3A3;
        font-size: 21px;
        line-height: 23px;
        font-family: 'helvetica', 'robotocondensed-regular', condensed, sans-serif;
        text-align: left;
        margin-left: 4%;
        margin-right: 4%;
    }
    .ten {
        color: #A3A3A3;
        border-bottom: 4px DOTTED #91C8FF;
        width: 346px;
        font-size: 21px;
        line-height: 23px;
        font-family: 'helvetica', 'robotocondensed-regular', condensed, sans-serif;
        text-align: left;
        font-weight: bold;
        margin-left: 4%;
        margin-right: 4%;
        margin-bottom: 20px;
    }
    .dblue {
        color: DODGERBLUE;
    }
    .ye19b {
        font-size: 19px;
        line-height: 21px;
        font-weight: bold;
        background-color: #FFFFBF;
        font-family: 'helvetica', 'robotocondensed-regular', sans-serif;
        color: black;
        text-align: left;
    }
    .ye19conb {
        transform: scaleX(0.80);
        transform-origin: 0 100%;
        font-size: 19px;
        line-height: 21px;
        font-weight: bold;
        background-color: #FFFFBF;
        font-family: 'helvetica', 'robotocondensed-regular', sans-serif;
        color: black;
        text-align: left;
    }
    .text23 {
        font-size: 23px;
        line-height: 25px;
        font-family: 'arial', 'helvetica', 'robotocondensed-regular', sans-serif;
        color: black;
        text-align: left;
    }
    .text21 {
        font-size: 21px;
        line-height: 23px;
        font-family: 'helvetica', 'robotocondensed-regular', condensed, sans-serif;
        color: BLACK;
        text-align: left;
    }
    .text21b {
        font-size: 21px;
        line-height: 23px;
        font-weight: BOLD;
        font-family: 'helvetica', 'robotocondensed-regular', condensed, sans-serif;
        color: BLACK;
        text-align: left;
    }
    .text19 {
        font-size: 19px;
        line-height: 21px;
        font-family: 'helvetica', 'robotocondensed-regular', condensed, sans-serif;
        color: BLACK;
        text-align: left;
    }
    .groovy {
        clear: both;
        display: block;
        border-top: 14px groove dodgerblue;
        width: 100%;
        text-align: center;
    }
    .main {
        margin-top: 20px;
        margin-left: 4%;
        margin-right: 4%;
        margin-bottom: 50px;
        font-size: 10px;
        line-height: 12px;
        font-family: 'helvetica', 'robotocondensed-regular', sans-serif;
        color: black;
        text-align: left;
    }

    </style>
</head>

<body>
    <div id="TWOCOLUMNS">
        <div id="COLUMN-A">
            <div class="one">
                <div style="margin-top: 20px">
                    ONE ONE
                </div>
            </div>

            <div class="two">
                <span style="text-decoration: underline">TWO TWO TWO TWO</span>/
            </div>

            <div class="three">
                THREE THREE THREE<br>
                THREE THREE THREE
            </div>

            <div class="four">
                FOUR FOUR FOUR
            </div>

            <div class="text23">
                TEXT23 TEXT23<br>
                TEXT23 TEXT23 TEXT23
            </div>

            <div class="square">
                &#9632; <span style="font-size: 26px; color: BLUE; margin-left: 0px;">SEE BELOW</span>
            </div>

            <div class="two">
                <span style="text-decoration: underline">TWO TWO TWO TWO TWO</span>/
            </div>

            <div class="three">
                THREE THREE THREE<br>
                THREE THREE THREE
            </div>

            <div class="four">
                FOUR FOUR FOUR
            </div>

            <div class="text23">
                TEXT23 TEXT23<br>
                TEXT23 TEXT23 TEXT23
            </div>

            <div class="maroon">
                FIVE FIVE FIVE<br>
                <span class="FIVE">At ipsum tincidunt maecenas elit orci, gravida,
                venenatis non.</span>
            </div>
        </div><!-- CLOSING COLUMN-A -->

        <div id="COLUMN-B">
            <div id="RNDBDR1">
                <div class="one">
                    ONE <span style="color: RED">&#x27B9; This is <b>.RNDBDR1</b></span>
                </div>

                <div style="margin-top: 20px" class="THREE">
                    THREE THREE THREE
                </div>

                <div class="text23">
                    TEXT23 TEXT23 TEXT23 TEXT23<br>
                    TEXT23 TEXT23 TEXT23 TEXT23
                </div>

                <div class="six">
                    SIX SIX SIX SIX <span style="background-color: #FFFFBF">Donec sapien
                    ante, accumsan ut, sodales commodo, auctor quis, lacus. Maecenas a
                    elit lacinia uma posuere sodales. Ultricies cursus lectus. Sed
                    ultricies cursus</span>:
                </div>

                <div class="seven">
                    SEVEN SEVEN SEVEN<br>
                    <b>SEVEN SEVEN<br>
                    SEVEN SEVEN SEVEN SEVEN</B><span class="DBLUE">&#5150;</span><br>
                    SEVEN SEVEN SEVEN<br>
                    SEVEN SEVEN SEVEN SEVEN
                </div>

                <div class="text19">
                    <b>TEXT19 TEXT19</b> Mauris lacinia tincidunt maecenas elit orci<br>
                    <span class="dblue">GRAVIDA UT</span> venenatis vel LOREM&rsquo;s <B>Magna Sit Amet</B> <span class="YE19CONB">Suspendisse</span> Sed lacinia
                    potenti ultrucies cursus lectus. In suspicit euismod <span class=
                    "dblue">INTEGER ID</span> id <span class=
                    "ye19b">facilisis@eleifend.com</span>.
                </div>

                <div class="eight">
                    <span class="dblue">
&#5150;</span><span style="color: BLACK; font-weight: BOLD;">EIGHT EIGHT EIGHT </span> In onec
                    sapien ante, adipiscing <span style=
                    "color:#535353;">&lsquo;LOREM&rsquo;. 
</span>In mi sodale eget pretium
                    interdum ac purus.
                </div>

                <div id="RNDBDR2">
                    <table>
                        <tbody>
                            <tr>
                                <th colspan="2">This (should be) the TH Header for
                                <span style="color: RED">&#x27B9; .RNDBDR2</span> &ndash; a<br>
                                mirrored replica of its larger container, &lsquo;.RNDBDR1&rsquo;.
                                <span style="color: RED">See my graphic for what .RNDBDR2
                                should look like.</span></th>
                            </tr>

                            <tr>
                                <td>
                                    <div class="LEFTCOL">
                                        LEFTCOL LEFTCOL LEFTCOL:
                                    </div>
                                </td>

                                <td>
                                    <div class="RIGHTCOL">
                                        RIGHTCOL RIGHTCOL
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td>
                                    <div class="LEFTCOL">
                                        LEFTCOL LEFTCOL LEFTCOL:
                                    </div>
                                </td>

                                <td>
                                    <div class="RIGHTCOL">
                                        RIGHTCOL RIGHTCOL
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td>
                                    <div class="LEFTCOL">
                                        LEFTCOL LEFTCOL LEFTCOL:
                                    </div>
                                </td>

                                <td>
                                    <div class="RIGHTCOL">
                                        RIGHTCOL RIGHTCOL
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td>
                                    <div class="LEFTCOL">
                                        LEFTCOL LEFTCOL LEFTCOL:
                                    </div>
                                </td>

                                <td>
                                    <div class="RIGHTCOL">
                                        RIGHTCOL RIGHTCOL
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td>
                                    <div class="LEFTCOL">
                                        LEFTCOL LEFTCOL LEFTCOL:
                                    </div>
                                </td>

                                <td>
                                    <div class="RIGHTCOL">
                                        RIGHTCOL RIGHTCOL
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div><!-- CLOSING RNDBDR2 -->
            </div><!-- CLOSING RNDBDR1 -->
        </div><!-- CLOSING COLUMN-B -->
    </div><!-- CLOSING TWOCOLUMNS -->

    <div class="groovy"></div>

    <div class="nine">
        NINE NINE<br>
        NINE NINE NINE<br>
        NINE NINE NINE NINE NINE<br>
        NINE NINE NINE
    </div><!-- CLOSING NINE -->

    <div class="ten">
        TEN TEN TEN TEN TEN TEN TEN
    </div><!-- CLOSING TEN -->

    <div style=
    "margin-top: 100px; margin-left: 240px; font-size: 18px; line-height: 20px; color: BLUE; margin-right: 4%;text-align: right;">
    <span style="font-size: 40px; margin-bottom: 40px;">
&#9632; </span>This is a <b>UNICODE
    PLACEHOLDER</b><br>
        for a small 50px Square Graphic which I cannot test locally because Google has
        disabled the feature in Android for security reasons.
    </div>
</body>
</html>

To be honest I’m not happy to help you produce something that is completely the wrong approach.:frowning: I gave you a working and much simplified example to work from earlier in the thread and I had hoped that would spur you into the 21st century and use the modern more reliable methods in your approach. :slight_smile:

I do see that you have made some efforts to tidy up so that is good :slight_smile: but there are so many things that are wrong or will go wrong that I fear I may actually frighten you away of overwhelm you by mentioning them all. I will point at many issues below but is not an exhaustive list and not meant to deride your current efforts as we all have to learn our way through this jungle.

The floated approach is really a non starter these days for many reasons and flexbox is more reliable and robust and I have given you an example of that in my first demo.

However let’s ignore that for now and drill down to some problems:

First as a sign of goodwill here are some quick fixes.:slight_smile:

Those three problems can be fixed with the following code:

#RNDBDR2 table {
  width: 100%;
  border-bottom: none;
}
#RNDBDR2 th {
  border-radius: 10px 10px 0 0;
}
#RNDBDR2 tr:last-child td {
  border-bottom: none;
}

In order the fixes above do this:

  1. Tables are shrink to fit so are only as wide as the content pushes them.Therefore the rows will not expand to full available width automatically unless you make the table width:100%.

  2. The background on your th is blocking out the border-radius on the parent so you need a border-radius on the th as well to round the corner and crop the background.

  3. Remove the border bottom from the table and the last row.

As an aside your th element should really be in the thead and not in the tbody to make semantic sense.

No you are not :slight_smile:

You don’t have the viewport meta tag in place so effectively you are designing for desktop only. You don’t have media queries in place for smaller devices so you are designing a one size fits all display that takes no account of the available screen space.

What will happen on mobile devices when you omit the viewport meta tag is that they will take a guess that the page is 980px wide (or thereabouts) and simply scale the page smaller and smaller until it fits into a mobile screen. That results on my old iphone with a screen shrunk so small that I can read absolutely nothing.

This is not how you design for mobile. You cannot simply scale text smaller and smaller until it fits as that means it can’t be used without pinching and zooming everything. This behaviour is a legacy behaviour that was implemented when phones first came out so that people could get something rather than nothing but no one does that these days.

You should be using the viewport meta tag and then using media queries to change the design depending on how much space it needs at smaller screens. (Take a look at my first demo that shows how content can be arranged to be viewed at smaller screens.)

Okay enough said about that lets address some problems that I have mentioned here and in other places.

Take this code for example:

  #COLUMN-A {
        height: 100%;
        margin-bottom: 30px;
        float: left;
        max-width: 38%;
    }

Ok so you want it height 100% and then a margin-bottom of 30px that makes the total area required to be 100% + 30px. That makes little sense. Luckily your height:100% is completely ignored in that context because percentage height can only be based on an unbroken chain of heights all the way back to root (the html element). Therefore height is redundant in that rule.

If indeed the element did manage to have the 100% height then your content would flow out of the bottom of the element because height is a limiting factor and if the screen was say only a few hundred pixels high then any content greater than that will overflow the element and be ignored in the flow.

Suffice to say you will seldom use height:100% unless you know why you are using it. In most cases it is not necessary. If indeed you did want an initial height you would use min-height anyway and let the element grow larger if required.

Let’s now move on the max-width:

    max-width: 38%;

That looks innocuous enough but effectively you have given the element no width to start with as floats are shrink to fit. If the content in that float was perhaps a list and not unbroken lines of text then the width of that element would be the width of its content. If you were to add a background to that column you would see that it’s only when you add content that you get any width. The column will not be wider than the max-width but it will be narrower which is no good if you decide you wanted a background color to it.

Therefore all you need to do is remove max-width and use width instead.

What is that doing? It looks like an old hack for IE6 from 2002. Why are you building in hacks from 20 years ago :slight_smile:

All of these are important concepts and exacerbated by the use of floats. Don’t get me wrong I love floats but these days seldom have need to use them unless its for text wrapping around an image.

It is centred and doing exactly what you tell it! The FIVE FIVE should obviously be a heading tag at appropriate level and the span should be a p element as already mentioned.

Looks the same size to me except it is bold.

Thats because of the scaling algorithm I talked about at the start and your lack of a viewport meta tag. The phone will adjust things as its sees fit to make it squash into its viewport. You have a width that is wider than most smart phones so the chances of it rendering properly are almost nil. Not to mention that phones will scale text when rotated (unless counteracted) and that just adds to the confusion.

None of those problems would be evident in my demo.:slight_smile: (or few of them as it was only a quick mock up).

Lastly I have to once again remind you that html is a semantic language and you must use the right html for the job in hand and use heading tags , p tags , table tags and list tags and so on when they are required. Not everything is a div and spans are used for inline fragments and not as paragraphs.

Your use of classnames is still bewildering and so hard to follow or use. What happens if you change the order then your number nine will be before your number eight and so on. It makes no sense to name things by their order or appearance.

For example you have a class of maroon. What happens if you decide later that red would be better. Are you going to do this.

.maroon{color:red}

That has just doubled the workload and the usefulness is zero. You’d have to change the html so that all maroon classes were now called red instead.

.red{color:red}

However if you had said something more appropriate like:

.highlight {color:red}

There would be no need to change the html as it could be any color you want.

However better-still would be to do this:

.focus-box{color:maroon}

Problem solved. You know what it is and you can style it how you like.

Having suitable classnames makes it so much easier to debug and to manage long term. If you have well structured html and good classnames you make life so much easier.

4 Likes

I just want to thank you again Paul for all of the wonderful advice you have given me over the years. I will not be here ten weeks from now but never doubt that I am interested in and do read – and think about – your advice. I visit your archived site as well and actually tried modifying a few of your examples before throwing in the towel. I will experiment with your modifications/rewrites and study flexbox. You are this planet’s “Elder Statesman for Coding” and long after my account has been closed here I will follow your advice Paul. You are a treasure Sir.

semicodin

3 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.