Day 33: The Piano

Welcome back. Remember yesterday we started a new section on building a piano via html and CSS. We started by laying some basic structures yesterday so we continue today. By the way, I am learning via free code camp.

  1. I targeted the id piano and changed the background-color, height and width.

Day 33 no1a.png

Day 33 no1b.png

  1. I set the margin to 80px auto

Day 33 no2a.png

Day 33 no2b.png

  1. Next target is the class keys. Changed the background-color, width and height.

Day 33 no3a.png

Day 33 no3b.png

  1. To the class keys a padding -left of 2px was added.

Day 33 no4a.png

Day 33 no4b.png

  1. Now time to shift the keys into place step by step.

Day 33 no5a.png

Day 33 no5b.png

  1. Time to style the keys themselves using the class key.

Day 33 no6a.png

Day 33 no6b.png

  1. Lets create magic with margin and float property now.

Day 33 n07a.png

Day 33 no7b.png

  1. Remember the pseudo-selectors that was introduced yesterday. A piano has black and white keys and currently we have only white keys, now to get the black keys, a new selector was used .key.black—key::after, the background-color is set and a new property was introduced – content. The content property is used to set or override the content of the element.

Day 33 no8a.png

  1. The position and left properties was then added to styling the pseudo selector of the black keys.

Day 33 no9a.png

  1. Lastly, width and height properties were added.

Day 33 no10a.png

Day 33 no10b.png That's all for today. Please a comment.