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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:33:12+00:00 2026-06-15T07:33:12+00:00

I’m working on an app for Windows 8 written in HTML, CSS, and JavaScript.

  • 0

I’m working on an app for Windows 8 written in HTML, CSS, and JavaScript. I’m struggling with the CSS formatting part. I was able to get my app formated so it appears the way I want it to look somewhat but I would like to know how I can cleanup my CSS? I “Googled” and experimented until I got the layout I wanted but I would like to know the right, preferred way to format with CSS?

Below is my code:

     <style type="text/css">
     .quiz p {
        margin-left: 120px;
    }



    .quizDiv2 {
        margin-top: 220px;
        width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .cenDiv {
        text-align: center ;

    }

    .cenDiv2 {
        text-align: center ;
         font-size:250%;
    }

    .alignleft {
      float: left;
      width:33.33333%;
      text-align:left;
    }
    .aligncenter {
      float: left;
      width:33.33333%;
      text-align:center;
    }
    .alignright {
     float: left;
     width:33.33333%;
     text-align:right;
    }​

     .alignleft2 {
        float: left;
    }
    .alignright2 {
        float: right;
    }


    .container {
        width:320px;
    }

    .first,
    .second {
        width:100%;
        text-align:right;
        display:table;
        font-size:250%;
    }
    .plus {
        width:auto;
        float:left;
    }
    .number {
        width:auto;
        float:right;
    }
    .third {
        width:100%;
        text-align:right;
        border-top:2px solid black;
        border-color:black;
    }
    ​ .correct {
     font-size:250%;
    }
     </style>
    </head>

    <body>
     <div class="quizDiv2">

                <div id="textbox">
     <p class="alignleft" id="statQuestionDiv">1/10</p>
     <p class="aligncenter" id="statTimerDiv">02:27</p>
     <p class="alignright" id="statScoreDiv">100%</p>
     </div>
     <div style="clear: both;"></div>



            <div class="container">
        <div class="first" id="mathProblemDiv1">1,483</div>
        <div class="second">
            <div class="plus">+</div>
            <div class="number" id="mathProblemDiv2">4,573</div>
        </div>
        <div class="third">
            <div class="result"></div>
        </div>
    </div>



            <div class="cenDiv">
                <!-- Fill in the blank div -->
                <div id="fillBlankDiv">
                <input id="userAnswer" type="text" />
                <p>
                <button id="btn7">7</button>
                <button id="btn8">8</button>
                <button id="btn9">9</button>
                </p>
                <p>
                <button id="btn4">4</button>
                <button id="btn5">5</button>
                <button id="btn6">6</button>
                </p>
                <p>
                <button id="btn1">1</button>
                <button id="btn2">2</button>
                <button id="btn3">3</button>
                </p>
                <p>
                <button id="btn0">0</button>
                <button id="btnNeg">+/-</button>
                <button id="btnOk">OK</button>
                </p>
                </div>
                </div>
            <div class="cenDiv2">
                <div id="checkDiv">CORRECT!</div>
       </div>
                 </div>

    </body>
    </html>

jsFiddle

  • 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-06-15T07:33:14+00:00Added an answer on June 15, 2026 at 7:33 am

    You can use this easy CSS Cleaner. This site is amazing and will be great for cleaning up future css styles.

    You can just copy and paste your styles in the CSS Input and select the size of the output. I recommend High.

    http://www.cleancss.com/

    Hope this helps!

    Here is your code after cleaned up:

    <style>
    .quiz p{margin-left:120px;}
    .quizDiv2{margin-top:220px;width:320px;margin-left:auto;margin-right:auto;}
    .cenDiv{text-align:center;}
    .cenDiv2{text-align:center;font-size:250%;}
    .alignleft{float:left;width:33.33333%;text-align:left;}
    .aligncenter{float:left;width:33.33333%;text-align:center;}
    .alignright{float:left;width:33.33333%;text-align:right;}
    .alignleft2{float:left;}
    .alignright2{float:right;}
    .container{width:320px;}
    .first,.second{width:100%;text-align:right;display:table;font-size:250%;}
    .plus{width:auto;float:left;}
    .number{width:auto;float:right;}
    .third{width:100%;text-align:right;border-top:2px solid #000;border-color:#000;}
    .correct{font-size:250%;}
    </style>
    

    UPDATE: For best practices in css, If you have a style you are going to be using similar styles a good bit. For example text-aligning and font-sizes, and Columns. Make class in your css like this:

     .onethird { width:33.33333%; }
     .alignleft { text-align:left; }
     .aligncenter { text-align:center; }
     .alignright { text-align:right; }
    
     .largefont { font-size:250%; font-family: arial,tahoma; font-weight:normal;}
    

    Then on your html just add the classes, for example:

     <div class="container">
          <div class="first alignleft onethird">
          </div>
          <div class="second aligncenter onethird">
          </div>
          <div class="third alignright onethird">
          </div>
     </div>
    

    That way use can apply the styles that you use over and over without having to add the to each css class. And then if you want to change a specific one, be more specific in calling your css and it will override the default styles. For example:

    .container .onethird { width:100%; }

    will override .onethird { width:33.33333%; }

    This is how I work in css, and its helped me so much. Hope this helps!

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I used javascript for loading a picture on my website depending on which small
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.