在这里你去:
Live Demo
我把增加cursor: pointer
到按钮的自由。如果将它们从<img>
标签更改为<a>
标签,从语义的角度来看会更好。
我还将size="4"
添加到了<select>
标签,以确保不同浏览器之间的高度一致。
我没碰过JS。
测试IE7/8,Firefox,Chrome,Opera,Safari。
CSS:
#container {
overflow: auto;
background: #ccc
}
.buttons {
float: left;
width: 30px;
padding: 0 3px
}
.buttons img {
cursor: pointer
}
.dropdown {
float: left;
width: 160px
}
HTML:
<div id="container">
<div class="buttons">
<img src="http://www.jgrmx.com/cgr/tiles/generic/images/icons/arrow-up.gif" id="up_button"><br>
<img src="http://www.jgrmx.com/cgr/tiles/generic/images/icons/arrow-down.gif" id="down_button">
</div>
<div class="dropdown">
<select multiple=true id="left" size="4">
<option>Patricia J. Yazzie</option>
<option>Michael A. Thompson</option>
</select>
</div>
<div class="buttons">
<img src="http://www.jgrmx.com/cgr/tiles/generic/images/icons/arrow-left.gif" id="add_button"><br>
<img src="http://www.jgrmx.com/cgr/tiles/generic/images/icons/arrow-right.gif" id="remove_button">
</div>
<div class="dropdown">
<select multiple=true id="right" size="4">
<option>Kevin C. Bounds</option>
<option>Patricia J. Yazzie</option>
<option>Michael A. Thompson</option>
<option>Mark D. Mercer</option>
</select>
</div>
</div>
在[jsFiddle](http://jsfiddle.net)上发布您的表格解决方案。这样,有人可以创建看起来相同的东西,但是使用CSS代替布局。 – thirtydot 2011-01-24 23:52:54
感谢您的提示 - 我以前没有看过该网站。这是我想要去的:http://jsfiddle.net/rTJHK/4/ – jmricker 2011-01-25 00:10:17