如何使用div对齐表格之类的表格?
这是我的代码:
<div>
<label>Name</label><input type="text" id='name'/><br />
<label>Email</label><input type="text" id='email'/><br />
<label>Place</label><input type="text" id='place'/><br />
</div>
我是 CSS 新手,我不希望表格对齐,但完美应该是一样的,并且不想将样式应用于单个元素。 任何帮助表示赞赏。
Here is my code:
<div>
<label>Name</label><input type="text" id='name'/><br />
<label>Email</label><input type="text" id='email'/><br />
<label>Place</label><input type="text" id='place'/><br />
</div>
I'm new to CSS, I don't want table to get aligned, but the perfection should be like same, and don't want to apply style to individual elements.
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您想要将标签和输入彼此对齐,在这种情况下您将需要浮动。这是快速的 css 代码:
我认为应该可以:)
I'm assuming you want to align the labels and inputs next to one another, in which case you'll be needing floats. Here's the quick css code:
I think that should work :)