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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:46:00+00:00 2026-05-31T02:46:00+00:00

I bet this is probably basic stuff, I’ve just never come across it before.

  • 0

I bet this is probably basic stuff, I’ve just never come across it before. So, the code:

  • I’ve got a h1 followed by a p, followed by the same thing twice. So it goes h1 + p + h1 + p + h1 + p ;
  • I’ve floated the h1’s to the left, with a 29% width ;
  • I’ve floated the p’s to the right, width a 69% width ;

My question:

Why are the h1’s not stacking up together? I notice the first two are. Why isn’t the third one doing the same? Why is it top-aligned with the second paragraph (notice that if you change the p’s bottom margin, the h1 follows it)? What am I missing about float behavior?

Here’s the example at tinkerbin : http://tinkerbin.com/IUVovfjM

Here’s the code:

<head>
<style>
h1, p, body{
  margin: 0;
  padding: 0;
  line-height: 1.4;
  font: inherit;
}

h1{
   float: right; 
   width: 29%; 
   background-color: lightblue;
   }

p{
   float: left; 
   width: 69%; 
   background-color: indianred;
   } 
</style>
</head>

<body>
<h1>This Is The Title</h1>
<p>Lorem Ipsum badum badum baei.A primeira exposição apresenta, através de elementos       multimédia, a evolução do dinheiro, com especial referência ao espaço que hoje é Portugal. A   exposição termina com um núcleo dedicado à produção das notas, em que materiais e máquinas ilustram as diferentes fases da vida da nota, desde a sua concepção artística até à sua impressão, assim como os principais elementos de segurança que lhe estão associados.</p>
<h1>This Is The Title</h1>
<p>Lorem Ipsum badum badum baei.A primeira exposição apresenta, através de elementos multimédia, a evolução do dinheiro, com especial referência ao espaço que hoje é Portugal. A exposição termina com um núcleo dedicado à produção das notas, em que materiais e máquinas ilustram as diferentes fases da vida da nota, desde a sua concepção artística até à sua impressão, assim como os principais elementos de segurança que lhe estão associados.</p>
<h1>This Is The Title</h1>
<p>Lorem Ipsum badum badum baei.A primeira exposição apresenta, através de elementos multimédia, a evolução do dinheiro, com especial referência ao espaço que hoje é Portugal. A exposição termina com um núcleo dedicado à produção das notas, em que materiais e máquinas ilustram as diferentes fases da vida da nota, desde a sua concepção artística até à sua impressão, assim como os principais elementos de segurança que lhe estão associados.</p>
</body>

Thanks in advance.

  • 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-31T02:46:01+00:00Added an answer on May 31, 2026 at 2:46 am

    Why?

    Taken from CSS specification:

    1. “A float is a box that is shifted to the left or right on the current line.” – http://www.w3.org/TR/CSS2/visuren.html#floats
    2. “The outer top of a floating box may not be higher than the outer top of any block or floated box generated by an element earlier in the source document.” – item #5 at http://www.w3.org/TR/CSS2/visuren.html#float-position

    So, it is the order of your HTML elements which is doing this.

    Don’t change your CSS, play only with the headers and paragraphs, and you will get the “why”: http://tinkerbin.com/xex2Pykn

    To achieve the stacking you want, without changing the CSS, you may try this:

    <p>Lorem Ipsum badum badum baei.A primeira exposição apresenta, através de elementos multimédia, a evolução do dinheiro, com especial referência ao espaço que hoje é Portugal. A exposição termina com um núcleo dedicado à produção das notas, em que materiais e máquinas ilustram as diferentes fases da vida da nota, desde a sua concepção artística até à sua impressão, assim como os principais elementos de segurança que lhe estão associados.</p>
    <h1>This Is The Title</h1>
    <h1>This Is The Title</h1>
    <h1>This Is The Title</h1>
    <p>Lorem Ipsum badum badum baei.A primeira exposição apresenta, através de elementos multimédia, a evolução do dinheiro, com especial referência ao espaço que hoje é Portugal. A exposição termina com um núcleo dedicado à produção das notas, em que materiais e máquinas ilustram as diferentes fases da vida da nota, desde a sua concepção artística até à sua impressão, assim como os principais elementos de segurança que lhe estão associados.</p>
    <p>Lorem Ipsum badum badum baei.A primeira exposição apresenta, através de elementos multimédia, a evolução do dinheiro, com especial referência ao espaço que hoje é Portugal. A exposição termina com um núcleo dedicado à produção das notas, em que materiais e máquinas ilustram as diferentes fases da vida da nota, desde a sua concepção artística até à sua impressão, assim como os principais elementos de segurança que lhe estão associados.</p>
    

    There are several other possible solutions, changing the CSS and/or the HTML structure.

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

Sidebar

Related Questions

I bet somebody has solved this before, but my searches have come up empty.
I would bet this is a very basic question, but i don't get it!
I bet this is super simple and easy but can't find a basic example
I've never seen anything like this before. Tried everything I could, searched the web
I bet this is easy but been trying for a while and can't seem
I bet I've got elementary question, but I couldn't solve it for two nights.
I know similar questions come up a lot and there's probably no definitive answer,
I bet this is a simple question. Im trying to style my xml file
I bet this is incredibly simple, but I looked through the documentation on barplot()
I bet this has a simple answer.. Let's say I have a Post model

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.