How to make the HTML link activated by clicking on the
  • ?
  • 后端 未结 14 2051
    没有蜡笔的小新
    没有蜡笔的小新 2020-12-07 16:18

    I have the following markup,

    14条回答
    •  北荒
      北荒 (楼主)
      2020-12-07 17:05

      How to make the HTML link activated by clicking on the

    • ?

    • By making your link as big as your li: just move the instruction

      display: block;
      

      from li to a and you are done.

      That is:

      #menu li
      {
          /* no more display:block; on list item */
      
          list-style: none;
          background: #e8eef4 url(arrow.gif) 2% 50% no-repeat;
          border: 1px solid #b2b2b2;
          padding: 0;
          margin-top: 5px;
      }
      
      #menu li a
      {
          display:block; /* moved to link */
          font-weight: bold;
          text-decoration: none;
          line-height: 2.8em;
          padding-right:.5em;
          color: #696969;
      }
      

      Side note: you can remove "ul" from your two selectors: #menu is a sufficient indication except if you need to give weight to these two rules in order to override other instructions.

    提交回复
    热议问题