What would be the best method to code heading/title for
    or
      , Like we have in ?
      前端 未结 6 1175
      青春惊慌失措
      青春惊慌失措 2021-02-01 00:40

      What would be the best method to code heading/title of

        or
          ? Like we have
      in
      6条回答
      •  孤街浪徒
        2021-02-01 01:22

        I like to make use of the css :before and a data-* attribute for the list

        HTML:

        • list item
        • list item
        • list item

        CSS:

        ul:before{
            content:attr(data-header);
            font-size:120%;
            font-weight:bold;
            margin-left:-15px;
        }
        

        This will make a list with the header on it that is whatever text is specified as the list's data-header attribute. You can then easily style it to your needs.

      提交回复
      热议问题