wqpenter.blogg.se

Notepad ++ format html
Notepad ++ format html













notepad ++ format html

You know that & are the children of in fact, they're always the only children of, so there's no need to remind yourself of this via nesting.So why aren't & indented? A couple of reasons: You'd think that & would be indented inside -after all, they're children of, so shouldn't they be indented? What about the basic structure of a webpage? Ut enim ad minim veniam, quisĪdipisicing elit, sed do eiusmod tempor incididunt Sed do eiusmod tempor incididunt ut labore et dolore Lorem ipsum dolor sit amet, consectetur adipisicing elit, That said, if you want to indent, feel free. Note: We don't indent because most of the time the contents are short, because we're more concerned about the &, & because it can really lengthen the overall code. Note: Again, we don't indent & most other items inside because they're short. Note: We don't indent & other headers because they're short, but if you want to indent, that would be fine.

notepad ++ format html

Note: Again with the multiple levels of indenting-but it should be obvious how much it helps reading that code! See how easy it is to tell what's a child of what? Note: Notice how text/content is indented inside, and then is indented inside. Here are some examples of how WebSanity likes to indent our code.

  • Easy to differentiate between code & text/content.
  • Start ( ) & end ( ) are at same level, so it's easy to see that you've closed code & also see where code starts & ends.
  • Problem: Because everything is at left margin, hard to differentiate code & text/content Ullamco laboris nisi ut aliquip ex ea commodo consequat. Ut enim ad minim veniam, quis nostrud exercitation Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt Wrong method 2: 3 lines, but no indentation
  • Hard to see where the is, even with wrapping turned on.
  • Hard to figure out where code ends & text/content begins.
  • Ut enim ad minim veniam, quis nostrudĮxercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor Let's look at some examples of coding techniques to make it clear why you should indent your HTML.















    Notepad ++ format html