button-icon

Iniciarsesión

Iniciarsesión
Archi's Academy
    Cursos
    Cursos
    #
  • Proyectos
    Proyectos
  • Archi's Academy

    Tracks

    #
  • Blog
    Blog
  • Precios
    Precios
  • Contacto
    Contacto
  • Para clubs universitarios
    Para clubs universitarios

BLACK FRIDAY

85% de descuento durante todo noviembre

whatsapp
Contáctanos
Archi's Academy

Navegación

  • Cursos
  • Proyectos
  • Blog
  • Precios
  • Para clubs universitarios
  • Contacto

Cursos

    Tracks

    • Desarrollo Frontend
    • Desarrollo Backend
    • Control de Calidad (QA)
    • Programación con IA Agentica y LLMs
    • Desarrollo Móvil
    • DevOps

    Legal

    • Política de privacidad
    • Términos de servicio

    Contacto

    +1 (217) 200 90 93
    Suite No: 8, 400 Emmet Street
    Kissimmee, Florida 34741 USA
    [email protected]

    Copyright © Tech Career Yazılım Danışmanlık A.Ş. 2026

    instagramlinkedingithubyoutubexfacebook
    visamastercardstripeiyzicoamerican-express
    ETBIS
    1. Home›
    2. Blog›
    3. How to write good CSS

    Software Development

    Software design

    How to write good CSS

    How to write good CSS

    ​ In my opinion, developers don't give enough attention to the CSS. CSS is of one the hardest concept in web development it takes hours of work to be good at CSS. ​

    Why is the CSS important?

    ​ Because CSS allows developers to implement unique designs, animations, colors, fonts, etc. CSS the place that you can make your project unique. With a strong knowledge of CSS, your project or app will be attractive and much different than other projects from out there. Let's take check some tips for writing better CSS ​

    1.DRY

    Don't repeat yourself. In CSS sometimes we need to use the same code for different elements no need to write the same code for both of the elements we can create a main class and write our common CSS codes inside of the main class. ​

    2. Don't use !important

    When we use !important tag it will be the highest specificity so in the future when we try to change those !important CSS codes we will not be able to change them and our project will be full of !important codes. ​

    3. Don't use IDs

    We always try to keep our specificity low. So instead of IDs use classes. ​

    4. Learn Flexbox and Grid

    Flexbox and Grid is the best solution for layout problems. If you are not using it you are missing a lot. When you learned both of them you will see how much easy to create a layout for your design and position every element easily ​

    5. Naming

    Your class name should be unique and meaningful. when another developer checks your code. He/She should understand where this CSS code belongs. When we have a big project there are thousands of CSS codes so our class names should be unique otherwise there will be bugs. our legacy code or current code can be overlap different classes and lead to bugs. ​

    6. Use shorthands

    When we are writing margin, padding, etc. those properties can be write in one line if you have the 4 attribute of margin no need to write them one by one you can write like this margin: top right bottom left;
    Archis-frontend-developer-trainee

    Baris Babahan

    Çarşamba, Nis 28, 2021

    ¿Listo para convertir el conocimiento en habilidades reales?

    Empieza a construir con formación guiada por proyectos y gana experiencia práctica desde el primer día.

    TOC

    Table of Content

    • 01How to write good CSS
    • 02Why is the CSS important?
    • 031.DRY
    • 042. Don't use !important
    • 053. Don't use IDs
    • 064. Learn Flexbox and Grid
    • 075. Naming
    • 086. Use shorthands