/    Sign up×
Community /Pin to ProfileBookmark

last <ul> element inside <li>

I’m making a file tree with pure css. I want to know if theres any method in which i can find the last occurence of <ul> element inside <li> element

for eg: <li>..</li>
<li>..</li>
<li>..</li>
<li>..
<ul>
<li>….<li>
<li>….</li>
<li>
<ul> <li></li> <li></li> <li></li> <ul>
</li>
</ul>
</li>

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@cootheadNov 20.2015 — Hi there Deeppurple,

[indent]

does this help...

[color=navy]
&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;

&lt;meta charset="utf-8"&gt;

&lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;

&lt;title&gt;untitled document&lt;/title&gt;

&lt;style media="screen"&gt;
ul li:last-of-type ul {
color:#f00;
}
&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;ul&gt;
&lt;li&gt;ul 1 1i 1&lt;/li&gt;
&lt;li&gt;ul 1 1i 2&lt;/li&gt;
&lt;li&gt;ul 1 1i 3&lt;/li&gt;
&lt;li&gt;ul 1 1i 4
&lt;ul&gt;
&lt;li&gt;ul 2 1i 1&lt;/li&gt;
&lt;li&gt;ul 2 1i 2&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;ul 1 1i 5
&lt;ul&gt;
&lt;li&gt;ul 3 1i 1&lt;/li&gt;
&lt;li&gt;ul 3 1i 2&lt;/li&gt;
&lt;li&gt;ul 3 1i 3&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/body&gt;
&lt;/html&gt;[/color]


[/indent]

[i]coothead[/i]
×

Success!

Help @Deeppurple spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...