0
How do I learn to indent Code So That It is "Easy-to-Read" and "Beautiful"?
I'm new to coding but get how to code, that's the easy part. The hard part is learning how to indent & what to indent. I either under indent and make the code hard to read or I over indent for every new tag (HTML & CSS for example since I'm currently doing that) and you have to scroll to the right. I look, but with all the various methods it's hard to find a good one. I saw this website though with a good example & the code is Very Very Readable! https://css-tricks.com/examples/CleanCode/Beautiful-HTML.png
3 Respostas
+ 2
Here's what I do:
For any elements/data inside of the head and body, indent them immediately.
Let's say one of those elements is a div and you have even more elements inside of that. Indent all of the elements inside if the div.
Force yourself to do this and you'll make it a habit out of yourself to do it every time to create clean code with a clear hierarchy. Good luck!
+ 2
@BrightAsTheStars Awesome!
0
@Nikhil Kolachalama Thanks, I have begun practicing as such and it really is nice, clean, and easy to read.