缺少一些明显的东西并且 CSS 没有正确渲染
出于某种原因,我尝试使用 Twitter 的 Bootstrap 制作一个简单的 HTML,但有些东西坏了我这边,我无法弄清楚出了什么问题。我在 此处 放置了一个 jsFiddle 页面,并附上了屏幕截图。问题是:
- 文本框样式与 Bootstrap 页面上显示的不同
- 标签和文本框未对齐(标签在左侧,文本框在右侧)
- 字段之间没有间距
- 下拉框不起作用。
- 搜索框搞砸了,
我似乎不明白我错过了什么步骤。这里已经很晚了,我可能会用另一双眼睛。有人可以告诉我我是否遗漏了一些明显的东西吗?这些按钮有风格,所以我不太确定发生了什么。
For some reason, I tried making a simple HTML using Twitter's Bootstrap but something is broken on my side and I am unable to figure out what is wrong. I put up a jsFiddle page is here and have attached a screenshot as well. The problems are:
- Text box styles are not as shown on the Bootstrap page
- Labels and Textboxes are not getting aligned (labels on left, textbox on right)
- There is no spacing between fields
- The drop down box does not work.
- The search box is messed up
I don't seem top understand what step I am missing. It is pretty late in here and I might use another set of eyes. Can someone please tell me if I am missing something obvious? The buttons get style so I am not really sure what is happening.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过一点 CSS 来实现这一点。
将输入和标签向左浮动,然后添加一点边距。
演示: http://jsfiddle.net/Lrczj/1/
另请注意,这部分是无效的 HTML :
您只需将文本制作为标签,就像其他文本字段一样。 HTML 中的输入没有结束标记。
更新
仔细查看您的 HTML 后,您似乎忘记将表单字段放入表单中。
输入始终需要进入
内部。
这是您的代码,其中包含表单标签: http://jsfiddle.net/Lrczj/2/
You can achieve this with a little bit of CSS.
Floating the input and the label to the left and then adding a bit of margin.
Demo: http://jsfiddle.net/Lrczj/1/
Also note that this portion is invalid HTML:
You just need to make the text into a label like you have with the other text fields. The input has no closing tag in HTML.
UPDATE
After a closer look at your HTML it looks like you forgot to put your form fields in a form.
Inputs always need to go inside a
<form>[...]</form>
.Here's your code again with the form tags included: http://jsfiddle.net/Lrczj/2/
你的 jsFiddle 看起来不太像你的截图?
我查看了您的标记,发现了一个错误:
您不能将文本放入这样的输入中。您需要将其更改为:
或:
Your jsFiddle doesn't really look like your screenshot for me?
I had a look at your markup and found a mistake:
You can't put text into an input like that. You need to change it to:
or: