visit
CSS which stands for Cascading Style Sheets is a style sheet language used to describe how HTML elements are to be displayed. CSS is one of the core languages of the web because it is used to style the web. With CSS, you can add fonts, colors, size and spacing. It's basically used to layout the web.
CSS is very easy to use but can be very tricky. Below are few CSS tricks and techniques you might find useful.The !important keyword is used in CSS to override previous CSS rules inherited from the parent element.
transform: translate(-50%, -50%)
means that, relative to the original position of this element, we move it to the left by 50% of its width, and then move it up by 50% of its height.In the codepen editor above, I set the default background color to be cyan. I then went further to add media queries for different break-points. I set the four break-points at 500px, 700px, 950px and 1200px.
The
:hover
selector in CSS is actually a pseudo-class. Using :hover, you can define how a particular element is styled when the user hovers their cursor over it without actually clicking on it.In the codepen editor above, when we hover on the button, the color and background color changes. A transform property was also added on hover which moves the right side of the button by
-15 degrees.