CSS 表单代替表格 2011
当我遇到诸如需要 3 个彼此相邻的文本框(如电话号码)或文本框旁边的下拉列表之类的障碍时,我放弃了使用 CSS 进行表单样式设置。如果没有好的表格,我就无法想出一种可靠的方式来设计它。
我正在考虑重新使用 CSS 来设置表单样式;我不知道:
- 将标题放在字段顶部还是左侧更有用。
- 如何设计事物的样式,以便即使有几个相邻的表单元素也能很好地放置。
参考?这仍然是一个白日梦吗?
I gave up on using CSS for form styling when I hit snags like requiring 3 textboxes adjacent to one another (like a phone number) or a dropdown list next to a textbox. I just couldn't come up with a reliable way to style it without good ol' TABLES.
I'm thinking about going back to CSS for form styling; I don't know:
- Whether it's more usable to have captions on top or on the left of the field.
- How to style the things so they place nicely even with a couple of adjacent form elements.
References? Is this still a pipe dream?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你的意思是这样吗?
基本上我们创建一个伪表
并且标记将是
各个单元格类名用于应用特定的CSS(我的标记是网格)
You mean like this?
Basically we create a pseudotable
And the markup would be
The individual cell classnames serve to apply specific css (my markup is a grid)
有几个专门为布局表单而设计的 CSS 模板。
我希望这可以帮助您指明一个富有成效且令人敬畏的方向。小心。
There are a couple of CSS templates designed specifically for laying out forms.
I hope this helps point you in a productive and awesome direction. Take care.
不,这是很有可能的,而且我(和许多其他人)多年来一直这样做。
查看
float: (left|right)
和display: (inline|inline-block)
。No, it is very possible, and I (and many others) have been doing it for years.
Look at
float: (left|right)
anddisplay: (inline|inline-block)
.其他人给了你一些有效的建议...如果你仍然有问题,你可以尝试像 formee 这样的表单 CSS 框架... http ://www.formee.org/
Other people give you some valid suggestions... if you still have problems you can try a form css framework like formee... http://www.formee.org/