Flexbox 'leaking' outside of container

Hi,

I’m using flexbox to line up a logo in the title and have closed the container. But anytime I use a div outside of the container it gets moved into the flexbox.


#container {
  display:flex;
}

 <div id="container">
  <div id="title">Karl Pilkington</div>
  <div id="title-logo"> <img src="https://pbs.twimg.com/profile_images/3089036333/bdf34df7b55488ec738e702ee9a8c24e_400x400.jpeg" height="100"</div>
  </div>

But any other code I add outside the ‘container’ it gets included in flexbox.

I’d like to create more divs outside of flexbox but unsure how.

i.e


 <div id="container">
  <div id="title">Karl Pilkington</div>
  <div id="title-logo"> <img src="https://pbs.twimg.com/profile_images/3089036333/bdf34df7b55488ec738e702ee9a8c24e_400x400.jpeg" height="100"</div>
  </div>

(I want to the below div not automatically included in flexbox.)
<div id="new image"></div>

As you can see, Karl (real Karl) is inside the border, I want him sat below in a fresh div block.

Thank you.

You are missing some double quotes in the first line, which could cause weird effects. Does that fix it?

Hey, sorry typo, I’ve re-added the actual HTML which has the proper quotations.

Hello, where is the link to your project ?
a > is missing a the end of your two <img tags…

1 Like

I’m ashamed. This worked, thank you. :smiley:

I can’t believe I missed it! Grrr.

Whilst we’re here, why does it do this when you miss a opening/closing tag?

1 Like

Closing tag missing is source of many problems in HTML… In this case the first <div> that has the CONTAINER attribute can’t really close as it waits to find the > that closes the <img> tag. so it continues to encompass all that follows as long as <img> in is not closed…

1 Like

Very helpful, thank you. Sometimes my eyes go funny trying to find the weak link, I’d been working on this damn tribute page all day!

1 Like