From b6f67d4aaff8b5a6fc3b31ced2c62f12c57852a6 Mon Sep 17 00:00:00 2001 From: ANKIT KUMAR SHARMA <42799194+Ank8284@users.noreply.github.com> Date: Thu, 15 May 2025 15:00:04 +0530 Subject: [PATCH 1/3] Update levels.js --- js/levels.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/levels.js b/js/levels.js index 97e1172..c8479bc 100644 --- a/js/levels.js +++ b/js/levels.js @@ -393,7 +393,7 @@ var levels = [ selectorName: "Nth Last Child Selector", helpTitle: "Select an element by its order in another element, counting from the back", doThis : "Select the 1st bento", - selector : "bento:nth-last-child(3)", + selector : ["bento:nth-last-child(3)", "bento:nth-of-type(1)"], // Array for multiple selectors syntax: ":nth-last-child(A)", help : "Selects the children from the bottom of the parent. This is like nth-child, but counting from the back!", examples : [ From 4783954229f3734914ecde166bd06254ed7691f7 Mon Sep 17 00:00:00 2001 From: ANKIT KUMAR SHARMA <42799194+Ank8284@users.noreply.github.com> Date: Thu, 15 May 2025 15:06:32 +0530 Subject: [PATCH 2/3] Update levels.js added "Nth-of-Type Selector" --- js/levels.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/levels.js b/js/levels.js index c8479bc..092ac89 100644 --- a/js/levels.js +++ b/js/levels.js @@ -399,6 +399,16 @@ var levels = [ examples : [ ':nth-last-child(2) selects all second-to-last child elements.' ], + // Adding Nth-of-Type information + additionalInfo: { + selectorName: "Nth-of-Type Selector", + helpTitle: "Select an element based on its occurrence among siblings of the same type.", + syntax: ":nth-of-type(A)", + help: "Targets elements of the same type by their position within a parent, counting from the start. Similar to :nth-child, but it only considers siblings of the same type, not all child elements.", + examples: [ + 'p:nth-of-type(3) selects the third `

` element within its parent.' + ] + }, boardMarkup: ` From ac19835a31f3621918e6ff0f63acc91ff56a3c8c Mon Sep 17 00:00:00 2001 From: ANKIT KUMAR SHARMA <42799194+Ank8284@users.noreply.github.com> Date: Thu, 15 May 2025 16:23:23 +0530 Subject: [PATCH 3/3] Update levels.js final update, added one more example so, people will not make syntax error and adding one extra layer of information as at first due it was not working and were forced to use different way too solve this --- js/levels.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/levels.js b/js/levels.js index 092ac89..35c4a0d 100644 --- a/js/levels.js +++ b/js/levels.js @@ -397,9 +397,10 @@ var levels = [ syntax: ":nth-last-child(A)", help : "Selects the children from the bottom of the parent. This is like nth-child, but counting from the back!", examples : [ - ':nth-last-child(2) selects all second-to-last child elements.' + ':nth-last-child(2) selects all second-to-last child elements.', + 'p:nth-last-child(3) selects the third-to-last `

` element within its parent.', // added new example for better understanding ], - // Adding Nth-of-Type information + // also another apporch: Adding Nth-of-Type information additionalInfo: { selectorName: "Nth-of-Type Selector", helpTitle: "Select an element based on its occurrence among siblings of the same type.",