Left / right float button inside div

How can I make a float button only in a div area?

Here is my css and html example ..

HTML

<div class='test'> <div style='float: left;'> <button>test</button> </div> <div style='float: right;'> <button>test</button> </div> </div> 

CSS

 .test { width:60%; display:inline; overflow: auto; white-space: nowrap; margin:0px auto; } 

or you can see a live sample here → http://jsfiddle.net/ELAVS/

I want this to be so.

enter image description here

+6
source share
1 answer

Change display: built-in to display: built-in unit

 .test { width:200px; display:inline-block; overflow: auto; white-space: nowrap; margin:0px auto; border:1px red solid; } 
+12
source

Source: https://habr.com/ru/post/950859/


All Articles