javascript - Is there a better way to replicate this CSS code -
i'm looking better way replicate without having use \a after every line break. it's going used on github-pages can't, knowledge, use server side language.
i want have separate file can withdraw lists , put them on different pages.
.list1:before { display: block; white-space: pre; content: "list1 text \a list1 text \a list1 text" ; } .list2:before { display: block; white-space: pre; content: "list2 text \a list2 text \a list2 text" ; } .list3:before { display: block; white-space: pre; content: "list3 text \a list3 text \a list3 text" ;}
<ul class=list1></ul> <ul class=list2></ul> <ul class=list3></ul>
you should try use nth-child like:
.content div::before { display: block; white-space: pre; } .content div:nth-child(1)::before { content: "list1 text \a list1 text \a list1 text" ; } .content div:nth-child(2)::before { content: "list2 text \a list2 text \a list2 text" ; } .content div:nth-child(3)::before { content: "list3 text \a list3 text \a list3 text" ; }
<div class="content"> <div></div> <div></div> <div></div> </div>
Comments
Post a Comment