html - Adding single image after a specific list item -
This is probably a bit of a silly question but to achieve some CSS style around me I have an image targeting specific I want to add items.
This will add the image after all the li items.
. MenuuStyling li: after {content: url ('../img/arrowActive.png'); } What would be the best way to target a Lee item?
use nth-child selector, like this: < Pre> . MenuuStyling li: nth-child (2): after {content: url ('.. /img/arrowActive.png'); } Where the image will be in the second and . See more on nth-child
See a snippet below
. MenuuStyling li: nth-child (2): after {content: "This hair list is after item 2"; Color: green} and lt; Ul class = "menu styley" & gt; & Lt; Li & gt; Item 1 & lt; / Li & gt; & Lt; Li & gt; Item 2 & lt; / Li & gt; & Lt; Li & gt; Item 3 & lt; / Li & gt; & Lt; Li & gt; Item 4 & lt; / Li & gt; & Lt; / Ul & gt;
Comments
Post a Comment