html - 左右浮动表格有问题

标签 html css

我在下面有一个 jsfiddle:

http://jsfiddle.net/C95uc/3/

我的 CSS 有问题。我想在左侧上方显示两个下拉菜单,并且想在右侧显示文本输入,但我该怎么做?

下面是html代码:

<div class='lt-container'>
<form id='moduleForm'>
<select name="module" id="modulesDrop">
<option value="">Please Select Module</option>
    </select>
    </form>
</div>




<div  class='lt-container' >
<form id='moduleExistForm'>
 <select name="module" id="modulesDrop">
<option value="">Please Select Course</option>
    </select> </form> 
</div>


<div  id='rt-container' >
<form id='detailsForm'>


    <table>
    <tr>
    <th></th>
    <td><input type='hidden' id='idmodule' name='moduleid' value='' /> </td>
    </tr>
    <tr>
    <th>Module ID:</th>
    <td><input type='text' id='nomodule' name='moduleno' readonly='readonly' value='' /> </td>
    </tr>
    <tr>
    <th>Module Name:</th>
    <td><input type='text' id='namemodule' name='modulename' readonly='readonly' value='' /> </td>
    </tr>
    <tr>
    <th>Credits:</th>
    <td><input type='text' id='credits' name='creditsname' readonly='readonly' value=''/> </td>
    </tr>
    </table>
    <div id='moduleAlert'></div>

    </form>



    </div>

CSS:

.lt-container, #rt-container {
 float: left;   
 }

#rt-container {
 clear: right;
 margin-left: 5%;    
}

最佳答案

http://jsfiddle.net/C95uc/4/

<div class='lt-container'>
<form id='moduleForm'>
<select name="module" id="modulesDrop">
<option value="">Please Select Module</option>
    </select>
    </form>

<form id='moduleExistForm'>
 <select name="module" id="modulesDrop">
<option value="">Please Select Course</option>
    </select> </form> 
</div>

两者都是 <select>同去<div class='lt-container'>

关于html - 左右浮动表格有问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13769000/

相关文章:

javascript - 将 javascript 放入 jquery .html 函数

html - IE 和 Firefox <Table> 单元格渲染差异

javascript - HTML 元素 ID 的合法字符是什么?

jquery - 通过 ajax 加载页面时,Javascript 不起作用

javascript - Ember 组件事件未触发

php - Web 应用程序上的网络摄像头捕获

html - 从图像上移开后如何隐藏文本?

html - CSS-3 'target-new' 和 html5 目标 ='_blank' 用于在新选项卡中打开

css - 如何覆盖 vaadin 元素的样式?

html - 如何将特定的 flex 元素与其父元素的水平中心对齐?