Reputation: 2043
I seen a hack written using this type of code structure where the ending tag right 'angle bracket' is placed at the beginning of a new left 'angle-bracket' tag opening, but I can't remember why it was done or the thread. I'm thinking it was Chris Coyier's CSS tips site, but not sure. Does anybody have any idea why someone would write markup this way? This code snippet taken from here
<!DOCTYPE Html>
<Html
><Head
><Title
>Graduation Ceremony Summer 2022</Title
></Head
><Body
><H1
>Graduation</H1
><Section
><H1
>Ceremony</H1
><P
>Opening Procession</P
>
></Section
></Body
></Html>
Upvotes: 1
Views: 185
Reputation: 107518
Some browsers treat the whitespace between tags differently. This would be one way to prevent empty text nodes from appearing all over in the DOM. It's unlikely that having them in your document would cause any trouble (depending on your CSS rules).
One situation that comes to mind is vertical-alignment of images. Some browsers treat the whitespace next to an image tag (an empty text node) as a real text node. If you're aligning your image to the text, it might be aligning it to the empty text node instead of the actual text next to the image.
In terms of readability, all I see is a bunch of scrunchy angry faces (>_<
). I would much rather have standard-looking HTML and not feel like >_<
.
Upvotes: 5