CSS - Style a Website by its Structure and not with a ton of classes

CSS - Style a Website by its Structure and not with a ton of classes

I'm currently writing a small website for fun and now I need to design it and I'm not really experienced in CSS. I don't want to declare a ton of classes or ids in my html file, so my question is if there is a way to avoid these within the CSS code.

I'm currently writing a small website for fun and now I need to design it and I'm not really experienced in CSS. I don't want to declare a ton of classes or ids in my html file, so my question is if there is a way to avoid these within the CSS code.

Wasn't there a way to only apply CSS-declaration to children, so I can design a website by its structure.

I already tried

header article {
  css-declaration;
}

and

header.article {
  css-declaration;
}

but these didn't work. I also did some research, but I didn't find anything.

An example Code:

<body>
  <header>
    <h>Title</h>
  </header>

<article> <header> <h>Article Title</h> </header>

&lt;section&gt;
  &lt;h&gt;Section Title&lt;/h&gt;
&lt;/section&gt;

</article> </body> article header h { css-declaration; }

As you can probably imagine, I only want to affect the <h> element (Article Title), which is located in a <header> within an <article>, but I don't want to affect the <h> element (Title) in a <header>element in the <body> element as well not the <h> element (Section Title) in the <section>element.

html css

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Know Everything About HTML With HTML Experts

HTML Assignment Help Australia @30% OFF from Sample Assignment, with Our Best HTML assignment help experts. Get HTML homework help online at affordable price. 100% Plag free assignment solution.

An Introduction to HTML & CSS

At the heart of any general website or web page are lines of code in HTML and CSS. HTML, the web development language to render content and CSS, which styles the content.

HTML And CSS Tutorial For Beginners | Complete HTML & CSS Course In One Tutorial

In this video you will learn basics of HTML and CSS from beginning. This HTML and CSS course is best for Beginners to start learning web design and web development. In this HTML and CSS Beginners tutorial we will discuss all the important HTML tags, CSS properties to design the website with some example and explanation. We will also learn about animation using CSS.

Stay at Home Animation in HTML CSS - Covid-19 | SVG to HTML CSS |

Stay at home Animation in html css - COVID-19 . Adobe illustrator SVG To HTML CSS Animation . corona-virus. Adobe illustrator to HTML & CSS Animation.

Hire CSS Developer

Want to develop a website or re-design using CSS Development? We build a website and we implemented CSS successfully if you are planning to **[Hire CSS Developer](https://hourlydeveloper.io/hire-dedicated-css-developer/ "Hire CSS Developer")**...