WordPress.org

Ready to get started?Download WordPress

Forums

styling wp_list_cats (7 posts)

  1. spk
    Member
    Posted 5 years ago #

    hey all

    i'm using wp_list_cats to create a horizontal menu of categories. i used a 'display: inline' to make the categories display horizontally, and i now i would like to add a line/character that separates each category from the other; to get something like:

    NEWS | ABOUT | LINKS | RECENT | WHATEVER

    could anyone please give me a hint on how to get this done using css?

    thanx
    spk.

  2. jbbrwcky
    Member
    Posted 5 years ago #

    You could try the :before pseudo-element:

    ul li:before {
      content: "| ";
    }
    ul+li:before {
      content: "";
    }
  3. spk
    Member
    Posted 5 years ago #

    thanks. works, more or less. but generated content is not supported by the crappy IE, right?

  4. whooami
    Member
    Posted 5 years ago #

  5. spk
    Member
    Posted 5 years ago #

    any other trick to do that without using the before pseudo-element?

  6. spk
    Member
    Posted 5 years ago #

    or, if i already use the before pseudo, how should i prevent it from putting a character before the first element? cause what i get now looks like:

    || NEWS | ABOUT | LINKS | RECENT | WHATEVER

  7. whooami
    Member
    Posted 5 years ago #

    could anyone please give me a hint on how to get this done using css?

    any other trick to do that without using the before pseudo-element?

    Not really.

Topic Closed

This topic has been closed to new replies.

About this Topic