我怎样才能并排放置3个div,即水平放置 [英] How can i palce 3 div's side by side i.e horizontally

查看:70
本文介绍了我怎样才能并排放置3个div,即水平放置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人,我都在asp.net开发一个网络项目,在这里我要求我需要并排放置一个三个div.Hear我不想拿桌子。请任何人都可以建议我如何满足这种要求。

提前感谢





关于

D Ramu

解决方案

试试这个..

 <   style  >  
left { float left; width 33%; }
< / style >
< div < span class =code-attribute> class = left > test1 < / div >
< div class = left > test2 < / div >
< div class = left > test3 < / di v >


 <   div  >  
< div 样式 = display:inline; > test
< / div >
< div 样式 = display:inline; > test
< / div >
< div style = display:inline; > test
< / div >
< / div >


在任何项目中都不要再使用表了。



总是尝试使用 Div 结构。



为此您可以使用css属性名称 Float



示例。

 <   div     id   =  div1    style   =   float:left >  <   / div  >  
< div id = div2 style = float:left > < / div >
< div id = div3 style = float:left > 一个好人< / div >





上述代码的结果:

我是 



不是 



一个好人






看到文字并排显示......你需要什么。



希望该示例可以帮助您,否则请输入 Google 以获取更多详细信息。:) />


谢谢,

Amit


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

解决方案

Try this..

<style>
  .left{float:left; width:33%;}
</style>
  <div  class="left">test1</div>
  <div class="left">test2</div>
  <div class="left">test3</div>


<div>
  <div style="display:inline;">test
  </div>
  <div style="display:inline;">test
  </div>
  <div style="display:inline;">test
  </div>
</div>


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.

<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


这篇关于我怎样才能并排放置3个div,即水平放置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆