对齐3< div>单线。 [英] Align 3 <div> s in single line.
问题描述
大家好,
我需要在一行中对齐3个
< div id = content-left align = left unselectable = on > 左< / div > < div id = content-center 对齐 = center 无法选择 = on > 中心< / div > < div id = content-right align = right unselectable = on > 正确< / div > ;
OutPut
------------- ---------
剩下
中心
正确
那么如何查看下面的内容。
左中右边
可以有人帮我解决这件事吗?
谢谢和问候,
Chiranthaka
是的,这是可能的......
检查这个 http://jsfiddle.net/v9djw3t3/1/ [ ^ ]
希望您正在寻找...
Hi All, 这篇关于对齐3< div>单线。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
div {float:left;}
如果你的css文件中有其他内容,你将不得不玩css。请阅读浮点数,弹性箱等,因为它将有助于理解这种对齐的东西。
I need to align 3
<div id="content-left" align="left" unselectable="on">Left</div><div id="content-center" align="center" unselectable="on">Center</div><div id="content-right" align="right" unselectable="on">Right</div>
OutPut
----------------------
Left
Center
Right
So how can I view the content like in the below.
Left Center Right
Could someone help me to solve this matter?
Thanks and regards,
ChiranthakaYes it is possible...
Check this http://jsfiddle.net/v9djw3t3/1/[^]
Hope you are looking for this...There are a few ways to do this. Your code above, without the accompanying possible existing css file displays differently as is in Chrome. One, you need to take out the inline styling (within elements) at least the "align=" stuff and use the style tag in your head section or a css file for good programming practice. However the following produces what you want initially (in Chrome using brackets editor):
div {float: left;}
You will have to play with the css if there are other things at play in your css file. Please read up on floats, flexbox etc as it will assist greatly in understanding this alignment stuff.