+ 9

They say that inline level elements cannot contain block level elements.

But below is an anchor link which contains h1 element. It is still clickable. <a href="#"><h1>Click</h1></a>

23rd Mar 2017, 10:50 PM
Wilson Bol
Wilson Bol - avatar
2 Réponses
+ 9
yes, it works. but it's invalid html. browsers aren't that strict, so they interpret the page as it's intended. it would be funny and a horror if they'd display error messages instead...
23rd Mar 2017, 11:00 PM
Mario L.
Mario L. - avatar
+ 3
you can make inline element a block level then use block level tags inside it a{ display:block; }
17th Aug 2018, 8:42 PM
Amir Ahmad
Amir Ahmad - avatar
Aujourd'hui en vedette
.
1 Votes
What?
0 Votes
HTML
0 Votes
FRC Coding?
1 Votes
Quiz duel
0 Votes
AI
2 Votes
help
0 Votes
APIs
1 Votes
Create Agent
0 Votes