Make whole
  • as link with proper HTML
  • 前端 未结 9 2098
    忘掉有多难
    忘掉有多难 2021-02-02 13:23

    I know this has been up a lot of times before, but I couldn\'t find any solution in my specific case.

    I\'ve got a navigation bar and I want the whole

  • 9条回答
    •  不知归路
      2021-02-02 13:37

      I myself just had this problem.

      The answer couldn't be simpler:

      
      Wrong:
      .menuitem {
          list-style-type:        none;
          display:                 inline;
          margin-left:            5px;
          margin-right:            5px;
          font-family:            Georgia;
          font-size:                11px;
          background-color:        #c0dbf1;
          border:                 1px solid black;
          padding:                10px 20px 10px 20px;
      }
      
      Correct
      .menuitem a {
          list-style-type:        none;
          display:                 block;
          margin-left:            5px;
          margin-right:            5px;
          font-family:            Georgia;
          font-size:                11px;
          background-color:        #c0dbf1;
          border:                 1px solid black;
          padding:                10px 20px 10px 20px;
      }
      

      in other words, you want to apply the css that the LI's had to the A element. Making sure that the A is a block line element

    提交回复
    热议问题