Skip to content

Instantly share code, notes, and snippets.

@mars13code
Last active February 3, 2018 22:32
Show Gist options
  • Save mars13code/3e1c7a227c905f123e11416e72104980 to your computer and use it in GitHub Desktop.
Save mars13code/3e1c7a227c905f123e11416e72104980 to your computer and use it in GitHub Desktop.
1-page-html-basique
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="description pour le SEO (160 caractères) (affiché par Google dans les résultats)">
<title>titre de la page</title>
<style>
/* CODE CSS POUR LES BALISES VISIBLES DES LE CHARGEMENT DE LA PAGE */
html, body {
width:100%;
height:100%;
padding:0;
margin:0;
font-size:14px;
}
*, *:before, *:after {
box-sizing:border-box;
}
.page, header, section, footer {
width:100%;
}
.page {
display:grid;
}
nav ul {
display:flex;
list-style:none;
padding-left:0;
}
nav ul a {
text-decoration:none;
display:inline-block;
padding:0.5em;
}
</style>
</head>
<body>
<div class="page">
<header>
<h1><img src="/media/image/logo.png" alt="titre du site"></h1>
<nav>
<ul>
<li><a href="/">Accueil</a></li>
<li><a href="/contact.html">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section>
<h2>titre de la section 1</h2>
<div>
<p>contenu de la section 1</p>
</div>
</section>
<section>
<h2>titre de la section 2</h2>
<div>
<p>contenu de la section 2</p>
</div>
</section>
<section>
<h2>titre de la section 3</h2>
<div>
<p>contenu de la section 3</p>
</div>
</section>
</main>
<aside>
</aside>
<footer>
<p>tous droits réservés - &copy;2018</p>
</footer>
</div>
<script>
/* CODE JS */
var loadJS = function() {
var $d = document;
var $db = $d.body;
if (loadJS.indexJS < loadJS.tabJS.length) {
var s2 = $d.createElement('script');
s2.src = loadJS.tabJS[loadJS.indexJS++];
s2.addEventListener("load", loadJS);
$db.append(s2);
}
};
loadJS.tabJS =
[
'media/js/go.js',
'media/js/vue.js',
'media/js/site.js'
];
document.addEventListener("DOMContentLoaded", function() {
loadJS.indexJS = 0;
loadJS();
});
</script>
</body>
</html>
<!--
LA PAGE SE COMPOSE DE
* 1 HEADER
* 3 SECTIONS
* 1 FOOTER
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment