Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii every one,iam developing a web project in asp.net, here i comes an requirement that i need to place an three divs side by side,horizontally.Hear i don't want to take a table. please any one can suggest me how can i go with this type of requirement.
thanks in advance


with regards
D Ramu
Posted
Comments
IpsitaMishra 12-Dec-12 5:10am    
you can try with style="display:inline;"

Try this..
HTML
<style>
  .left{float:left; width:33%;}
</style>
  <div  class="left">test1</div>
  <div class="left">test2</div>
  <div class="left">test3</div>
 
Share this answer
 
v3
XML
<div>
  <div style="display:inline;">test
  </div>
  <div style="display:inline;">test
  </div>
  <div style="display:inline;">test
  </div>
</div>
 
Share this answer
 
Don't use table any more,in any project.

Always try to use Div structure.

For this you can use a css property name "Float"

Example.
HTML
<div id="div1" style="float:left">I am</div>
<div id="div2" style="float:left">Not</div>
<div id="div3" style="float:left">a good person</div>


Result of the above code :
I am  

Not  

a good person



See the text appear side by side..what you needed.

Hope that example help you, otherwise please type "Google" for more details. :)

Thanks,
Amit
 
Share this answer
 
v2
Hi check out this
XML
<div style="width: 900px;">
 <div style="float: left; width: 250px;">div1</div>
 <div style="float: left; width: 200px;">div2</div>
 <div style="float: left; width: 150px;">div3</div>
 <br style="clear: left;" />
</div>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900