Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions components/Box/Box.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.box{
display: flex;
max-width: 100%;
border: solid black 3px;
flex-direction: row;
}

.box__placeholder1{
display: flex;
flex-direction: column;
border: solid black 1.5px;
width: 50%;
border-top: 0px;
}
.box__placeholder2{
display: flex;
flex-direction: column;
border: solid black 1.5px;
border-top: 0px;
width: 50%;
}
.box__h3 {
font-size: 1.2rem;
margin-left: 5%;
width: 100%;
}
.box__p {
margin: 0 0 25px 5%;
}
44 changes: 44 additions & 0 deletions components/Section/Section.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.section {
max-width: 100%;
}

.section__header1 {
max-width: 100%;
display: flex;
justify-content: center;
font-size: 2rem;
border:solid black 3px;
height: 90px;
align-items: center;
}
.section__dropdown{
display: flex;
justify-content: flex-start;
flex-direction: column;
position: absolute;
margin-left: 6%;
top: 35px;
}
.dropdown__button {
border: solid black 1px;
background: white;
height: 35px;
}
.dropdown__content {
display: none;
}
.dropdown__content--display {
display: flex;
flex-direction: column;
text-align: center;
border: solid black 1px;
background: white;
margin-top: 10px;
}
.dropdown__a {
padding: 8px;
}




43 changes: 41 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
<!DOCTYPE html>
<hml>
<html>
<head>

<title>Introduction to the DOM</title>
<link rel="stylesheet" href="./styles.css">

</head>
<body>
<section>

<header class="section__header1">

Header

</header>

</section>
<div class="box">
<div class= "box__placeholder1">
<h3 class= "box__h3">
Placeholder
</h3>
<p class= "box__p">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce risus nibh, gravida nec felis quis, facilisis facilisis lectus. Nulla ac orci pretium, condimentum orci quis, accumsan nisi. Aliquam erat volutpat. Curabitur cursus mattis libero, at viverra risus hendrerit quis. Fusce imperdiet tristique tortor non tincidunt. Mauris accumsan urna nec augue feugiat porta. Proin vitae magna in ex malesuada laoreet eget a nulla. Aliquam tristique et elit at consequat. In hac habitasse platea dictumst.
</p>
</div>
<div class= "box__placeholder2">
<h3 class= "box__h3">
Placeholder
</h3>
<p class= "box__p">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce risus nibh, gravida nec felis quis, facilisis facilisis lectus. Nulla ac orci pretium, condimentum orci quis, accumsan nisi. Aliquam erat volutpat. Curabitur cursus mattis libero, at viverra risus hendrerit quis. Fusce imperdiet tristique tortor non tincidunt. Mauris accumsan urna nec augue feugiat porta. Proin vitae magna in ex malesuada laoreet eget a nulla. Aliquam tristique et elit at consequat. In hac habitasse platea dictumst.
</p>
</div>
</div>
<div class="section__dropdown">
<button class="dropdown__button">Dropdown</button>
<div class="dropdown__content">
<a class="dropdown__a" href="http://">Lambda</a>
<a class="dropdown__a" href="http://">Google</a>
<a class="dropdown__a" href="http://">MDN</a>
</div>
</div>

<script typer= "text/javascript" src='index.js' defer='defer'></script>
</body>
</hml>
</html>
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class ddmenu {
constructor(){
this.drop = document.querySelector('.dropdown__button');
this.menu = document.querySelector('.dropdown__content');

this.drop.addEventListener('click', this.tog.bind(this));
}
tog() {
this.menu.classList.toggle('dropdown__content--display');
}
}

new ddmenu();
18 changes: 18 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,22 @@ body {
box-sizing: border-box;
min-width: 300px;
margin: 0;
width: 100%;
}

@media (max-width: 400px) {
.box{
display: flex;
flex-direction: column;
}
.box__placeholder1{
display: flex;
flex-direction: column;
width: 100%;
}
.box__placeholder2{
display: flex;
flex-direction: column;
width: 100%;
}
}