折叠阻止内容宽度 [英] Collapse Block to Width of Content

查看:72
本文介绍了折叠阻止内容宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将块元素(如DIV)的宽度折叠为其内容?


我试图通过将页边距设置为自动来使页面居中,但

表格的宽度扩展以填充页面(根据规格)。

How do I collapse the width of a block element, such as DIV, to its contents?

I am trying to centre a form within the page by setting its margins to auto, but
the width of the form expands to fill the page (as per specs).

推荐答案

Borris< no**@none.com>写道:
Borris <no**@none.com> wrote:
我试图通过将其边距设置为自动来将页面中的表格居中,但是表单的宽度会扩展以填充页面(根据规格) )。
I am trying to centre a form within the page by setting its margins to auto, but
the width of the form expands to fill the page (as per specs).




指定表单元素的宽度。


-

Spartanicus



Specify a width for the form element.

--
Spartanicus


Spartanicus写道:
Spartanicus wrote:
我试图通过将页边距设置为auto来使页面居中,但是
表单的宽度会扩展以填充页面(根据规格)。
I am trying to centre a form within the page by setting its margins to auto, but
the width of the form expands to fill the page (as per specs).



指定表单元素的宽度。



Specify a width for the form element.




我一直在做这个黑客,但我希望表单自动调整

宽度到内容。 (具体来说,我正在使用ASP.NET母版页,因此每个页面都包含相同的表单元素。)



I''ve been doing that as a hack, but I''d like the form to automatically size its
width to the contents. (Specifically, I''m using ASP.NET master pages, so every
page is enclosed by the same form element.)


Borris写道:
Spartanicus写道:
Spartanicus wrote:
我试图通过将页边距设置为auto来将页面置于页面中心,但是
表单的宽度扩展以填充页面(根据规格)。
I am trying to centre a form within the page by setting its margins to auto, but
the width of the form expands to fill the page (as per specs).



指定表单元素的宽度。



Specify a width for the form element.



我我一直在做这个黑客,但我希望表单能够自动调整内容的宽度。 (具体来说,我正在使用ASP.NET母版页,所以每个页面都被相同的表单元素包围。)



I''ve been doing that as a hack, but I''d like the form to automatically size its
width to the contents. (Specifically, I''m using ASP.NET master pages, so every
page is enclosed by the same form element.)




display:inline


-

jmm(连字符)列表(at)sohnen-moe(点)com

(删除.AXSPAMGN用于电子邮件)



display:inline

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


这篇关于折叠阻止内容宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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