Should we indent everything within the <html></html> tags?

Almost everything in an HTML file goes within <html></html> tags. Is it common practice to indent everything within these tags? Or is this an exception, considering every single line would have an extra (rather uninformative) indent?

1 Like


I’d say it’s up to personal coding style really. I don’t tend to myself since as you said it doesn’t really add anything informative and from a quick search at some examples it looks to be fairly standard practice not to indent the contents. Of course everything else needs indentation but I don’t tend to add an extra layer specific to the html tag.

That said, there would be absolutely nothing wrong with either way and it’s really down to preference. :slight_smile:


No EVERYTHING goes in-between the html tags.

I’m not sure. I do personally do indent everything. But the emmit tool in VS code does not. At the end of the day, it’s just preference.

Indentation makes your code more readable for other people (if, say you’re in a work setting or pair programming etc). Plus, it’s easier to spot errors when they come up.


Not the declaration <!DOCTYPE html> :stuck_out_tongue_winking_eye:


The <meta> tags are grandchildren of the HTML tag.

Yeah, I meant the doctype part. Ctrl+c ctrl+v failed me.

Oh, yea I forgot about that. That’s the only thing that should ever be out of the HTML tags thought.

1 Like

how can I hide text but google bot can still read in in html webpage?

Simple, you can’t. HTML is text, and SEs see every bit of it. In fact, hidden text is a sure way to get put on the Supplemental index and have a 50/50 chance of ever escaping.

1 Like