Day 32: Learning Responsive Web Design by Building a Piano

Day 32 and I moved to a new section. In this section I am going to be learning responsive web design by building a piano. Responsive Design tells your webpage how it should look on different-sized screens.

  1. I started with basic HTML structure.

Day 32 no 1a.png

  1. I added 2 meta tags, one to optimize the page and the other to specify an accepted charset for the page.

Day 32 no 2.png

  1. Time to start working on the piano. Created a div with an id = piano.

Day 32 no 3.png

  1. Created a second div with a class= keys within the first div.

Day 32 no 4.png

  1. Within the second I created 7 more divs with the class key.

  2. Remember the piano has both black and white keys. To differentiate he keys I added another class for black keys.

Day 32 no 6.png

  1. Next step was to copy the 7 keys elements and paste 2 sets of it.

Day 32 no 7.png

  1. I then linked the stylesheet to the css.

Day 32 no 8.png

  1. Browsers can apply default margin and padding values to specific elements. To avoid that I reset the box model.

Day 32 no 9.png

  1. After resetting the html box model, I did same for the elements and pseudo-elements (pseudo-elements are special keywords that follow a selector e.g. ::before, ::after) by setting the box-sizing property to inherit. This simply tells the targeted elements to use the same value as the parent element.

Day 32 no 10.png Please leave a comment. Thank you.