- Do not use lower levels to decrease heading font size:
<h1 class="display-3 text-center">Franz Kafka</h1> <h3 class="text-center"><em>German-speaking Bohemian Jewish novelist and short story writer</em></h3>
Do not use lower levels to decrease heading font size: use the CSS font-size property instead.Avoid skipping heading levels: always start from
<h1>, next use
<h2>and so on.
h2–h6 elements must not be used to markup subheadings, subtitles, alternative titles and taglines unless intended to be the heading for a new section or subsection. Instead use the markup patterns in the §4.13 Common idioms without dedicated elements section of the specification.
- Target blank vulnerability
<a href="https://en.wikipedia.org/wiki/The_Trial_(1962_film)" target="_blank">
Note: When using target, consider adding rel="noopener noreferrer"
to avoid exploitation of the window.opener API.
TL;DR If window.opener is set, a page can trigger a navigation in the opener regardless of security origin.
People using target=’_blank’ links usually have no idea about this curious fact:
The page we’re linking to gains partial access to the linking page via the window.opener object.
How to fix
Add this to your outgoing links.
Update: FF does not support “noopener” so add this.
Remember, that every time you open a new window via window.open(); you’re also “vulnerable” to this, so always reset the “opener” property
var newWnd = window.open(); newWnd.opener = null;
Cheers and happy coding