CSS code to change colors of first and second levels

I’ve been using ChatGPT to come up with code to change the color of the first and second levels, red for the first and green for the second. However, after several tries nothing ChatGPT tried worked. Is it even possible to do this? And if so how would it be done? Thanks

This code does bullets on different levels. See if you can adapt to do the background of the main content.

Yes, it’s possible to change the colors of the first and second levels using CSS. For headings, you can target the first level (e.g., <h1>) with color: red and the second level (e.g., <h2>) with color: green. For nested lists, you can use the ul > li selector for the first level (e.g., red for the first-level list items) and ul li ul li for the second level (e.g., green for nested list items). This method works by selecting the appropriate elements based on their hierarchy and applying different colors to each level.