Skip to content

Instantly share code, notes, and snippets.

@gitdagray
Created November 21, 2021 23:17
Show Gist options
  • Select an option

  • Save gitdagray/dbe70d25d897662c1dc4f4c179883e01 to your computer and use it in GitHub Desktop.

Select an option

Save gitdagray/dbe70d25d897662c1dc4f4c179883e01 to your computer and use it in GitHub Desktop.
HTML and CSS for Javascript DOM Tutorial
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Page</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
}
body {
min-height: 100vh;
}
main {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
width: 100vw;
height: 48px;
position: fixed;
top: 0;
border-bottom: 1px solid #fff;
z-index: 2;
background-color: #000;
color: #fff;
}
section {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
z-index: 1;
padding-top: 48px;
}
.view1 {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-evenly;
background-color: lightgray;
color: #000;
}
.view1 > div {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100px;
height: 100px;
background-color: #000;
color: #fff;
margin: 10px;
}
.view2 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
display: none;
background-color: darkblue;
color: #fff;
}
</style>
<script defer src="js/main.js"></script>
</head>
<body>
<nav>
<h1>My Page</h1>
</nav>
<main>
<section id="view1" class="view view1">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
</section>
<section id="view2" class="view view2">
<h2>My 2nd View</h2>
</section>
</main>
</body>
</html>
@shemarca

Copy link
Copy Markdown

thank you for this

@predragendava

Copy link
Copy Markdown

Thank you for the html

@SaketKumarp

Copy link
Copy Markdown

thanx sir

@ziggyjuarez

Copy link
Copy Markdown

Awesome resource.

@TabaiHouari

Copy link
Copy Markdown

you are the best , thank you

@Fasel-Ergando

Copy link
Copy Markdown

Thanks :)

@Vveera8124

Copy link
Copy Markdown

Thank you Sir.

@ubhat95

ubhat95 commented Nov 24, 2023

Copy link
Copy Markdown

real

@sajeeb-sarkarr

Copy link
Copy Markdown

thank youu

@csia77

csia77 commented Mar 5, 2024

Copy link
Copy Markdown

Thanks to you sir Dave!

@m-kazi

m-kazi commented Mar 17, 2024

Copy link
Copy Markdown

Thanks and keep up the good work Dave, cheers.

@9nikolov

Copy link
Copy Markdown

❀️ Mr. Gray is the G.O.A.T. (Greatest Of All Time)

@danhavis1

Copy link
Copy Markdown

Gracias

@Shivjiagnihotri

Copy link
Copy Markdown

Thank you sir Dave

@ThakhaniR

Copy link
Copy Markdown

Dave is the best teacher!

@juanca305

Copy link
Copy Markdown

Thanks a million Dave, for everything!!!

@Arunjoshua1410

Copy link
Copy Markdown

Thanks

@Manasseh919

Copy link
Copy Markdown

Thank you

@Dherah-77

Copy link
Copy Markdown

Good Stuff

@hendrix214

Copy link
Copy Markdown

Your tutorials are always very helpful champ

@Dimitris-Chouliaras

Copy link
Copy Markdown

Thank you!

@AkonucheJ10

Copy link
Copy Markdown

We appreciate you sir.

@chavan-shivam

Copy link
Copy Markdown

High-quality content.
Thank you so much, sir...πŸ™πŸ™

@CollinsVictor406

Copy link
Copy Markdown

Thank you sir

@abdulgamer786

Copy link
Copy Markdown

Thanks a lot!

@hamdan-bit

Copy link
Copy Markdown

Thanks :)

@abhi-st-DE

Copy link
Copy Markdown

Thank you so so so so so so so soso soso owosoosos much for the courses you provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment