Giving a class to every element that is being styled? - CSS Best Practices [on hold]

46
January 17, 2019, at 06:50 AM

Im just wandering in regards to CSS is it best practice to add a class name to every element Im styling, for example I have a <h1> which sits within a div classes "main-col", now I could just apply styles to the <h1> very easily

.main-col h1 { color: red;}

But Im wondering if this <h1> element should have its own class name.

What about other elements like <a>, or <ul>s, <li>s, <p>s etc...

Most of the time I would give them class names as its intuitive, but occasionally its just as easy to just name the element after the parent class .nav ul{ color: green} instead of .unordered-nav-list{color:green}

READ ALSO
Get hour from date() in java [duplicate]

Get hour from date() in java [duplicate]

This question already has an answer here:

63
Modified N Queens with placed queen

Modified N Queens with placed queen

So, I'm creating an N Queens problem solver with BacktrackingThe twist however is that the first queen is placed by the user and then the backtracking is ran to process the other 7 queens

54
Need help in extracting a expression from a log using regular expressions in Java

Need help in extracting a expression from a log using regular expressions in Java

I have a log as a string, and I am trying to capture the error message from itthe regex I tried did not work

61
How to find the fitness of Sudoku in java [on hold]

How to find the fitness of Sudoku in java [on hold]

Suppose this is the matrixI want fitness of this matrix for solving Sudoku

48