How to display two div element in one line and align the whole in center?
I know that we can display two div elements in one line by giving float:left;.
But For Example:
I want the output to be
"Hello, How are u doing?" that to be aligned centered
If we give float:left; we get the text in one line but aligned to left.
Is there any other way to get the desired output?
I know that we can display two div elements in one line by giving float:left;.
But For Example:
Code:
<div class="MainDiv" id="div1">
<div class="InnerDiv1" id="div2">
<span>Hello,</span>
</div>
<div class="InnerDiv2" id="div3">
<span>How are u doing?</span>
</div>
</div>
"Hello, How are u doing?" that to be aligned centered
If we give float:left; we get the text in one line but aligned to left.
Is there any other way to get the desired output?
Comment