简体   繁体   English

CSS下拉菜单更改div背景颜色

[英]CSS Dropdown Menu Changes div Background Color

I created a little site tonight about watches. 今晚我创建了一个有关手表的小网站。 You can visit it at horology dot info. 您可以在钟点信息上访问它。

(Please do not post the actual URL of my site in your response.) (请不要在您的回复中发布我网站的实际URL。)

I was wondering why the dropdown menu -- which I got from https://csswizardry.com/2011/02/creating-a-pure-css-dropdown-menu/ -- appears in id="content" rather than id="banner" (with the blue background). 我想知道为什么下拉菜单-我从https://csswizardry.com/2011/02/creating-a-pure-css-dropdown-menu/中获得的菜单出现在id =“ content”而不是id = “横幅”(蓝色背景)。 I want the menu to appear underneath the logo text with the blue background. 我希望菜单显示在带有蓝色背景的徽标文本下方。 Additionally, does anyone know why there is a lot of vertical space before the banner? 另外,有人知道横幅前为什么会有很多垂直空间吗? I also want less empty vertical space at the top. 我还希望顶部的垂直空白空间更少。 By the way, I am using Firefox on Ubuntu Linux. 顺便说一句,我在Ubuntu Linux上使用Firefox。

Add display property (display: inline-block;) to your #banner class in "/horology.css" 将显示属性(显示:inline-block;)添加到“ /horology.css”中的#banner类中

 #banner { width: 800px; background-color: #00C; display: inline-block; } 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM