Simple HTML Website (followup) Followup to this



I have created a simple HTML5/CSS3/JS website with a navbar and no content.



index.html:

&lt;!DOCTYPE html&gt;
&lt;html lang="en-US"&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;title&gt;SigmaCubes - Home&lt;/title&gt;
  &lt;meta name="author" content="Julian Lachniet,Simon Kwilinski,Jacob Wysko" /&gt;
  &lt;meta name="description" content="SigmaCubes is the best website on the internet." /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /&gt;
  &lt;link href="https://fonts.googleapis.com/css?family=Lato|Noto+Sans|Nunito:600|Material+Icons" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="/lib/css/reset.css" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="/lib/css/sigmacubes.css" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="/favicon.ico" rel="shortcut icon" /&gt;
  &lt;script src="/lib/js/main.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div&gt;
    &lt;noscript&gt;
      &lt;div class="error"&gt;
        &lt;h1&gt;Error:&lt;/h1&gt;
        &lt;h2&gt;JavaScript&lt;/h2&gt;
      &lt;/div&gt;
    &lt;/noscript&gt;
    &lt;!--[if IE]&gt;
      &lt;div class="error"&gt;
        &lt;h1&gt;Error:&lt;/h1&gt;
        &lt;h2&gt;Old Internet Explorer&lt;/h2&gt;
      &lt;/div&gt;
    &lt;![endif]--&gt;
    &lt;div id="nav-stupid" class="error"&gt;
      &lt;h1&gt;Error:&lt;/h1&gt;
      &lt;h2&gt;Resolution&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="wrapper"&gt;
    &lt;div id="nav-large"&gt;
      &lt;img alt="SigmaCubes Logo" class="logo_h" height="24" src="/img/logo_h.svg" /&gt;
      &lt;div id="nav-large-links"&gt;
        &lt;a class="link-large" href="#"&gt;About Us&lt;/a&gt;
        &lt;a class="link-large" href="#"&gt;Projects&lt;/a&gt;
        &lt;a class="link-large" href="#"&gt;Contact&lt;/a&gt;
        &lt;a class="link-large" href="#"&gt;Donate&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div id="nav-small"&gt;
      &lt;img alt="SigmaCubes Logo" class="logo_h" height="24" src="/img/logo_h.svg" /&gt;
      &lt;a class="link-nav" onclick="toggleNav()" href="javascript:void(0);"&gt;
        &lt;img height="28" src="/img/menu.svg" /&gt;
      &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id="nav-small-links"&gt;
      &lt;a class="link-small" href="#"&gt;About Us&lt;/a&gt;
      &lt;a class="link-small" href="#"&gt;Projects&lt;/a&gt;
      &lt;a class="link-small" href="#"&gt;Contact&lt;/a&gt;
      &lt;a class="link-small" href="#"&gt;Donate&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


reset.css:

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,
blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img,
ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i,
center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption,
tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section,
summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav,
section {
  display: block;
}

body {
  line-height: 1;
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after, q:before, q:after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}


main.js:

var navEnabled = false;

document.addEventListener('DOMContentLoaded', main);

function main() {
  setDisplay("wrapper", "block");
}

function toggleNav() {
  if (navEnabled) {
    setDisplay("nav-small-links", "none");
  } else {
    setDisplay("nav-small-links", "block");
  }
  navEnabled = !navEnabled;
}

function setDisplay(id, state) {
  document.getElementById(id).style.display = state;
}


What can I try to improve?
title

It’s better for usability to use "page-title - site-name" instead of "site-name - page-title". 

But for the homepage, you might want to omit the page-title ("Home"), as the site/domain name only typically represents the homepage.

&lt;title&gt;SigmaCubes&lt;/title&gt;


Error messages

You shouldn’t use a heading element for the content, as this creates an outline that’s not useful. Use p instead. And to convey the importance of the error, you could use the strong element.

&lt;div class="error"&gt;
  &lt;h1&gt;Error&lt;/h1&gt;
  &lt;p&gt;&lt;strong&gt;Old Internet Explorer is not supported&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;


You should add the hidden attribute to your error messages, and remove it as soon as the error becomes relevant. Otherwise the markup affects your outline (i.e., you have all possible errors listed at the top of the document outline).

&lt;div class="error" hidden&gt;


&lt;div id="nav-stupid" class="error" hidden&gt;


(For the error about disabled JavaScript, you’d need to add the hidden attribute via JS itself, of course.)

alt for logo

The alt attribute for a logo shouldn’t contain the term "logo" (unless that’s part of the name, of course). Just use the site name.

alt="SigmaCubes"


Navigation

Use the nav element for the navigation. 

Use a ul element for the navigation links (without a list, you should use some kind of textual delimiter separating the navigation links, e.g. for text browsers).