无法让 html 元素位于同一行
我有这个页面: http://www.problemio.com 顶部有一个黑色栏,其中有搜索和一个下拉菜单。看起来还不错。
但然后我有另一个这样的页面: http://www.problemio.com/category。 php?category_id=1 具有这两个元素,但由于某种原因,搜索出现在栏的左上角。
如何使这些元素像在 Problemio.com 主页上那样显示?
谢谢!
I have this page: http://www.problemio.com which has a black bar on top which has search and a dropdown menu. That looks reasonably ok.
But then I have another page like this: http://www.problemio.com/category.php?category_id=1 which has those two elements, but for some reason, the search appears on the top left of the bar.
How can I make these elements appear as they do on the home page of problemio.com ?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您已将其绝对定位在搜索框上方。修复绝对定位就可以了。
You have it absolutely positioned over your search box. Fix the absolute positioning and you should be fine.
您的内部页面上没有
main_styles.css
,其中包含以下样式:you don't have you
main_styles.css
on the interior page, which has this style in it:在您根据需要显示搜索框的页面中 [problemio.com],div 的 css 值是“float: right”。这是您在另一页上需要的值。
In your page which displays the search box as you desire [problemio.com] the div has the css value 'float: right'. This is the value you need on the other page.
我刚刚在您 5 分钟前发布的其他问题的评论中回答了这个问题。
您的问题是,带有
nav
类的主页 div 从main_index.css
获取值,而另一个页面从main.css
获取值。< br>两者之间存在一些不一致,可能会导致问题。 Firebug 或 devtools 将帮助您调试此类问题。
I just answered this in the comments of your other question, posted 5 min ago.
Your problem is that the home page div with class
nav
takes values frommain_index.css
and the other page takes values frommain.css
.There are some inconsistencies between the two which might lead to the problem. Firebug or devtools will help you debug these kind of problems.