In the following code, how do I eliminate the gap between the left/right elements?
I’ve tried about every combination I can thing of. Do I need a different approach?
[code]
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width-device-width,initial-scale=1.0, user-scalable=yes”/>
<title> Align Left/Right </title>
<!– Idea from: http://w3schools.invisionzone.com/topic/58810-adding-div-side-by-side/ –>
<style>
* { box-sizing: border-box; }
.lt { display: inline-block; width: 8em; text-align: left;
margin-bottom: 0.5em; /* margin-right: 0; padding: 0.5em; padding-right: 0; /* no effect on gap ??? */
border-width: 1px 0 1px 1px; border-style: solid;
}
.rt { display: inline-block; width: 8em; text-align: right;
margin-bottom: 0.5em; /* margin-bottom: 0.5em; padding: 0.5em; padding-left: 0; /* no effect on gap ??? */
border-width: 1px 1px 1px 0; border-style: solid;
}
</style>
</head>
<body>
<div id=”container”>
<div class=”lt”>Description 1 </div>
<div class=”rt”>Quantity 1</div><br>
<div class=”lt”>Description 21 </div>
<div class=”rt”>Quantity 12</div><br>
<div class=”lt”>Description 321 </div>
<div class=”rt”>Quantity 123</div><br>
</div>
</body>
</html>