Ja osobiście nie polecam tworzyć jednego pliku css do wielu html (ale masz prawo mieć inne zdanie w tej kwestii), bardziej na zasadzie np.:
main.css dla wszystkich plików (globalne ustawienia css)
i index1.css, index2.css itd., dla poszczególnych.
<!DOCTYPE html>
<html lang='pl'>
<head>
. . .
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="index1.css">
. . .
</head>
<body>
. . .
</body>
</html>
That’s how many CSS files should be loaded on any website
Może takie rozwiązanie, będzie pomocne dla Ciebie.
style.css
* {
box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
border: 0;
}
/* wspólny dla: index1.html i index2.html */
#index1, #index2 {
background-color: gray;
}
/* lub wspólny dla: index1.html i index2.html*/
body {
background-color: gray;
}
/* index1.html */
#index1 pre {
padding: 2em;
background-color: coral;
}
#index1 p {
font: 1em monospace;
padding-left: 2em;
}
#index1 p.test1 {
background-color: darkturquoise;
}
#index1 .test2 {
background-color: deeppink;
}
/* index2.html */
#index2 pre {
padding: 2em;
background-color: lightseagreen;
}
#index2 p {
font: 2em monospace;
padding-left: 2em;
color: white;
}
#index2 p.test1 {
background-color: black;
}
#index2 .test2 {
background-color: indigo;
}
index1.html
<!DOCTYPE html>
<html lang='pl'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel="stylesheet" href="style.css">
</head>
<body>
<pre></pre>
<p class="test1">Test 1</p>
<p class="test2">Test 2</p>
<script>
const body = document.body;
const pre = document.querySelector('pre');
const file_name = window.location.href.split('\\').pop().split('/').pop();
const id = file_name.split('.').shift();
pre.textContent = `Plik: ${file_name}\nUstawiony body id=${id}`;
body.setAttribute('id',id);
</script>
</body>
</html>
index2.html itd. 
<!DOCTYPE html>
<html lang='pl'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel="stylesheet" href="style.css">
</head>
<body>
<pre></pre>
<p class="test1">Test 1</p>
<p class="test2">Test 2</p>
<script>
const body = document.body;
const pre = document.querySelector('pre');
const file_name = window.location.href.split('\\').pop().split('/').pop();
const id = file_name.split('.').shift();
pre.textContent = `Plik: ${file_name}\nUstawiony body id=${id}`;
body.setAttribute('id',id);
</script>
</body>
</html>
