1 Replies - 180 Views - Last Post: 01 October 2017 - 07:49 PM

#1 Untalented  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 152
  • Joined: 31-January 12

CSS Problem [Prevent button from moving down]

Posted 01 October 2017 - 07:03 AM

Hi guys, how do I prevent the button from moving down when I get multiple line of text?

Posted Image
Posted Image

My design is like this

<div class="container>
<p>Test</p>
<button>Test</button>
</div>



Button is pushed down when paragraph gets new line. I get the same result even if I remove the button from container. As long as the paragraph gets new line or resized, everything below is pushed down. What is the work around for this?

Is This A Good Question/Topic? 0
  • +

Replies To: CSS Problem [Prevent button from moving down]

#2 Untalented  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 152
  • Joined: 31-January 12

Re: CSS Problem [Prevent button from moving down]

Posted 01 October 2017 - 07:49 PM

I got it by doing this

<div class="container">
<div><p>test</p></div>
<button>Test</button>
</div>



I wrapped the paragraph with div and set a height. So whenever it gets a new line, it is still contained inside the div. Elements below is now not affected.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1