html - Unable to align div and a button in CSS -


i have div , button. button should placed in same line div. unable that. button displayed in next line. how can that? here code:

<?php     echo "         <div class='data'>             <p id='thedata'>name</p>         </div>     "; ?> <button class="copybtn" onclick="copytoclipboard('thedata')">copy data</button> 

these css code given data element

.data{     font-size:1.2em;     color:#000000;     width:300px;     height:50px;     border:2px solid #ef6c00;     padding-bottom:10px; } 

<div class='data' style="display: inline-block;">         <p id='thedata'>name</p>     </div> <button class="copybtn" onclick="copytoclipboard('thedata')">copy data</button> 

Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -