Hey everyone! I'm learning how to create a link that features a word followed by a blinking underscore on the same line. I've managed to get it working using the following HTML:
``
`
blinking_
`
``
I'm just wondering if my tag hierarchy is correct—specifically, having a `` inside a `
` that's wrapped in an `` tag—is that okay?
3 Answers
Actually, traditionally, a `
` is a block-level element while both `` and `` are inline elements. In HTML5, nesting them like this is permitted, but it might cause issues with older browsers that don’t correctly handle HTML5. It’s usually safer to have inline elements inside block elements rather than the reverse. You could just use a `` within the `` and skip the `
` altogether.
Your HTML structure isn’t wrong, especially since HTML5 allows an anchor to wrap a paragraph. You can definitely have a `` inside a `
` too. However, if it’s just a single word, you might want to simplify it by just using `blinking_` without the `
`.
A great way to double-check your HTML is through a validator like [HTML validator](https://validator.nu/#textarea). Having a `` inside a `
Related Questions
Cloudflare Origin SSL Certificate Setup Guide
How To Effectively Monetize A Site With Ads