Two div blocks on same line
CSS:
#block_container
{
text-align:center;
}
#bloc1, #bloc2
{
display:inline;
}
HTML
<div id="block_container">
<div id="bloc1"><?php echo " version ".$version." Copyright © All Rights Reserved."; ?></div>
<div id="bloc2"><img src="..."></div>
</div>
Also, you shouldn't put raw content into <div>
's, use an appropriate tag such as <p>
or <span>
.
Edit: Here is a jsFiddle demo.
How to align two div tags horizontally in the same line inside a main div tag?
css
display:inline-block
add div right part and left part css
How do I keep two divs on the same line?
You can make two divs inline this way:
display:inline;
float:left;
Align two divs on the same line without modifying the HTML
<div class="main_one">
<div class="number one">Title A</div>
</div>
<div class="main_two">
<div class="number two">Title B</div>
</div>
<div class="main_three">
<div class="number one">Title C</div>
</div>
<div class="main_four">
<div class="number two">Title D</div>
</div>
<style type="text/css">
.main_one{
float:left;
}
.main_two{
float:left;
}
.main_three{
clear:both;
float:left;
}
.main_four{
float:left;
}
</style>
Two div elements in the same line
Use the css width
property with float
attribute. Use padding-top
to maintain it on same row.
.countFieldCell{width:10%;float:right;text-align:right;padding-top:10px;}.outerCountSection{width:90%;}
<div class="countFieldCell"> <c:if test="${fn:length(intgList) > 0}">Total: 1</c:if></div><div class="outerCountSection"> <table id="esignTable" style="width:100%;table-layout:fixed"> <thead> <tr> <th align="center" class="fieldLabelCell">Line of Business</th> <th align="center" width="14%" class="fieldLabelCell">Insured</th> <th align="center" width="15%" class="fieldLabelCell">Customer<br>Phone</th> <th align="center" width="16%" class="fieldLabelCell">Policy #</th> <th align="center" width="19%" class="fieldLabelCell">E-Sign<br>Created Date</th> <th align="center" class="fieldLabelCell">Customer<br>Email</th> <th align="center" class="fieldLabelCell" style="text-align: left"># of E-Sign Documents</th> </tr> </thead> <tbody> </tbody> </table></div>
Placing two divs on the same line with 'inline' not working
Its because you have a div
inside which is block
by default. Apply display:inline-block
to all elements inside parent button div
Stack Snippet
.main>* { display: inline-block;}
<div class="main"> <div> <button></button> <button></button> </div> <button></button></div>
Two div on the same line
Because you are floating the element.
Remove the float: left;
, or make it display: block;
See also: Difference Between 'display: block; float: left' vs. 'display: inline-block; float: left'?
<html> <body style="width: 20px;"> <div style="width: auto; display: block; white-space: nowrap;"> <div style="display: inline-block;">First text</div> <div style="display: inline-block;">Second text</div> </div> </body></html>
Related Topics
Min-Height Does Not Work with Body
Right Align an Image Using CSS HTML
Twitter Bootstrap Multiple Accordions But Only One Open Panel at a Time
How to Make a Line Before and After My H1 Tag
Base64 Encoded Image Is Not Showing in Gmail
How to Convert Screen Coordinates to Document Space in a Scaled Svg
Which Elements Support the ::Before and ::After Pseudo-Elements
Padding Is Not Working in Safari and Ie in Select List
How to Get a List of All Countries/Cities to Populate a Listbox
How to Display an .HTML Document , or .HTML Fragment at CSS Content
Set Width of Dropdown Element in HTML Select Dropdown Options
Pre-Populate HTML Form File Input
Bootstrap 4 - Sticky Footer - Dynamic Footer Height
Access Control Allow Origin Issue in Angular 2