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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:09:57+00:00 2026-06-15T21:09:57+00:00

I’m new to css. I’m going to try and explain what I want to

  • 0

I’m new to css. I’m going to try and explain what I want to achieve. I have 5 “blocks”. Each block has a header and then several label – input pairs for data entry. Labels and inputs should be nicely aligned. The headers of each block should be centered above that block

The trick now is these 5 blocks should appear besides each other within a form that contains other normal label-input pairs for data entry. (here label-input are already aligned meaning there is some css going on on the “form-level”:

.cssform {
    padding-top: 2em;
    padding-bottom: 2em;
}

.cssform div{
    max-width: 680px;
    clear: left;
    margin: 0;
    padding: 5px 0 8px 0;
    padding-left: 155px; /*width of left column containing the label elements*/
}

.cssform label{
    color: #990033;
    font-weight: bold;
    float: left;
    margin-left: -155px; /*width of left column*/
    width: 150px; /*width of labels. Should be smaller than left column (155px) to create some right margin*/
}


.cssform input[type="text"]{ /*width of text boxes. IE6 does not understand this attribute*/
    width: 180px;
    padding-bottom: 5px
}

This is somehow messing with above block layout I’m trying to create. My main issue currently is the padding or margin left. My “blocks” are too much to the right by 150px and I don’t know how to override. Here my current css:

.cssform div.scores{
    max-width: 680px;
    clear: none;
    float: left;
    margin: 0;
    padding: 5px 20px 8px 0;
    padding-left: 0px
}

.cssform div.scores label{
    float: left;
    margin-left: 0px; /*width of left column*/
    width: 100px;
}

.cssform div.scores input[type="text"]{
    width: 20px;
    padding-bottom: 5px
}

.scores h3 {

}

With this my first block is 150px to the right instead of sitting the most left possible.

Second issue is align headers for each block.

Any ideas?

EDIT:

Here the general elements in use:

<!-- Block 1 -->
<div class="scores">
    <h3 class="scoreClass1">Score Class 1</h3>
    <div>
        <label class="scoreClass1">Label 1</label>
        <input name="value1" type="text" class="scoreClass1"/>
    </div>
    <div>
        <label class="scoreClass1">Label 2</label>
        <input name="value2" type="text" class="scoreClass1"/>
    </div>
    <!-- More Values -->
</div>
<!-- Block 2 -->
<div class="scores">
    <h3 class="scoreClass2">Score Class 2</h3>
    <!-- Block 2 Values... -->
  • 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-15T21:09:58+00:00Added an answer on June 15, 2026 at 9:09 pm

    The issue was this:

    .cssform label{
        color: #990033;
        font-weight: bold;
        float: left;
        margin-left: -155px; /*width of left column*/
        width: 150px; /*width of labels. Should be smaller than left column (155px) to create some right margin*/
    }
    
    .cssform div{
        max-width: 680px;
        clear: left;
        margin: 0;
        padding: 5px 0 8px 0;
        padding-left: 155px; /*width of left column containing the label elements*/
    }
    

    I must admit that I once copy pasted this from inet when starting to learn css but now I see it could be done much simpler whiel solving my issue:

    .cssform div{
        max-width: 680px;
        clear: left;
        margin: 0;
        padding: 5px 20px 8px 0;        
    }
    .cssform label{
        color: #990033;
        font-weight: bold;
        float: left;        
        width: 150px; /*width of labels. Should be smaller than left column (155px) to create some right margin*/
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an array which has BIG numbers and small numbers in it. I
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.