Я пытаюсь установить фон для <article>
как заданный градиент, но хотел бы исключить последнюю строку второй таблицы из этой градиентной раскраски. Я пробовал следующий CSS не повезло:Исключить элементы в выборе css
CSS
article.blogPosts:not(table.secondPost tr:last-child td:last-child) {
background: linear-gradient(to right, red , blue);
}
HTML
<article class = "blogPosts">
<h2>Personal Programming Projects</h2>
<section class= "blogPost">
<table class= "firstPost">
<tr>
<th title = "20th October 2015">Blog post 2 - 20th October 2015 - <time datetime="2015-10-20 10:00">10:00</time>am</th>
<th><input type="checkbox"> <label>Read</label></th>
</tr>
<tr>
<td>
<h3>Student Reporting System - Full Stack Developer</h3>
<ul>
<li> Developed a student monitoring system to enable teachers to provide on-going reports on each student.</li>
</ul>
</td>
</tr>
</table>
</section>
<section class= "blogPost">
<table class="secondPost">
<tr>
<th title = "15th November 2015">Blog post 1 - 15th November 2015 - <time datetime="2015-10-20 10:00">10:00</time>am</th>
<th><input type="checkbox"> <label>Read</label> </th>
</tr>
<tr>
<td>
<h3>Software Engineering Group Project - Lead Programmer</h3>
<ul>
<li>Developed a fast food ordering system for our chosen business - Krusty's Pizza.</li>
</ul>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</section>
</article>
Это плохая практика. Вы просто перезаписали предыдущий цвет. В первую очередь лучше исключить стиль. – SamG
@SamG Что? Разве это не весь смысл «каскадных» таблиц стилей ...? Каждое правило, которое мы пишем, переопределяет стили агентов. – Phix