- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › How to place a link after every nth paragraph using css
The situation: a page with hundreds of single-paragraph testimonials for a doctor.
The need: to put a ‘top of page’ link after every 5th paragraph
The problem: p:nth-of-type(5n):after { content:"xx"; }
can only contain text, not a link
The question: is there a css solution to this? I’m not good at javascript!
Kip
Nope…only JS can actually add actual content elements for you.
Plus…hundreds is waaaay too many….no-one will read that many. Try no more than 10….and even that seems excessive.
Thanks, Paulie_D. I’ll struggle on with JS.
I agree it is too much but it is the doctor’s orders!
Moved to JS section to see if anyone can assist.
You might use a “scroll-to-top script” instead of placing actual links. More user-friendly, IMO.
And, if you did want to use css only, you could just make one link and give it a fixed position.