Best practices for clean HTML code: img element

I noticed that all the snippets in Multimedia and Embedding section use indentation and line breaks when adding attributes to elements such as <img>. Is it a common practice? I don’t remember reading anything about this so far? Is there an article about that?

Hm… I’m looking into this “best practices” situation and the only thing I could find is “Code example guidelines”, which is for the wiki editors… There’s nothing for learners like me. :disappointed_relieved: Now that I read that part about line length and block height, I feel inadequate. :laughing:

Hello @philou

most of people use ide or text editor that do the indentation part for readability

i read 2 artical about the indentation used one was from google

https://google.github.io/styleguide/htmlcssguide.html

and another one but i forget from where

both has some commen style so if you work on company they probably has rule for that but if you work by your self then make one or apply someone else rule and stick to it

hope that help and have a nice day :slight_smile:

1 Like

Thanks. I found something about Line Wrapping in the link you posted. I guess adding indentation before such attributes could fall into this practice… I’ll probably stick to a single space. :sweat_smile:

Edit: Seems like that’s what I was asking about

you welcome and glad it helped and have a nice day :slight_smile: