diff --git a/components/Box/Box.css b/components/Box/Box.css index e69de29..291e650 100644 --- a/components/Box/Box.css +++ b/components/Box/Box.css @@ -0,0 +1,16 @@ +.box--display { + display: flex; +} + +.box--column { + border: 2px solid black; + padding: 1rem; +} + +.box--paragraph { + font-size: 1.4rem; +} + +.box__heading { + font-size: 2.2em; +} \ No newline at end of file diff --git a/components/Dropdown/Dropdown.js b/components/Dropdown/Dropdown.js new file mode 100644 index 0000000..ac6e574 --- /dev/null +++ b/components/Dropdown/Dropdown.js @@ -0,0 +1,15 @@ +class Dropdown { + constructor(button) { + this.button = button; + this.content = document.querySelector('.section__dropdownContent'); + this.button.addEventListener('click', () => { + this.openDropdown(); + }); + } + openDropdown() { + this.content.classList.toggle('show'); + } +} +let button = new Dropdown(document.querySelector('.section__dropdownButton')); + + diff --git a/components/Section/Section.css b/components/Section/Section.css index e69de29..be9cc23 100644 --- a/components/Section/Section.css +++ b/components/Section/Section.css @@ -0,0 +1,44 @@ +.section--display { + display: flex; + align-items: center; + justify-content: center; + width: 100%; +} + +.section--heading { + justify-content: center; + width: 80%; + font-size: 1.5em; +} + +.section--dropdown { + justify-content: flex-start; + margin-left: 1em; + width: 70%; +} + +.section__dropdownButton { + background: none; + border: 3px solid black; + padding: 1em; +} + +.section__dropdownContent { + display: none; + position: absolute; + background-color: #fff; + min-width: 87px; + z-index: 1; + border: 3px solid black; + margin-top: 1.1em; +} + +.section__dropdownContent a { + padding: 12px 16px; + display: block; + font-size: 1.5em; +} + +.show { + display:block; +} \ No newline at end of file diff --git a/index.html b/index.html index 39167c5..3b9932a 100644 --- a/index.html +++ b/index.html @@ -1,9 +1,33 @@ - + Introduction to the DOM + +
+
+ +
+ Lambda + Google + MDN +
+
+
+

Header

+
+
+
+
+

Placeholder

+

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.

+
+
+

Placeholder

+

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.

+
+
-
\ No newline at end of file + \ No newline at end of file diff --git a/styles.css b/styles.css index 997c895..6001b5a 100644 --- a/styles.css +++ b/styles.css @@ -1,6 +1,10 @@ @import './components/Section/Section.css'; @import './components/Box/Box.css'; +html { + font-size: 62.5%; +} + body { box-sizing: border-box; min-width: 300px;