小编Ima*_*iei的帖子

如何在 CSS/HTML 中的菜单项之间留出空间

问题:菜单项之间无法留出空间(至少 1 厘米)。

\n

我是初学者,刚刚学习。我知道这个问题对于有经验的用户来说听起来很愚蠢。

\n

这是代码:

\n

\r\n
\r\n
body {\n  height: auto;\n  width: auto;\n  background-image: url("img/top.png");\n}\n\n.header {\n  margin: 0px auto;\n  max-width: 960px;\n}\n\n#header {\n  height: 300px;\n  width: 960px;\n  background-image: url("img/top.png")\n}\n\n#menu ul {\n  margin: 0px auto;\n  margin-left: -20px;\n  /*pull towards left*/\n  margin-right: 20px;\n  /*push towards right*/\n  list-style: none;\n  background: #3d3d5c;\n}\n\n#menu li {\n  display: inline-block;\n}\n\n#menu li a {\n  margin-left: -40px;\n  color: #fff;\n  text-decoration: none;\n  display: block;\n  background: red;\n  padding: 0 10px 0 10px;\n  height: 54px;\n  width: 130px;\n  line-height: 54px;\n}\n\n#menu li a:hover …
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

css ×1

html ×1