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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:05:09+00:00 2026-05-27T22:05:09+00:00

I am trying to float the elements, required and nrequired, to the right of

  • 0

I am trying to float the elements, required and nrequired, to the right of the div #contact with 20px spacing between the elements. This works perfectly for the required elements, but when I insert a nrequired element, the nrequired element aligns itself to the left of the last required element with no regards to the 20px spacing. Please can you tell me what is causing this?

Here is an image to show this strange occurrence, and my code.

#contact #required {
    background-image: url('../img/req_field.png');
    background-repeat: no-repeat;
    width: 441px;
    height: 54px;
    margin-bottom: 20px;
    float: right;
    display: block;
}

#contact #nrequired {
    background-image: url('../img/field.png');
    background-repeat: no-repeat;
    width: 421px;
    height: 54px;
    margin-bottom: 20px;
    float: right;
    display: block;
}

<div id="email">
    <h1>Shoot me an email </h1>
    <h2> (All required fields are marked *)</h2>
    <div id="required"/>
    <div id="required"/>
    <div id="nrequired"/>
    <div id="logo"/>
</div>
  • 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-27T22:05:10+00:00Added an answer on May 27, 2026 at 10:05 pm

    First of all, you can’t use the same id more than once per page – they must be unique. Change the ids to class names instead and fix your selectors accordingly.

    For your layout issue, adding clear:right; to the divs should do the trick.

    What is causing this?

    The divs are floating, so they’ll try to fit in whatever space is available, and you apparently have enough space in the container to fit two side by side.

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

Sidebar

Related Questions

I am trying to do what float do, but not selectable for copy. This
I'm trying to display two <div> elements on the same line, but in the
I'm trying to create two side-by-side div elements, but I found that having an
I'm trying to get the values from a pointer to a float array, but
I am trying to create a list that will float on the right side
I am trying to create a simple menu using li elements, but it only
I was trying to get my div that contains floating elements, to enlarge to
Im trying to think how to do this with html elements. There is nothing
I have been trying to create LI elements with float left and an image
I'm not trying to put fuel on the table/div debate, for this project I've

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.