• Making It Worse 8<<<

    From Thomas 'PointedEars' Lahn@21:1/5 to Mike Copeland on Sat Sep 10 04:19:05 2016
    XPost: comp.infosystems.www.authoring.stylesheets

    [X-Post & F'up2 comp.infosystems.www.authoring.misc]

    Mike Copeland wrote:

    In my personal history website I'm running each code page through the validator (with slow success), but in doing so I've seriously caused regressions. First, the basic font size has dropped down to default (I
    want 120%). Second, the layout of the table is messed up: the image and caption are floated left, whereas I want both to be centered.

    In the code that you posted, there is a hyphen-minus after “class” where there should be an equals character (“=”) to separate the “class” attribute
    name from the attribute value. As a result, this markup is not Valid and
    the W3C Markup Validator will tell you this.

    When I was use non-valid code (e.g. <figure>, <figcaption>, <center>
    and such it was fine.

    <figure>, <figcaption>, and <center> are not per se non-valid markup. It depends on the markup language, in particular the language version here.

    The “figure” and “figcaption” elements are only specified in HTML5 and later, and you have declared HTML 4.01.

    <https://www.w3.org/TR/1999/REC-html401-19991224/index/elements.html> <https://www.w3.org/TR/2014/REC-html5-20141028/grouping-content.html#the-figure-element>

    The “center” element is deprecated in HTML 4.01, and obsolete and non- conforming (i.e. forbidden) in HTML5, but since you declared HTML 4.01 *Transitional*, it is Valid.

    <https://www.w3.org/TR/1999/REC-html401-19991224/present/graphics.html#edef-CENTER>
    <https://www.w3.org/TR/2014/REC-html5-20141028/obsolete.html#non-conforming-features>

    Not Valid in HTML 4.01 Transitional, but Valid in HTML5, is a “style” element without a “type” attribute as you wrote. In HTML 4.01 you have to declare the stylesheet language as there was no default; usually, that was type="text/css", which is the default as of HTML5 (but you can still specify
    it for backwards compatibility).

    <https://www.w3.org/TR/1999/REC-html401-19991224/present/styles.html#edef-STYLE>

    vs.

    <https://www.w3.org/TR/html5/document-metadata.html#attr-style-type>

    You should declare HTML5 by writing

    <!DOCTYPE html>

    instead, then run the code through the W3C Markup Validator again. The Web site will switch to the HTML5 (nu)Validator then, which gives you more information.

    If that does not help, you should post again the original and the so-far- corrected markup and stylesheet(s) in <news:comp.infosystems.www.authoring.misc>, unless you are sure that the problem is only HTML-related (in which case it belongs in <news:comp.infosystems.www.authoring.html>) or stylesheet-related (in which case it belongs in <news:comp.infosystems.www.authoring.stylesheets>).

    […]
    [Code]
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta content="text/html; charset=ISO-8859-1" http-equiv="content-> type">

    Usually you would write the attributes in the reverse order, as in the HTTP response header field

    Content-Type: text/html; charset=ISO-8859-1

    (hence “http-equiv[alent]”), but either order is Valid *HTML 4.01*. Neither
    order is Valid HTML5.

    <https://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html#edef-META>

    […]
    <style>
    body { margin: 0 75px 0 75px;
    font: Verdana; font-size: 120%; color: White;
    }
    p { text-indent: 20px; font-size: 120%; margin-right:
    10px; margin-left: 10px;}

    This will make the font-size of ”p” elements 1.2 times the font-size of the next ancestor element that has the “font-size” property declared on it, or of the default font-size. For example, if you declare “font-size: 120%” or “font-size: 1.2em” on the “body” element, and then again “font-size: 120%”
    or “font-size: 1.2em” on “p” elements, and a “p” element is a child element
    of the “body” element, then the effective font-size of that “p” element is
    1.44rem (1.44 times the base/“root” font-size).

    <body background="blue11.jpg">

    Declare the “background-image” property on the “body” element instead.

    <div>
    <h3 class="center"><a id="MRC_Youth">Mike's Youth</a></h3>

    Do you want all headings to be horizontally centered? If yes, do not use
    the “center” class on each heading, but element type selectors for the headings (“h1” through “h6”). Such bootstrap declarations are the exception
    to the rule of thumb of avoiding element type selectors.

    Regardless, this can be simplified to

    <h3 … id="MRC_Youth">Mike's Youth</h3>

    You can specify the “id” attribute on virtually any element. The “a” element was necessary in HTML 4.01 and earlier versions because there were
    user agents that supported only HTML ≤ 4.01 and did not support anchors by ID; so you would specify on an “a” element both the “id” and the “name”
    attribute (or only the “name” attribute) with the same value.

    <table><tr><td>

    Please do not use tables for this.

    <td class-"image center">
    ------------------^

    ---
    This email has been checked for viruses […]

    Would you *please* stop posting this nonsense?


    PointedEars
    --
    Sometimes, what you learn is wrong. If those wrong ideas are close to the
    root of the knowledge tree you build on a particular subject, pruning the
    bad branches can sometimes cause the whole tree to collapse.
    -- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)