HTML 表单控制换行符
有没有办法在 HTML 中的表单控件中强制换行。我使用的是下拉菜单,有些选项占用了太多空间。如果可能的话,我想将它们分成多行。有什么想法吗?
编辑: 以下是有问题的菜单的代码:
<select name="Select1" multiple="multiple">
<option selected="selected">(Any)</option>
<option>Acadia National Park</option>
<option>Alaska Railroad</option>
<option>Arapho-Roosevelt<br/>National Forest</option>
<option>BLM</option>
<option>Cades Cove Heritage Tours</option>
<option>Cape Cod Commission</option>
<option>Cape Cod National Seashore</option>
<option>Cape Cod Regional Transit Authority</option>
<option>City of Baltimore DOT</option>
<option>City of Commerce City</option>
<option>City of Flagstaff</option>
<option>City of Jacksonville</option>
<option>City of Lowell, MA</option>
<option>City of New Bedford, Office of Planning</option>
<option>City of Augustine, FL</option>
<option>City of The Dalles</option>
<option>City of Visalia</option>
<option>Codevisa Transit with Municipality of San Juan
</option>
<option>Colonial National Historical Park</option>
<option>Cuyahoga Valley National Park</option>
<option>Cuyahoga Valley Scenic Railroad</option>
<option>Delaware Water Gap National Recreation Area
</option>
<option>Denali National Park and Preserve</option>
</select>
Is there a way to force a line break in a form control in HTML. I'm using drop-down menus, and some of the choices are taking up a little too much space. I'd like to break them into multiple lines if possible. Any ideas?
Edit:
Heres the code for the problematic menu:
<select name="Select1" multiple="multiple">
<option selected="selected">(Any)</option>
<option>Acadia National Park</option>
<option>Alaska Railroad</option>
<option>Arapho-Roosevelt<br/>National Forest</option>
<option>BLM</option>
<option>Cades Cove Heritage Tours</option>
<option>Cape Cod Commission</option>
<option>Cape Cod National Seashore</option>
<option>Cape Cod Regional Transit Authority</option>
<option>City of Baltimore DOT</option>
<option>City of Commerce City</option>
<option>City of Flagstaff</option>
<option>City of Jacksonville</option>
<option>City of Lowell, MA</option>
<option>City of New Bedford, Office of Planning</option>
<option>City of Augustine, FL</option>
<option>City of The Dalles</option>
<option>City of Visalia</option>
<option>Codevisa Transit with Municipality of San Juan
</option>
<option>Colonial National Historical Park</option>
<option>Cuyahoga Valley National Park</option>
<option>Cuyahoga Valley Scenic Railroad</option>
<option>Delaware Water Gap National Recreation Area
</option>
<option>Denali National Park and Preserve</option>
</select>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试更改下拉菜单的宽度。您可以发布您当前拥有的代码吗?
Try changing the width of the drop-down menu. Can you post the code you currently have?