Skip to content

Commit

Permalink
session 18: project two
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeeppy committed Apr 21, 2023
1 parent 01ff541 commit 3029da4
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
13 changes: 13 additions & 0 deletions session18/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=<device-width>, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="a-supprimer" class="alert alert-danger m-4">Ceci est un élément à supprimer grâce à JavaScript.</div>
<script src="script.js"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions session18/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
let body = document.querySelector("body");
body.style.margin = 0;

let header = document.createElement("header");
header.innerHTML = "<header>Bienvenue</header>";
header.style.backgroundColor = "#e3b04b";
header.style.textAlign = "center";
header.style.color = "#ffffff";
header.style.fontSize = "2em";
header.style.paddingTop = "0.5em";
header.style.paddingBottom = "0.5em";

let nav = document.createElement("nav");
nav.innerHTML = "<div><a href='#'>Accueil</a> / <a href='#'>Une autre page</a></div>";
nav.style.backgroundColor = "#f1d6ab";
nav.style.paddingTop = "0.5em";
nav.style.paddingBottom = "0.5em";
nav.style.paddingLeft = "1em";

let text = document.createElement("paragraphe");
text.innerHTML = "<p>Ceci est un paragraphe créé avec javascript</p>";
text.style.textIndent = "1em";

document.body.append(header, nav, text);

document.querySelector("#a-supprimer").remove();

console.log("ok");

0 comments on commit 3029da4

Please sign in to comment.