Skip to content

Commit

Permalink
add div as wrapper to the entire page
Browse files Browse the repository at this point in the history
This way the width can be limited to a fixed value, preventing
elements being too far apart from each other and leaving space
for a background color (or even an image or pattern).
  • Loading branch information
HectorVilas committed Apr 28, 2023
1 parent 2c7f1f3 commit 105f847
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import footer from "./modules/footer.js";
import { goToPage } from "./modules/functions.js";

const body = document.querySelector('body');
const wrapper = document.createElement('div');
const main = document.createElement('main');

body.append(
wrapper.setAttribute('id', 'wrapper');

wrapper.append(
header(),
main,
footer(),
);

goToPage("home");
);
body.append(wrapper);

goToPage("home");

0 comments on commit 105f847

Please sign in to comment.