Here are some CSS tricks that will surely help you as a beginner writing CSS.
- Using box-sizing: border-box; on all elements can make it easier to work with sizing and padding.
- Using the :hover selector to create hover effects on elements.
- Using the ::before and ::after pseudo-elements to add content before or after an element, respectively.
- Using the position property to control the positioning of elements, such as position: absolute; to position an element relative to its parent.
- Using the display property to control the layout of elements, such as display: flex; to create a flexible container.
- Using the transform property to manipulate the shape, size, and position of elements, such as transform: rotate(45deg); to rotate an element.
- Using media queries to create responsive designs that adjust to different screen sizes.
- Using the z-index property to control the stacking order of elements.
- Using the background property to set background colors and images.
- Using the border property to create borders around elements.