Tips and Tricks
Let's discuss a few of the tips and tricks for beginners while developing layouts.
We'll cover the following
- Center a div with the CSS declaration of margin: 0 auto
- Never override a framework CSS class directly
- Narrow containers in Bootstrap
- Use the <ul> element to style a navigation
- Avoid over-qualified selectors
- Add a shadow to a div
- Add a shadow to text in CSS
- Add effects with hover and transition
- Using RGB alpha and HSL alpha colors
- Use CSS filters to turn an image into grayscale
We’ll go over the top 10 useful things to know that we haven’t covered so far in the course.
Center a div with the CSS declaration of margin: 0 auto
To center any layout, for example, inside the <body>
element, you can use the world-famous margin: 0 auto
.
For example:
Get hands-on with 1200+ tech skills courses.