Upgrade to Pro — share decks privately, control downloads, hide ads and more …

html - back to basics

html - back to basics

Presented at the Memphis WebWorkers meetup, June 2016. http://memphiswebworkers.com/

Brad Montgomery

June 14, 2017
Tweet

More Decks by Brad Montgomery

Other Decks in Technology

Transcript

  1. <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"

    “http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> … </html>
  2. html 2? html 1? There are suddenly no links for

    these specs. http://memtech.website/~bkmontgomery/
  3. <!doctype html> <html> <head> <title>Example</title> <base href=“http://example.com/"> <meta charset="utf-8"> <meta

    name="description" content="Actual description"> </head> <body> </body> </html>
  4. Mind your <head> Use unique content for your <title> Write

    a decent <meta name=“description” …> Declare a <base> tag.
  5. headings Headings (<h1> - <h6>) imply an hierarchy. They have

    meaning (semantics). Don’t use them for “text size”. Don’t skip sizes. Shoot for a single <h1>.
  6. headings (with ids) Give your headings an id. It’s always

    awesome. <h1 id=“the-beginning”>The Beginning</h1>
  7. css is for style Keep your html as clean as

    possible (I know, I know). Try to avoid style attributes.
  8. Beware the </div> How to build a slick marketing page:

    1. Copy something from StartBootstrap 2. Strip out all the placeholder text. 3. Change the color scheme in CSS. 4. Publish, FTW!
  9. validate Why in the world is HTML validation not built

    into every single browser? Use the w3’s validator service or a browser extension.
  10. what’s wrong? <p> <strong>Term:</strong> Here's a description for the meaning

    of this Term. </p> <p> <strong>Other Term:</strong> Here's the meaning of this Other Term. </p>
  11. what’s wrong? <body> <nav class="navbar navbar-default navbar-fixed-top topnav" role="navigation"> <div

    class="container topnav"> <div class="navbar-header"> <a class="navbar-brand topnav" href="#">Start Bootstrap</a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <!-- snipped... --> </div> </div> </nav> <a name="about"></a> <div class="intro-header"> <div class="container"> <div class="row"> <div class="col-lg-12"> <div class="intro-message"> <h1>Landing Page</h1> </div> </div> </div> </div> </div> </div> </body>
  12. tools • W3 Validator • HTML 5.1 Spec • MDN

    HTML Element Reference • MDN: Learn HTML • Validity Extension for Chrome • html-tidy (or brew install tidy-html5)