Diving into CSS Layout
“Describe one thing you learned in class today.”
In today’s class I had the chance to learn how to use Flexbox and the advantages of using Flexbox as a way to layout the content in my websites. Flexbox makes it simple for aligning items within a nav bar, for example. Flexbox is one-dimensional whereas CSS grid is two-dimensional.
“Describe your choice of 2 pseudo-selectors and discuss what they are used for.”
CSS pseudo-selectors can be used to style elements when they are hovered over by the mouse, style hyperlinks in different ways, and many other things. I like to use the :visited pseudo-selector to change the color of my links when it has been clicked, or visited. Another pseudo-selector I use often is :hover. I like to apply :hover to buttons and items in my navigation bar to change the background-color whenever the mouse hovers over them.
“What are some of the “gotchas” for writing efficient CSS?”
Always remember about the cascade in CSS. Keep in mind source code order and specificity. This will prevent many issues when trying to render your documents a certain way.