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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:39:29+00:00 2026-05-27T23:39:29+00:00

HTML structure <div id=header_div> <a href=#> <img width=250 height=75 src=./images/header_logo.png> </a> </div> CSS: :hover{

  • 0

HTML structure

<div id="header_div">
    <a href="#">
        <img width="250" height="75" src="./images/header_logo.png">
    </a>
</div>

CSS:

:hover{
outline:1px dotted red;/*this line help us to actually see*/
}

#header_div{
-moz-border-radius-topright:8px;
-moz-border-radius-topleft:8px;
-webkit-border-top-right-radius:8px;
-webkit-border-top-left-radius:8px;
border-top-right-radius:8px;
border-top-left-radius:8px;
border:1px solid #477BA3;
border-bottom:0;
background:#5BA2D9 url('./images/header_bg.png') repeat-x left bottom;
}

#header_div img{
border:0;
padding:5px 10px;
}

I used the Google Chrome element-inspector and noted that the height is 40px (of the <a>)

Live visual example here

  • 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-27T23:39:29+00:00Added an answer on May 27, 2026 at 11:39 pm

    Because <a> is an inline element. Try some CSS:

    #header_div {
        overflow: hidden;
    }
    
    #header_div a {
        display: block;
        float: left;
    }
    

    <a> is an inline element, therefore (with the exception of “with”) it does not abide by structural properties such as “height”. This is solved by display: block;.

    Block element occupy as the entire width of their parent by default, but you wanted the <a> element to wrap tightly around your image. This is solved by float: left;.

    Because the <a> element is the only object inside #header, #header collapses when <a> floats. This is solved by overflow: hidden;, which is a cheap “clearfix“.

    When a float is contained within a container box that has a visible border or background, that float does not automatically force the container’s bottom edge down as the float is made taller. Instead the float is ignored by the container and will hang down out of the container bottom like a flag.

    Source: http://www.positioniseverything.net/easyclearing.html

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

Sidebar

Related Questions

I have a html structure like : <div onmouseover=enable_dropdown(1); onmouseout=disable_dropdown(1);> My Groups <a href=#>(view
I have the following HTML structure: $('#subgroup a').nextUntil('h3').wrapAll('<div></div>'); <script src=https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js></script> <div id=subgroup> <h3>Group name
Given the following HTML structure: <div id=wrapper> <div id=top> <a href=http://example.com class=link>click here</a> </div>
//html structure <div id='outer'> <div id='inner'> </div> </div> I am adding some data to
I have this HTML structure and want to convert it to an accordion. <div
I have the following HTML node structure: <div id=foo> <div id=bar></div> <div id=baz> <div
Given the following XML structure <html> <body> <div> <span>Test: Text2</span> </div> <div> <span>Test: Text3</span>
The main structure of the page is like this: <html> <body> <div id=Menu> <h1>Menu</h1>
I have this html structure: <div id=home> <div class=section_header> <h1 class=left data-target=newest><?=lang('home_newest');?></h1> ... </div>
I have the following html structure: <div class=container> <div class=header></div> <div class=sidebar></div> <div class=content-loading></div>

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.