Sakthivel Ramesh• 150
@sakthivel155
Posted
Hi @DevEmmy001,
- Avoid Using IDs for Styling: Replace IDs with classes for more reusable and maintainable code.
- Place Media Queries at the Bottom: Move the media queries to the end of your CSS file for better organization and to ensure styles are applied correctly.
- Meaningful Class Names: Ensure your class names clearly describe their purpose, making your code easier to read and maintain.
- Avoid Element Selectors: Refrain from styling elements like
*
directly, as it can lead to unintended consequences. Use classes instead. - Structure the
:root
Pseudo-Class Properly: Move the:root
selector to the top of your CSS to define your CSS variables clearly. - Remove Unused Fonts: Clean up your CSS by eliminating any unused font styles to reduce unnecessary code.
- Add Essential Properties to
body
: Include vital properties (likemargin
,padding
, andbackground-color
) in thebody
selector and avoid applying media queries directly to it. Instead, target specific classes or elements within your layout.
Marked as helpful
0