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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:36:03+00:00 2026-06-12T15:36:03+00:00

My css code: #header { width:900px; border:dashed 1px; margin:5px; padding:2px; } #header .fl_left {

  • 0

My css code:

#header
{
width:900px;
border:dashed 1px;
margin:5px;
padding:2px;
}
#header .fl_left
{
float:left;
display:block;
width:260px;
}
#header .fl_left h1
{
float:left;
background-color:#666633;
color:#0033CC;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-style:oblique;
}

My html code:

<body>
<div id="header"><div class="fl_left"> <h1>hello all</h1> </div></div>
</body>
</html>

I get the output ‘hello all’ outside header. My intention is to put h1 element text inside header.

Why the header id rule is not applied to my h1 element.

  • 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-12T15:36:04+00:00Added an answer on June 12, 2026 at 3:36 pm

    The #header selector only applies to the header element iself, not its children, and there is nothing in the style that would be inherited by the children.

    The reason that the text ends up outside the header is that the header only contains floating elements which don’t take up space, so they don’t affect the height of the header.

    You can add overflow: hidden to the header to make it contain its children:

    #header {
        width:900px;
        border:dashed 1px;
        margin:5px;
        padding:2px;
        overflow: hidden; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my CSS code: #header { width: 900px; margin-left: 0; position: relative; text-align:
my code <div id=header> <div id=header_top>KIDS'<br>ZONE</div> </div> css #header{ width:1024px; height:150px; background:url('../images/Orange.jpg'); background-repeat:no-repeat; background-size:1024px
CSS code body { background-attachment: scroll; background-clip: border-box; background-color: #ececec; background-image: none; background-origin: padding-box;
I have css code to do layout. i have basic header panel, footer, left
I have a weird problem with my HTML and CSS code: <header> <h1>title</h1> </header>
I've found this code $(window).scroll(function(){ $('#header').css({ //Why this 15, because in the CSS, we
my CSS code .child{ width:100px; height:100px; display:inline-block; } my HTML code <div id=parent> <div
My header is set to a width of 920px centered and using the code
I am using the following CSS code to stretch an element ( <header> in
Here is my CSS: <style> ul, ol, dl { padding: 0; margin: 0; }

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.