Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1040713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:15:29+00:00 2026-05-16T15:15:29+00:00

Pros and cons of CSS formatting I know four kinds of CSS formatting. Which

  • 0

Pros and cons of CSS formatting

I know four kinds of CSS formatting.
Which do you think are better?

A) classic

.class1 {
}
.class1 .class2 {
}
.class1 .class2 .class3 {
}
.classFoo {
}

B) classic idented

.class1 {
}
    .class1 .class2 {
    }
        .class1 .class2 .class3 {
        }
.classFoo {
}

C) same line

.class1 {}
.class1 .class2 {}
.class1 .class2 .class3 {}
.classFoo {}

D) same line idented

.class1 {}
    .class1 .class2 {}
        .class1 .class2 .class3 {}
.classFoo {}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:15:29+00:00Added an answer on May 16, 2026 at 3:15 pm

    I honestly don’t think it makes a difference what style you use, so long as you use it consistently and it was agreed with anyone else who is likely to work with you on the same projects and according to any specific documentation requirements imposed by your work-place/office.

    Having said that, my preference is for style A, with groups organised roughly by descent:

    .className {
        width: 50%;
        background-color: #fff;
        /* ...etc... */
    }
    
    .className .descendantOne {
        /* ...stuff... */
    }
    
    .className .descendantTwo {
        /* ...stuff... */
    }
    
    .anotherClassName {
        /* ...stuff... */
    }
    

    Having said that, other people have other, valid, preferences.

    Obviously, for production code it’s more efficient to serve minified code, so the one-line format is closer to what I use once development is complete.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What are some pros/cons in using CSS as part of a theme instead of
I wondering what folks think about the PROS/CONS of parsing JSON to POJOs vs.
What are pros and cons if i make 4 different css? main.css IE7.css (
I try outline the pros and cons of CSS compared to tables and learn
What are pros and cons of using a .htc file in CSS?
What's the pros and cons on Internal vs External CSS, thinking of speed, requests,
What are the pros and cons of each? Is there a difference? CSS Stylesheets
In Java what pros/cons exist surrounding the choice to use a.getClass() or A.class ?
What are the pros/cons of using the GIT as opposed to CoMarshalInterThreadInterfaceInStream and CoGetInterfaceAndReleaseStream
What are some pros/cons for using the Reflection.Emit library versus CodeDOM for dynamically generating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.