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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:04:23+00:00 2026-06-16T00:04:23+00:00

I have confused in putting margin-top in my div#q , it affects also the

  • 0

I have confused in putting margin-top in my div#q, it affects also the div#m.

I just want them to be separated, the div#m will be on top and the div#q in the bottom, with having a space between them.

I tried this approach but I have failed, does anyone have a suggestion about my code?

I have this html :

<div id="m">
    <div id="c" style="background:red;">
        <h3>test 1 </h3>
        <ul>
            <li>asd</li>
            <li>asds</li>
            <li>asd</li>
        </ul>
    </div>
        <div id="c" style="background:blue;">
        <h3>test 2 </h3>
        <ul>
            <li>asd</li>
            <li>asds</li>
            <li>asd</li>
        </ul>
    </div>
    <div id="c" style="background:yellow;">
        <h3>test 3 </h3>
        <ul>
            <li>asd</li>
            <li>asds</li>
            <li>asd</li>
        </ul>
    </div>
    <div id="c" style="background:green;">
        <h3>test 4 </h3>
        <ul>
            <li>asd</li>
            <li>asds</li>
            <li>asd</li>
        </ul>
    </div>

</div>
<div id="q" style="background:violet;">
</div>

css :

#m{
    width :400px;
}
#c{
    width:33.33%;
    float : left;
}
#q{
    width: 300px;
    height : 200px;
    margin-top: 20px;
}
  • 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-16T00:04:24+00:00Added an answer on June 16, 2026 at 12:04 am

    Clear your floats. For example with overflow: hidden – DEMO

    #m{
        width: 400px;
        overflow: hidden;
    }
    

    Also don’t forget that id-s should be unique. If you need the same style to be applied on multiple elements use class instead.

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

Sidebar

Related Questions

I have the following code below however am confused as to why the div
I must be having an off day, I'm being confused by css. I have
I seem to have gotten confused as to what the css clear keyword means.
I am currently working with Python and have been confused over the fact that
In C++, the following lines have me confused: int temp = (int)(0×00); int temp
I have the following code and got myself confused: I have a query that
This is getting me quite confused: I have a small application that uses a
A common issue I have is getting confused what $(this) is referring to. I
I am completely confused - I have a website that renders perfectly in IE8
Mildly confused. I have a combobox that is databound to a list of strings.

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.