diff --git a/js/levels.js b/js/levels.js index 97e1172..35c4a0d 100644 --- a/js/levels.js +++ b/js/levels.js @@ -393,12 +393,23 @@ 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 : [ - ':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 ], + // 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.", + 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: `