NewBee NewBee - 3 months ago 6
CSS Question

Text that is centered and right-aligned not rendered on the same line

I need to get text in

center
as well as on the
left
side. If someone can help me rectify the error where I am going wrong ?

Pictorial way to be more precise.

Pictorial way to be more precise.

Running fiddle

Here's HTML:

<div class="container" id="values">
<div class="row">
<div class="header col-md-10 col-md-offset-1">
<div class="center-block" style='background:yellow'>
<div class="text-center">
<div id="main-text">
<h3>TEXT</h3>
</div>

<div class="side_section">
<div id="text2" class="pull-right clearfix" style='background:blue'>
Text2
</div>

<div id="text1" class="pull-right clearfix" style='background:blue'>
Text1
</div>

</div>
</div>
</div>
</div>
</div>
</div>

Answer

add this style :

.side_section{
    position: absolute;
    top: 0px;
    right: 20px;
}

https://jsfiddle.net/gueqvxua/2/

Comments