Grow your CSS skills. Land your dream job.

DIV Alignment Inside a Paragraph

  • # June 24, 2013 at 10:31 am

    If you visit http://themeforward.com/demo2/2013/04/10/this-post-has-a-longer-title-designers-find-this-useful-to-see/ you’ll see an ad and ordered list sitting inside my #sidebar div. The problem is that this div is being inserted after the second paragraph and refusing to line up with the top of the second paragraph.

    What is so confusing to me is that I tried the same thing in CodePen http://codepen.io/anon/pen/ntzeh and it worked like a charm.

    Any idea why my sidebar div lines up correctly in CodePen but not on my site?

    # June 24, 2013 at 10:46 am

    Have you checked and compared the source? You have two divs and another p between the sidebar and what you’re terming the second p. The rogue p with the button child is taking up space.

    By the way, you should validate – block level elements inside a span are invalid (among other things).

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".