Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML, align two elements on both sides of the same line

Tags:

html

Without using table, how can I align two elements (one at left, another at right) in the same line?

like image 775
Paranoid Avatar asked Jan 12 '23 17:01

Paranoid


1 Answers

HTML content:

<div class='container'>
  <div class="align-left">left</div>
  <div class="align-right">right</div>
</div>

Style as shown:

.container{ width:100%; }    
.align-left{ float: left;width:50%; }
.align-right{ float: right;width:50%; }
like image 82
Kamlesh Avatar answered Apr 02 '23 04:04

Kamlesh