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 6341809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:06:47+00:00 2026-05-24T20:06:47+00:00

Which way is better: 1) div#main { width: 100%; text-align: left; } 2) div#main{

  • 0

Which way is better:

1)

div#main {
    width: 100%;
    text-align: left;
}

2)

div#main{ //no whitespace before { sign
    width: 100%;
    text-align: left;
}

3)

div#main
{
    width: 100%;
    text-align: left;
}

4)

div#main {width: 100%; text-align: left;}

5)

div#main {
width: 100%; //no tab or whitespaces before width: 100%;
text-align: left; //no tab or whitespaces before text-align: left;
}

?

The same question is about .js files. The reason I ask is the less spaces (1 byte), tabs(1 byte) and new lines (2 bytes), the less time it takes to upload it to the user’s computer. As result, the web-site loads faster. Of course, 200 bytes is not so significant, but who cares what’s in javascript file? I mean user prefers speed, not the correct design of javascript files he doesn’t see…

As a professional, what would you recommend to a newbie about css and js files? php files are more clear, write php files the way any programmer is able to read them and modify if needed – with comments etc.

  • 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-24T20:06:48+00:00Added an answer on May 24, 2026 at 8:06 pm

    You should use a CSS Compressor and a JS Compressor and combine your files.

    When writing, do whatever is easiest for you, but keep it consistent with Coding Standards.

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

Sidebar

Related Questions

Which way is better for removing float decimals places or is there a more
Which is better way to use jQuery() ? I've heard that jQuery(element) doesn't ruin
When using a Random Number Generator, which is the better way to use it
When creating a 3D array in C#, which is a better way to create
HTML <html> <body> <div style=width:100%; height: 300px; overflow: auto;> <table cellspacing=0 cellpadding=2 style=width:100%;> <thead>
I have a main div which contains two divs. One for main content and
Which way is better for making image buttons? Using <a> : set background image
I was wondering if anyone could comment on which way is better and WHY?
Is there a better way to handle form tab order in PHP than this?
Which is the semantically better way to do this? Floating li elements inside a

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.