控制fieldset的大小,关键要对它包含的子控件进行控制,否则在某些浏览器中看不到想要的效果,
具体例子看下面的代码:
<html>
<head>
</head>
<body>
<fieldset style="height:340px;width:100px;">
<legend>
Testing
</legend>
</fieldset>
<fieldset style="height:340px;width:100px;">
<legend>
Testing
</legend>
<div style="width:auto;height=auto">
</div>
</fieldset>
<!--这里在google chrome是可以起到作用的,即:width:20px;不会受到子控件影响
--而在ie和firefox中就不会
--所以,如果要在fieldset中对对其大小进行控制的话,不能简单设置其width属性,
--而是要设置它子控件的width属性(不然那就只有google chrome中才是你想要的效果)-->
<fieldset style="height:340px;width:20px;">
<legend>
Testing
</legend>
<div style="width:5040px;height=auto">
</div>
</fieldset>
<fieldset style="height:340px;">
<legend>
Testing
</legend>
<div style="width:5040px;height=auto">
</div>
</fieldset>
<!--这个html在不同浏览器中效果也不同
--在ie中前两个fieldset在宽度足够的情况下会横向排列
--而在google chrome和firefox中他们都是独立行的 -->
</body>
</html>
也就是说比如你想要你的fieldset是800*600(这里的高度不理了(800),我没有试,下面讲的都是针对宽度的(600)),
其具体做法就是不要管fieldset的width,只需设置它的子控件宽度最宽为600即可。
再有分享下使用 easy UI中tab控件的经验:
(1)在ie中tab如果不设置宽度它可以自动根据大小自己设置(只是在某些情况下,因为我在我的页面中外层的tab也没有进行什么设置,他在不同浏览器上都工作的很好,而
只是内嵌的这个tab出现了问题,而这个tab 恰恰是放在fieldset中的(嘎嘎。。))
(2)在firefox和google chrome中都会有问题会变得很大,以至于撑得fieldset变得很大。