简体   繁体   English

HTML,CSS问题:HTML字段集的放置/定位

[英]HTML, CSS issue: HTML fieldset placing/positioning

I have a HTML page with personal information details using text boxes. 我有一个HTML页,其中包含使用文本框显示的个人信息详细信息。 I have two fieldsets as in 我有两个字段集

this Jsfiddle . 这个Jsfiddle

As noticed that the fieldsets are placed up and down position. 如前所述,字段集处于上下位置。 My question is that 我的问题是

How can I placed these two fieldsets side by side (left & right position)? 如何将这两个字段集并排放置(左右位置)?

Thank you 谢谢

I removed the form width: 40%; 我删除了表格width: 40%; and assigned a float:left; 并分配了一个float:left; property on those fieldsets. 这些字段集上的属性。 Here is the corrected fiddle: Try me 这是纠正的小提琴: 试试我

Remove width:40% from form & give float to your fieldsets . form删除width:40% ,并为您的fieldsets float

Check this: http://jsfiddle.net/XdRYT/8/ 检查此: http : //jsfiddle.net/XdRYT/8/

Simplest solution is create table with two cells and one row and place each fieldset in different cell. 最简单的解决方案是创建具有两个单元格和一行的表,并将每个字段集放在不同的单元格中。 Another bit more complicated is to use CSS to format it. 更为复杂的一点是使用CSS对其进行格式化。

Change fieldset stye to below 将fieldset stye更改为以下

  fieldset {
            border: 1px dotted #61B5CF;
            margin-top: 1.4em;
            padding: 0.6em;
            float:left;
            width:40%;
           }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM