CSS 边框未出现 [英] CSS borders not appearing

查看:29
本文介绍了CSS 边框未出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设计我的导航菜单设计以反映 timeanddate.com 上的设计,如下图所示:

I'm attempting to style my navigation menu design to reflect the one on timeanddate.com, as seen in this image:

为了创建颜色,他们在 CSS 中使用了简单的底部和左侧边框.

To create the colors, they're using a simple bottom and left border in CSS.

我正在尝试为我的网站沙箱中的

  • 标签添加边框,http://www.escapetech.com:8080.

    I'm attempting to add a border to my <li> tags on my website sandbox, http://www.escapetech.com:8080.

    我正在使用以下 CSS:

    I'm using the following CSS:

    .anylinkcss li {
      list-style-type: none;
    }
    
    .participate li {
      list-style-type: square;
      border-left-color: #fa514d;
    }
    
    #navigation_bar {
      height: 31px;
      list-style: none;
      width: 1000px;
      margin-top: 15px;
    }
    
    #navigation_bar li {
      float: left;
      padding-right: 35px;
      padding-left: 10px;
      margin: auto 0px;
      vertical-align: middle;
    }
    
    #anylinkmenu3, #anylinkmenu4, #anylinkmenu5, #anylinkmenu6, #anylinkmenu7 {
      position: absolute;
      line-height: 18px;
      z-index: 20;
      background-color: #000;
      text-align:left;
      visibility: hidden;
      left:  421px;
      top:207px;
      padding: 7px;
      padding-left: 25px;
    }
    

    #anylinkcss3 和进一步表示下拉列表的样式,而 #navigation_bar 样式用于整个栏.无论我在哪里添加任何边框样式,都不会出现,即使在我注释掉所有 CSS 代码并且只在这些 ID 和类上包含一个边框之后也是如此.

    The #anylinkcss3 and further represent styles for the drop downs, while the #navigation_bar styles are for the whole bar. No matter where I add any border styles, none appear, even after I comment out all CSS code and just include a border on these IDs and classes.

    我当前的菜单位于我上面发布的链接中,如果有人可以查看并告诉我为什么可能会出现边框问题,我将不胜感激.这是我的第一篇 Stack Exchange 帖子,所以我希望这是正确的格式!

    My current menu is live at the link I posted above, I would greatly appreciate if someone could take a look and let me know why there may be any issues with borders appearing. This is my first Stack Exchange post so I hope that this was correctly formatted!

    推荐答案

    虽然设置了宽度和颜色,但不能省略带边框的样式参数.

    Although you set the width and color, you can not leave out the style parameter with borders.

    要获得您在图像中呈现的预期效果 - jsFiddle 演示一个>

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆