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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:40:21+00:00 2026-06-14T10:40:21+00:00

I’m newbie with css and I’m dealing with an issue that I can’t understand.

  • 0

I’m newbie with css and I’m dealing with an issue that I can’t understand. I have a parent div “footer” which contains a child div “vote”. This div contains a form which currently consists of an image button.

When viewing this with “Inspect Element” the footer div has height 0px and just shows the margin defined. Why is this? Shouldn’t the parent div hold the inner divs adjusting its size in case it’s not defined?

This happens to be the case when adding a text element (line commented out in code example), but in this particular case I don’t need to add any text so this isn’t an option.

Any tip?

<html>
<head>
<style type="text/css">
#footer {
    margin: 0.2em;
}
#vote {
    float: right;
}
#voteForm {
    float: right;
    margin: 0.2em;
}
</style>
</head>
<body>

<div id="footer">
    <div id="vote">
        <form id="voteForm" name="voteForm" action="/vote.php" method="post">
        <input type="image" src="image/vote.png">
        </form>
    </div>
<!--    <h3>Hello</h3> -->
</div>

</body>
</html>
  • 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-14T10:40:23+00:00Added an answer on June 14, 2026 at 10:40 am

    You haven’t cleared your floats.

    <html>
    <head>
    <style type="text/css">
    #footer {
        margin: 0.2em;
    }
    #vote {
        float: right;
    }
    #voteForm {
        float: right;
        margin: 0.2em;
    }
    
    .clear {
       clear:both;
    }
    </style>
    </head>
    <body>
    
    <div id="footer">
        <div id="vote">
            <form id="voteForm" name="voteForm" action="/vote.php" method="post">
            <input type="image" src="image/vote.png">
            </form>
        </div>
        <div class="clear"><!-- --></div>
    <!--    <h3>Hello</h3> -->
    </div>
    

    When you float an element you take it out of the normal flow of the page until it is cleared. So without the clear the #footer contains nothing because #vote and #voteForm are both outside of the flow of the page.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a small JavaScript validation script that validates inputs based on Regex. I
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 autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from
I'm trying to select an H1 element which is the second-child in its group

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.