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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:06:00+00:00 2026-06-07T06:06:00+00:00

I am looking for a neat way to space my form elements but i

  • 0

I am looking for a neat way to space my form elements but i am not so sure how to do it.

Currently,i am using the ordinary <br/> to space but i wonder if there was a better way of doing this using class or id

<form>
  Message: <input type="text" class="msg" name="message" /><br/><br/>
   <input type="submit" class="c-add" value="Add" />
   <input type="submit" class="c-update" value="Update" />
  </form>

I am thinking of

 .c-add + .c-update{
  margin-right:100px;
  }

but that’s not valid css.What would be the solution?

  • 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-07T06:06:01+00:00Added an answer on June 7, 2026 at 6:06 am

    .c-add + .c-update is a valid CSS selector. It selects all elements with the “c-update” class that follow immediately an element with the “c-add” class. Example: DEMO (CSS Selector Reference)

    Solution

    You can seperate multiple selectors with a comma. You do not need to give each input a unique class name. That’s only necessary if you want to style them uniquely. Since you did not provide information on how the expected result should look like, i made a demo with different solutions:

    DEMO

    HTML markup:

    <form class="form">
       <label>Message:</label><input type="text" class="msg" name="message" />
       <input type="submit" class="add" value="Add" />
       <input type="submit" class="update" value="Update" />
    </form>
    

    Note that i wrapped “Message” with label, which is better markup.

    CSS to make a one-row inline form:

    .form input {
        margin-right: 0.5em;
    }
    
    .form label {
        float: left;
        margin-right: 0.5em;
    }    
    

    CSS to make a multiple-row form:

    .form input {
        display: block;
        margin-bottom: 1em;
    }
    
    .form label {
        float: left;
        margin-right: 0.5em;
    } 
    

    ​You can mix both approaches by using specific classes for each input element or type.

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

Sidebar

Related Questions

Just looking to see if there's a better way of doing this. Let's say
I am looking for a neat/clean way to store a list of strings into
Looking to do a bit of refactoring... Using NHibernate I have this query currently
I'm looking for a neat and efficient way to replace characters in XML document.
I'm looking for a neat way to override a class from the bootstrap class
Is there a neat programmatic way to determine which Themes are installed in an
I'm looking for a neat way to implement a cool design pattern for my
I am looking for a neat (clean) way to show a status message after
I'm looking for a neat way of getting the URL of the current document
I'm looking for a very simple way to implement fibers in Python. I'm sure

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.