Guidelines

In case you want short and clear explanation of good habits when building a website.

Disclaimer: Do not use components from this website (except titled as "Correct usage"). It was slightly redesigned and new styling was added to help present you some examples of HTML layout.


Layout/grid

To set layout for website use <article> (for rows) and <section> (for columns in row) tags.

Single column article:

This is a blank section. Put website content here.

Multi column article:

This is a blank section. Put website content here.

This is a blank section. Put website content here.

This is a blank section. Put website content here.

After specified requirements are met the layout changes, and columns (sections) are not presented side by side, but underneath each other.

Check by using inspection tool F12 and preview this website with device toolbar to check responsive behavior.

Correct usage:

<article>
    <section>
        <p>This is a blank section. Put website content here.</p>
    </section>
    <section>
        <p>This is a blank section. Put website content here.</p>
    </section>
    <section>
        <p>This is a blank section. Put website content here.</p>
    </section>
</article>

You may ask yourself Why do I need to use these to make my website look clean?. Well, these tags like article and section are guidelines for HTML and CSS how to modify layout with multiple @media tags in CSS. Without it your website might not look good and layout can break if you use multiple columns in your website.

Tables

These are used to present data in organized way with ability to compare to each other.

For responsive behavior (your table won't overflow the website) put your table inside div.

Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor
Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor
Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor
Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor
Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor

Table headers (th) are automatically marked with slightly darker background and bolded text.

Summary

To summary any data (such as topic description, FAQ section etc.) use summary tag.

What came first? The chicken or the egg?

Back to our original question: with amniotic eggs showing up roughly 340 million or so years ago, and the first chickens evolving at around 58 thousand years ago at the earliest, it's a safe bet to say the egg came first.

Back to our original question: with amniotic eggs showing up roughly 340 million or so years ago, and the first chickens evolving at around 58 thousand years ago at the earliest, it's a safe bet to say the egg came first.

Back to our original question: with amniotic eggs showing up roughly 340 million or so years ago, and the first chickens evolving at around 58 thousand years ago at the earliest, it's a safe bet to say the egg came first.

Source: www.science.org.au

Dropdown menu

It uses one class toggler for <a> element to allow javascript detect dropdown menu.

Dropdowns are used to hide some of the options so they do not take up space on the page.

Important note: Dropdowns can be used anywhere on the website as long as the component structure follows the template. (Dropdowns may be used in navbars, inside aside, inside summary etc. as long as component structure is kept.)

Correct usage:

Navbar
<nav>
    <ul>
        <li><a href="index.html">home</a></li>
        <li><a href="guidelines.html">guidelines</a></li>
        <li>
            <div class="dropdown">
                <a class="toggler">Dropdown toggler</a>
                <ul>
                    <li><a href="#">Redirect to top of website</a></li>
                    <li><a href="index.html">Index page</a></li>
                    <li><a href="guidelines.html">Guidelines page</a></li>
                </ul>
            </div>
        </li>
    </ul>
</nav>
Any other part of website
<div class="dropdown">
    <a class="toggler"><b>Dropdown toggler</b></a>
    <ul>
        <li><a href="#">Redirect to top of website</a></li>
        <li><a href="index.html">Index page</a></li>
        <li><a href="guidelines.html">Guidelines page</a></li>
    </ul>
</div>

Dialog

Dialogs are website elements to reveal content hidden under a button description (e.g. cookies files management, privacy policy etc.)

Dialog with id 1

Lorem ipsum dolor sit amet consectetur adipisicing elit. Assumenda, fuga.

Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestias totam atque aut error quos consequatur recusandae. Dolore cum assumenda iste, praesentium et non nisi error deserunt quae eius nam, necessitatibus debitis sit alias! Repellat debitis libero, dolores, corrupti sed minima delectus odit, incidunt illum ducimus excepturi nostrum quidem. Perferendis magni totam delectus dignissimos. Repellat, porro reprehenderit eligendi officia beatae sit obcaecati commodi quaerat quas! Vitae est sequi deserunt voluptate iste provident numquam ipsa saepe quam, maxime officia minima accusamus obcaecati odit ratione incidunt, vel quaerat porro inventore dolor doloremque aliquid eligendi, sunt quo? Accusantium animi repellat quos laudantium mollitia ea, excepturi eveniet voluptatum dignissimos nulla, soluta dolor! Delectus esse velit iusto numquam ducimus repellat culpa, recusandae debitis natus impedit ex, corrupti consequatur! Doloremque ipsum harum, sapiente obcaecati voluptate odio vero necessitatibus asperiores, amet veniam eaque aliquid quam, nisi molestias consectetur commodi alias. Nulla praesentium facilis temporibus! Sequi temporibus consequuntur voluptas expedita iure quasi obcaecati nihil repudiandae placeat voluptatibus, laudantium tempore voluptates quia hic iste quis error facere adipisci? Ratione, eum consectetur nam magni placeat ipsum, iusto quo impedit eos, reiciendis fugiat pariatur corrupti debitis earum natus cum! Animi molestiae cumque qui veritatis dolorem, vero neque asperiores provident expedita, itaque amet?

Dialog with id 2

Lorem ipsum dolor sit amet consectetur adipisicing elit. Assumenda, fuga.

This is simple dialog with placeholder text.

Correct usage:

  • Remember to assign proper, unique for single page, ID (<dialog id="dialog1">, <button class="dialog-close" data-dialog_id="dialog1">×</button>) for every dialog so javascript will know which dialog is needed to be shown.
  • Use proper structure of dialog HTML element (which can be found in index page)