中心DIV? [英] Center DIV?
问题描述
几个月前我已经发布了这个问题但是没有真正令人满意的
答案。所以我想再次发表我的问题:
我如何将DIV居中? DIV中的内容应该是左对齐的,但是DIV本身应该居中,例如:
--------- -------------------------
| |
| =================== |
| | Foo | |
| |另一个foo | |
| |仍然是一个foo-bar | |
| =================== |
| |
| |
----------------------------------
>
应该没有固定的宽度。 DIV的宽度应该是内容的宽度
。
TIA,
Axel Dahmen
" Axel Dahmen" < NO ***** @ NoOneKnows.invalid>写道:
我几个月前发布了这个问题,但当时没有得到真正令人满意的答案。
你肯定做过,不少于33回复。
所以我想再次发表我的问题:>
我们看起来像个自动点唱机?以下是(相同)答案,他们
仍然有效:
http://groups-beta.google.com/group/...e959b6bf7a4f41
-
Spartanicus
Spartanicus写道:
" Axel Dahmen" < NO ***** @ NoOneKnows.invalid>写道:
我几个月前发布了这个问题,但当时没有得到真正令人满意的答案。
你肯定做过,不少于33回复。
所以我想再次发表我的问题:
我们看起来像个自动点唱机?以下是(相同的)答案,它们仍然有效:
http:/ /groups-beta.google.com/group/...e959b6bf7a4f41
原谅我绕过一个非常有趣的主题并冒着给
$ b $可能已经提出的解决方案。
在IE中有效:(在基于gecko的浏览器中无效!)
< center>
< div style =" width:0%; text-align:left; border:2px solid black;">
blabla< br>
blablabla< br>
blabla< br>
< / div>
< / center>
ps ..我很难想象这会花费几个月的时间
这样的东西很简单,所以我已经担心它不会完全让你满意。
gl
martin
2005年1月26日星期三19:28:33 +0100,Ali Babba< Al******@40Bandits.com>写道:
原谅我绕过一个非常有趣的线程,冒着给出一个可能已经提出的解决方案的风险。
什么在起作用IE :(在基于gecko的浏览器中不起作用!)
在这种情况下,你根本没有提供任何解决方案。
-
, - - < - @ - PretLetters:''woest wyf'',遇见vele interesses:----------。
|博客| http://home.wanadoo.nl/b。 de.zoete / _private / weblog.html |
| webontwerp | http://home.wanadoo.nl/b。 de.zoete / html / webontwerp.html |
| zweefvliegen | http://home.wanadoo.nl/b。 de.zoete / html / vliegen.html |
` --------------------------- ----------------------- - < - @ ------------''
Hi,
I''ve posted this question a few months ago but didn''t get a truly satisfying
answer then. So I''d like to post my question again:
How can I center a DIV? The content in the DIV should be left-aligned, but
the DIV itself should be centered, like:
----------------------------------
| |
| =================== |
| | Foo | |
| | Another foo | |
| | Still a foo-bar | |
| =================== |
| |
| |
----------------------------------
There should be no fixed widths. The width of the DIV should be the width of
the content.
TIA,
Axel Dahmen
"Axel Dahmen" <NO*****@NoOneKnows.invalid> wrote:
I''ve posted this question a few months ago but didn''t get a truly satisfying
answer then.
You most certainly did, no less than 33 replies.
So I''d like to post my question again:
What do we look like, a jukebox? Here are (the same) answers again, they
are still valid:
http://groups-beta.google.com/group/...e959b6bf7a4f41
--
Spartanicus
Spartanicus wrote:
"Axel Dahmen" <NO*****@NoOneKnows.invalid> wrote:I''ve posted this question a few months ago but didn''t get a truly satisfying
answer then.
You most certainly did, no less than 33 replies.So I''d like to post my question again:
What do we look like, a jukebox? Here are (the same) answers again, they
are still valid:
http://groups-beta.google.com/group/...e959b6bf7a4f41
forgive me for bypassing a very entertaining thread and risking to give
a solution that may have been proposed already.
what works in IE: (doesnt work in gecko based browsers !)
<center>
<div style="width: 0%; text-align: left; border: 2px solid black;">
blabla<br>
blablabla<br>
blabla<br>
</div>
</center>
ps .. i can hardly imagine it would take someone more than a few months
to come with something simple as this, so i already fear that it wont be
completely to your satisfaction.
gl
martin
On Wed, 26 Jan 2005 19:28:33 +0100, Ali Babba <Al******@40Bandits.com> wrote:
forgive me for bypassing a very entertaining thread and risking to give a
solution that may have been proposed already.
what works in IE: (doesnt work in gecko based browsers !)
In that case, you didn''t provide any solution at all.
--
,-- --<--@ -- PretLetters: ''woest wyf'', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------''
这篇关于中心DIV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!