css - 'Float' right a column when using display: table? -
im using display table 3 column section of site. im doing need vertically center content of first column.
how can move third column right while still keeping text left aligned?
<span class="cont"> <span class="one">one</span> <span class="two">one</span> <span class="three"> <div class="a">some text , a</div> <div class="b">some more text , b</div> </span> </span> .cont { display: table; border: 1px solid black; width: 100%; } .one, .two, .three { display: table-cell; } .one { background: grey; vertical-align: middle; } .two { background: green; }
one simple solution use float: right
.three
class , vertical-align: top
.two
class:
.cont { display: table; border: 1px solid black; width: 100%; } .one, .two, .three { display: table-cell; } .one { background: grey; vertical-align: middle; } .two { background: green; vertical-align: top; } .three { float: right; }
<span class="cont"> <span class="one">one</span> <span class="two">one</span> <span class="three"> <div class="a">some text , a</div> <div class="b">some more text , b</div> </span> </span>
Comments
Post a Comment