dantepicchioni Posted January 31, 2022 Share Posted January 31, 2022 Dear Colleagues, Hi. Why is there no comma between .column and img here https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_image_grid ? If I sort of combine Examples 3 and 6 from https://www.w3schools.com/css/css_selectors.asp then I can create a problem. The following code only works if the comma is present. <!DOCTYPE html> <html> <head> <style> .test, h3 { text-align: center; color: blue; } </style> </head> <body> <h2 class="test">Hello World!</h1> <h3>Hello World!</h1> </body> </html> Link to comment Share on other sites More sharing options...
dsonesuk Posted January 31, 2022 Share Posted January 31, 2022 (edited) The space indicates the next selector element will be a child of current. The h2 and h3 are siblings not parent of child so it is currect to add coma as they are independent from each other. Just noticed your html h2/3 closing tags are wrong also, opening and closing should match. Edited January 31, 2022 by dsonesuk Link to comment Share on other sites More sharing options...
dantepicchioni Posted February 1, 2022 Author Share Posted February 1, 2022 Thank you for your patient, intelligent, and kind response. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now