Y
Hacker News
new
|
ask
|
show
|
jobs
by
austinlyons
3990 days ago
Wouldn't you just instead write the CSS as follows?
.sidebar.title { text-decoration: underline; }
2 comments
talmand
3990 days ago
That likely wouldn't have the intended effect as I find it doubtful that the element with the sidebar class would also be the title.
link
lstamour
3990 days ago
Well, you could also write .sidebar > .title to be more specific than simply all .title elements in .sidebar, but the point is to not tie your CSS quite so closely to the HTML hierarchy I suppose.
link