Text Separators for LI Elements

You can use pseudo-elements to include text after an element and you can use CSS3 selectors to remove the trailing slash from the last element.

#footer_menu li:after {
    content: "https://stackoverflow.com/";
}
#footer_menu li:last-child:after {
    content: "";
}

EDIT:

The whole thing can be done in one line with better CSS3.

#footer_menu li:nth-child(n+2):before {
    content: "https://stackoverflow.com/";
}

EDIT: EDIT:

It’s even easier than that.

#footer_menu li + li:before {
    content: "https://stackoverflow.com/";
}

Leave a Comment

tech