Git Product home page Git Product logo

web-essentials's Introduction

Web Essentials

"Web Essentials" is the boilerplate template / style guide for the basic HTML and CSS of any website.

Table of Contents

Jump to:

Check out the HTML file to see everything come together.

Head (meta)

Here are the essential meta tags:

<head>
  <!-- essentials -->
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>__TITLE__ • __SITE_NAME__</title>
  <meta name="description" content="__DESCRIPTION__" />
  <!-- extras -->
  <meta name="keywords" content="__KEYWORDS__" />
  <meta name="author" content="__AUTHOR__" />
  <link rel="canonical" href="https://example.com/" />
  <meta name="application-name" content="__SITE_NAME__" />
  <meta name="theme-color" content="#000000" />
  <!-- open graph -->
  <meta property="og:type" content="website" />
  <meta property="og:title" content="__TITLE__ • __SITE_NAME__" />
  <meta property="og:description" content="__DESCRIPTION__" />
  <meta property="og:url" content="https://example.com" />
  <meta property="og:site_name" content="__SITE_NAME__" />
  <meta property="og:locale" content="en_US" />
  <meta property="og:image" content="https://example.com/icon512.png" />
  <meta property="og:image:alt" content="__SITE_NAME__ logo icon" />
  <meta property="og:image:type" content="image/png" />
  <meta property="og:image:width" content="512" />
  <meta property="og:image:height" content="512" />
  <!-- twitter -->
  <meta name="twitter:card" content="summary" />
  <meta name="twitter:title" content="__TITLE__ • __SITE_NAME__" />
  <meta name="twitter:description" content="__DESCRIPTION__" />
  <meta name="twitter:site" content="@__TWITTER_SITE__" />
  <meta name="twitter:creator" content="@__TWITTER_CREATOR__" />
  <meta name="twitter:image" content="https://example.com/icon512.png" />
  <meta name="twitter:image:alt" content="__SITE_NAME__ logo icon" />
  <meta name="twitter:image:type" content="image/png" />
  <meta name="twitter:image:width" content="512" />
  <meta name="twitter:image:height" content="512" />
  <!-- icons -->
  <link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="any" />
  <link rel="icon" href="/icon16.png" type="image/png" sizes="16x16" />
  <link rel="icon" href="/icon32.png" type="image/png" sizes="32x32" />
  <link rel="icon" href="/icon192.png" type="image/png" sizes="192x192" />
  <link
    rel="apple-touch-icon"
    href="/apple-icon.png"
    type="image/png"
    sizes="180x180"
  />
  <!-- stylesheets -->
  <link rel="stylesheet" href="index.css" />
</head>

The essential things you'll need to change (find and replace) here are:

  • example.com
  • __SITE_NAME__
  • __TITLE__
  • __DESCRIPTION__
  • __KEYWORDS__
  • __AUTHOR__
  • @__TWITTER_SITE__
  • @__TWITTER_CREATOR__
  • #000000 (theme color)

Body

Here's an example of how you might markup your content:

<main>
  <article>
    <header>
      <h1>Heading 1</h1>
    </header>
    <h2>Heading 2</h2>
    <p>Paragraph with some <strong>bold text</strong>.</p>
    <form>
      <label for="cheese">
        Cheese
        <input
          type="text"
          name="cheese"
          id="cheese"
          placeholder="What cheese do you want?"
        />
      </label>
      <button type="submit">Submit</button>
    </form>
  </article>
</main>

Key things to note here:

  • I have a particular preference to wrap my form elements inside the <label> tag.
  • I prefer the hierarchy of body > main > [article | section]

Check out the stylesheet file to see how to style these:

  • Root / Color Variables
  • Base / Root
  • Main / Section / Article
  • Typography / Type
  • Headers
  • Links
  • Blockquotes
  • Details & Summary
  • Sub & Sup
  • Bold / Strong
  • Small
  • Lists
  • Line / Horizontal Rule
  • Tables
  • Multimedia
  • Code
  • Form elements

web-essentials's People

Contributors

davidhartsough avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.