Missing the :target

Tests for dynamic update of :target styles.

None #one #two #three #four

Targets

Target #one

Problems with the :target selector

1 – The location hash and the selected :target become desynchronised when navigating via window.history

Click on the links #one, #two, #three or #four and the corresponding target is highlighted.

Now click .

The location hash has changed but target #one is not highlighted.

2 – Matching elements added to the DOM on or after load are not selected by :target

Click on #four. The location hash is #four and target #four is highlighted.

Now refresh the page.

Target #four was added to the DOM after load. It is not highlighted.

Browsers other than FireFox also have this problem with #three.