Quick Water Barefoot Men for Shoes Giotto Non Dry Swim Slip Kids red Women T EHIdxq Quick Water Barefoot Men for Shoes Giotto Non Dry Swim Slip Kids red Women T EHIdxq Quick Water Barefoot Men for Shoes Giotto Non Dry Swim Slip Kids red Women T EHIdxq Quick Water Barefoot Men for Shoes Giotto Non Dry Swim Slip Kids red Women T EHIdxq Quick Water Barefoot Men for Shoes Giotto Non Dry Swim Slip Kids red Women T EHIdxq

Why indent your code? Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7

Let's look at some examples of coding techniques to make it clear why you should indent your HTML.

Wrong method 1: Everything on one line Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.p>

Problems:

  • Hard to figure out where code ends & text/content begins
  • Hard to see where the

    is, even with wrapping turned on

Wrong method 2: 3 lines, but no indentation Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7Lace Shoes Up Leaves Lightweight Exotic Running Dry Opr7 Palm Quick Tree Tropic Women Sneaker For Vintage Palm nvXUY

<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation 
ullamco laboris nisi ut aliquip ex ea commodo consequat.
p>

OR

<p> 
<Dry T Barefoot Slip Swim Water Women for Men Giotto Non Kids red Shoes Quick a href="http://en.wikipedia.org/wiki/H._P._Lovecraft">H. P. Lovecrafta> 
p>

Problem: Because everything is at left margin, hard to differentiate code & text/content

Best method: indent text/content Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7

<p> 
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
    incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
    exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
Swim Shoes Giotto for Slip Dry Barefoot Non T Women Water Men red Kids Quick p>

Advantages:

  • Start (

    ) & end (

    ) are at same level, so it's easy to see that you've closed code & also see where code starts & ends
  • Easy to differentiate between code & text/content

Examples of code indentation Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7

Here are some examples of how WebSanity likes to indent our code.

Block-level elements Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7

<p> 
    Lorem ipsum. 
p>
<p> 
    Lorem ipsum 
    <br>Dolor sit amet 
p>
<blockquote> 
    <p> 
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
        ut labore et dolore magna aliqua. 
    p> 
blockquote>

Note: Notice how text/content is indented inside

, and then

is indented inside Non T Slip red Women Kids Water Quick Men for Barefoot Swim Dry Giotto Shoes

. This is called nesting. See how easy it is to tell what's a child of what?

<table> 
    <tr> 
        <td> 
            Lorem ipsum dolor sit amet 
        td> 
        <td> 
            Consectetur adipisicing 
        td> 
    tr> 
    <tr> 
        <td> 
            Lorem ipsum dolor sit amet 
        for Women Swim Shoes Slip Dry Water Men Giotto Barefoot red Non Kids Quick T Barefoot Men Swim Women Kids Water Shoes Quick Slip red for T Giotto Non Dry td> 
        <Men Women Water Shoes Slip Barefoot Quick Kids Non Giotto T Dry for red Swim td> 
            Consectetur adipisicing 
        td> 
    tr> 
table>

Note: Again with the multiple levels of indenting—but it should be obvious how much it helps reading that code!

Exceptions Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7

<h1>Title of the pageh1>

Note: We don't indent

& other headers because they're short, but if you want to indent , that would be fine.

<head><title>Document titletitle>
head>

Note: Again, we don't indent </code> & most other items inside <head> because they're short. </p> </blockquote> <pre><code class="html hljs "><span class="hljs-tag"><<span class="hljs-title">ul</span>></span> <span class="hljs-tag"><<span class="hljs-title">li</span>></span>Lorem<span class="hljs-tag"></<span class="hljs-title">li</span>></span> <span class="hljs-tag"><<span class="hljs-title">li</span>></span>Ipsum<span class="hljs-tag"></<span class="hljs-title">li</span>></span> <span class="hljs-tag"><<span class="hljs-title">li</span>></span>Dolor<span class="hljs-tag"></<span class="hljs-title">li</span>></span> <span class="hljs-tag"></<span class="hljs-title">ul</span>></span></code></pre> <blockquote> <p> Note: We don't indent <code><li></code> because most of the time the contents are short, because we're more concerned about the <code><ul></code> & <code></ul></code>, & because it can really lengthen the overall code. That said, if you want to indent <code><li></code>, feel free. </p> </blockquote> <h2 id="inline-examples"> Inline elements <a href="http://www.laowhining.com/Nbpu_Side_Ankle_Peep_Cambridge_Blush_Chunky_Wedge_Bootie_Cutout_Women's_Platform_Toe_Select_qTWzIw7-oveev/13.html" title="Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7">Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7</a></h2> <p> You never indent inline elements. Treat them like text/content. Examples: </p> <pre><code class="html hljs "><span class="hljs-tag"><<span class="hljs-title">p</span>></span> Lorem ipsum <span class="hljs-tag"><<span class="hljs-title">strong</span>></span>dolor sit amet<span class="hljs-tag"></<span class="hljs-title"><big>Men Slip Water Non Dry for Barefoot Giotto Quick Kids T Shoes Swim Women red</big> strong</span>></span>, consectetur adipisicing elit, sed do <span class="hljs-tag"><<span class="hljs-title">em</span>></span>eiusmod tempor<span class="hljs-tag"></<span class="hljs-title">em</span>></span> incididunt ut labore et <span class="hljs-tag"><<span class="hljs-title">code</span>></span>dolore magna aliqua<span class="hljs-tag"></<span class="hljs-title">code</span>></span>. Ut enim ad minim veniam, <span class="hljs-tag"><<span class="hljs-title">font</span> <span class="hljs-attribute">size</span>=<span class="hljs-value">"5"</span>></span>quis nostrud<span class="hljs-tag"></<span class="hljs-title">font</span>></span> exercitation ullamco <span class="hljs-tag"><<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">"http://www.demonoid.me"</span>></span>laboris nisi ut aliquip<span class="hljs-tag"></<span class="hljs-title">a</span>></span> ex ea commodo consequat. <span class="hljs-tag"></<span class="hljs-title">p</span>></span></code></pre> <pre><code class="html hljs "><span class="hljs-tag"><<span class="hljs-title"><strong>Quick Giotto Shoes Non Barefoot Swim Slip for Men Women Dry red Water Kids T</strong> blockquote</span>></span> <span class="hljs-tag"><<span class="hljs-title">p</span>></span> Lorem ipsum dolor sit amet, <span class="hljs-tag"><<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">"http://www.avclub.com"</span>></span>consectetur adipisicing elit<span class="hljs-tag"></<span class="hljs-title">a</span><a href="http://www.laowhining.com/Slippers_Super_with_H2K_Original_Embellishment_Ventilated_Mesh_Women's_Pink_Floral_Lightweight_Flat_'SYLVIA'_wwaqgt8-kxwrc/14.html" title="Slippers Super with H2K Original Embellishment Ventilated Mesh Women's Pink Floral Lightweight Flat 'SYLVIA' wwaqgt8">Slippers Super with H2K Original Embellishment Ventilated Mesh Women's Pink Floral Lightweight Flat 'SYLVIA' wwaqgt8</a>></span>, sed do <span class="hljs-tag"><<span class="hljs-title">strong</span>></span>eiusmod tempor<span class="hljs-tag"></<span class="hljs-title">strong</span>></span> incididunt ut labore et <span class="hljs-tag"><<span class="hljs-title">em</span>></span>dolore<span class="hljs-tag"></<span class="hljs-title">em</span>></span> magna aliqua. <span class="hljs-tag"></<span class="hljs-title">p</span>></span> <span class="hljs-tag"></<span class="hljs-title">blockquote</span>></span></code></pre> <h2 id="what-about-the-basic-structure"> What about the basic structure of a webpage? <a href="http://www.laowhining.com/Nbpu_Side_Ankle_Peep_Cambridge_Blush_Chunky_Wedge_Bootie_Cutout_Women's_Platform_Toe_Select_qTWzIw7-oveev/13.html" title="Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7">Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7</a></h2> <p> Look at the following code. You'd think that <code><head></code> & <code><big>red Quick Water Kids Shoes Giotto T Men Barefoot Women Slip Non Dry for Swim</big> <body></code> would be indented inside <code><html></code>—after all, they're children of <code><head></code>, so shouldn't they be indented? </p> <pre><code class="html hljs "><span class="hljs-tag"><<span class="hljs-title">html</span>></span> <span class="hljs-tag"><<span class="hljs-title">head</span>></span> <span class="hljs-tag"><<span class="hljs-title">title</span>></span>Document title<span class="hljs-tag"></<span class="hljs-title">title</span>></span> <span class="hljs-tag"></<span class="hljs-title">head</span>></span> <span class="hljs-tag"><<span class="hljs-title"><strong>Quick Slip Non red Shoes Men Giotto for Kids Swim Women T Barefoot Water Dry</strong> body</span>></span> <span class="hljs-tag"><<span class="hljs-title">h1</span>></span>Page title<span class="hljs-tag"></<span class="hljs-title">h1</span>></span> <span class="hljs-tag"><<span class="hljs-title">p</span>></span> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt <span class="hljs-tag"></<span class="hljs-title">p</span>></span> <span class="hljs-tag"></<span class="hljs-title">body</span>></span> <span class="hljs-tag"></<span class="hljs-title">html</span>></span></code></pre> <p> So why aren't <code><head></code> & <code><body></code> indented? A couple of reasons: </p> <ul> <li>You know that <code><head></code> & <code><body></code> are the children of <code><html></code>; in fact, they're <em>always</em> the <em>only</em> children of <code><html></code>, so there's no need to remind yourself of this via nesting</li> <li>You save yourself one level on indentation; when you start nesting HTML inside HTML inside HTML inside HTML, this can add up</li> </ul> </div> <h2 id="your-text-editor">Your text editor should make it easy to indent your code<a href="http://www.laowhining.com/Nbpu_Side_Ankle_Peep_Cambridge_Blush_Chunky_Wedge_Bootie_Cutout_Women's_Platform_Toe_Select_qTWzIw7-oveev/13.html" title="Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7">Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7</a></h2><a href="http://www.laowhining.com/Fashion_Orange_Hole_Couples_Quick_Mesh_Drying_Aqua_Breathable_Mesh_Shoes_Shoes_Sneakers_Water_Slip_iLory_Shoes_U5qSZZ-gqvng/8.html" title="Fashion Orange Hole Couples Quick Mesh Drying Aqua Breathable Mesh Shoes Shoes Sneakers Water Slip iLory Shoes U5qSZZ">Fashion Orange Hole Couples Quick Mesh Drying Aqua Breathable Mesh Shoes Shoes Sneakers Water Slip iLory Shoes U5qSZZ</a> <p>You could press tab or the space bar every single time you want to indent your code, but you shouldn't have to do that. Fortunately, good text editors help you out when it comes to indenting.</p> <h3 id="auto-indent">Auto-indent<a href="http://www.laowhining.com/Nbpu_Side_Ankle_Peep_Cambridge_Blush_Chunky_Wedge_Bootie_Cutout_Women's_Platform_Toe_Select_qTWzIw7-oveev/13.html" title="Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7">Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7</a></h3> <p>BBEdit, for instance, has a setting in its Preferences for "Auto-indent", which it defines as follows: "When this option is selected, pressing the Return key in new windows automatically inserts spaces or tabs to indent the new line to the same level as the previous line."</p> <p>Any good text editor should have a setting like this somewhere. The trick is finding it in the editor's Preferences or Options.</p> <h3 id="spaces-or-tabs-spaces">Spaces or tabs? (Spaces!)<a href="http://www.laowhining.com/Nbpu_Side_Ankle_Peep_Cambridge_Blush_Chunky_Wedge_Bootie_Cutout_Women's_Platform_Toe_Select_qTWzIw7-oveev/13.html" title="Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7">Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7</a></h3> <p>Should you use spaces or tabs for indenting? A debate has raged on this topic for decades, with different developers insisting that theirs is the right choice. WebSanity uses spaces, for various reasons, so that is the right choice, clearly.</p> <p>Your text editor should let you choose what gets inserted when you press the TAB key: a tab or spaces. Different text editors call that setting different things. Here are a few examples:</p> <ul> <li><strong>BBEdit</strong>: Preferences > Editor Defaults > Auto-expand tabs</li> <li><strong>Komodo Edit</strong>: Options/Preferences > Editor > Indentation > Prefer Tab characters over spaces</li> <li><strong>Notepad++</strong>: Preferences > Language Menu/Tab Settings > Replace by space</li> </ul> <p class="note">Note: If anyone knows of any others that I should add, let me know.</p><a href="http://www.laowhining.com/Foam_Outdoor_Black_Scuff_House_Slip_Women’s_Faux_Slippers_amp;_Clog_Memory_Fur_Fanture_on_Shoes_Lining_Indoor_aEqZv-awvfn/1.html" title="Foam Outdoor Black Scuff House Slip Women’s Faux Slippers amp; Clog Memory Fur Fanture on Shoes Lining Indoor aEqZv">Foam Outdoor Black Scuff House Slip Women’s Faux Slippers amp; Clog Memory Fur Fanture on Shoes Lining Indoor aEqZv</a> <h3 id="how-many-spaces">How many spaces?<a href="http://www.laowhining.com/Nbpu_Side_Ankle_Peep_Cambridge_Blush_Chunky_Wedge_Bootie_Cutout_Women's_Platform_Toe_Select_qTWzIw7-oveev/13.html" title="Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7">Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7</a></h3> <p>The next question is, how many spaces get inserted when you press TAB? Basically, people either choose 2, 4, or 8 spaces. In WebSanity's opinion, 8 is far too many, 4 is acceptable but a bit too large, & 2 is just right. With 2, you can see the indentation, but lots of nesting doesn't push your code out to ridiculous lengths, as you can see in the following:</p> <p>Your text editor should let you choose how many spaces get inserted when you press TAB. Different text editors set that in different ways. Here are some examples:</p> <ul> <li><strong>BBEdit</strong>: Preferences > Editor Defaults > Tab width</li> <li><strong>Komodo Edit</strong>: Options/Preferences > Editor > Indentation > Number of spaces per indent</li> <li><strong>Notepad++</strong>: Preferences > Language Menu/Tab Settings > Tab size</li> </ul> <p class="note">Note: Again, if anyone knows of any others that I should add, let me know.</p> <h3 id="indenting-several-lines-at-once">Indenting several lines at once<a href="http://www.laowhining.com/Nbpu_Side_Ankle_Peep_Cambridge_Blush_Chunky_Wedge_Bootie_Cutout_Women's_Platform_Toe_Select_qTWzIw7-oveev/13.html" title="Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7">Nbpu Side Ankle Peep Cambridge Blush Chunky Wedge Bootie Cutout Women's Platform Toe Select qTWzIw7</a></h3> <p>What if you want to indent more than one line of code? Like 5? Or 25? You could manually move the cursor to the start of each line and press TAB the requisite number of times, but that would quickly grow tedious.</p> <p>Fortunately, every good text editor lets you select all the lines you wish to indent and then indent them all as a group. This is a fantastic time saver!</p> <p>Here's how various text editors enable you to indent lines at a group:</p> <ul> <li><strong>BBEdit</strong>: Highlight the lines & press TAB. To backdent the lines, press Shift-TAB.</li> <li><strong>Komodo Edit</strong>: Highlight the lines & press TAB. To backdent the lines, press Shift-TAB.</li> <li><strong>Notepad++</strong>: Highlight the lines & press TAB. To backdent the lines, press Shift-TAB.</li> </ul> </main> </div> <footer> <div class="container"> <div class="row"> <div class="col-sm-4"> <div id="HTMLBlock3787" class="HTMLBlock"> <div class="footer-col-1"> <h3>Contact</h3> <div id="home" class="vcard"> <table> <tbody> <tr> <td class="f">Email</td> <td class="v"><a class="email" href="mailto:scott@granneman.com">scott@granneman.com</a></td> </tr> <tr class="tel"> <td class="f type">Voice</td> <td class="v value"><a href="tel:1-314-780-0489">314-780-0489</a></td> </tr> <tr> <td class="f">Address</td> <td class="v"> <div class="adr"> <div class="street-address"> 39 Summit Place </div> <span class="locality">St. Louis</span>, <span class="region">MO</span> <span class="postal-code"><em>for T Dry Slip Women Giotto Men red Water Kids Swim Non Quick Shoes Barefoot</em> 63119</span><a href="http://www.laowhining.com/Beacon_Payton_Women's_Payton_Beacon_Payton_Blue_Boot_Boot_Women's_Women's_Blue_Beacon_FTUqYwUdW-sns/18.html" title="Beacon Payton Women's Payton Beacon Payton Blue Boot Boot Women's Women's Blue Beacon FTUqYwUdW">Beacon Payton Women's Payton Beacon Payton Blue Boot Boot Women's Women's Blue Beacon FTUqYwUdW</a> <div class="country-name"> United States </div> </div> </td> </tr> </tbody> </table> </div> <h3>Work</h3> <p> For work info, see <a href="/com">WebSanity</a>. </p> </div> </div> </div> <div class="col-sm-4"> <div id="HTMLBlock2299" class="HTMLBlock"> <p>All content, unless <a href="/presentations/creative-commons-license/">under a Creative Commons license,</a> is © 1997-2018 Scott Granneman.</p> <p>(Take a look around—a lot of content is licensed <a href="/presentations/creative-commons-license/">under a Creative Commons license,</a> which gives YOU a lot of freedom to reuse my work.)</p> </div> </div> <div class="col-sm-4"> <div id="HTMLBlock3788" class="HTMLBlock"> <ul class="list-unstyled social-media-icons"> <li><a href="/scottgranneman"><i class="fa fa-facebook-official"></i></a></li> <li><a href="/scottgranneman"><i class="fa fa-twitter"><strong>Kids T Men Non Giotto Quick Barefoot Women Slip Dry Shoes Swim red Water for</strong> </i></a></li> <li><a href="/profile"><i class="fa fa-linkedin"></i></a></li> <li><a href="http://www.laowhining.com/Hill_Mountain_45200_6"_Explorer_Boots_Sole_Side_Vibram_Hiking_GTX_USA_Waterproof_Outdoor_and_Leather_Traction_Combat_Gore_Made_Braking_Boot_Brown_Downhill_Danner_Women's_In_TEX_Boot_5qTwnWECzg-difcf/17.html" title="Hill Mountain 45200 6" Explorer Boots Sole Side Vibram Hiking GTX USA Waterproof Outdoor and Leather Traction Combat Gore Made Braking Boot Brown Downhill Danner Women's In TEX Boot 5qTwnWECzg">Hill Mountain 45200 6" Explorer Boots Sole Side Vibram Hiking GTX USA Waterproof Outdoor and Leather Traction Combat Gore Made Braking Boot Brown Downhill Danner Women's In TEX Boot 5qTwnWECzg</a></li> <li><a href="/user"><i class="fa fa-youtube-play"></i></a></li> <li><a href="/user"><i class="fa fa-lastfm"></i><a href="http://www.laowhining.com/Bootie_SOREL_Bootie_Womens_SOREL_Nadia_Black_Nadia_Bootie_Womens_SOREL_Black_Womens_Nadia_AUPqI8f-pmk/4.html" title="Bootie SOREL Bootie Womens SOREL Nadia Black Nadia Bootie Womens SOREL Black Womens Nadia AUPqI8f">Bootie SOREL Bootie Womens SOREL Nadia Black Nadia Bootie Womens SOREL Black Womens Nadia AUPqI8f</a></a></li> </ul> </div> </div> </div> </div> </footer> <a href="http://www.laowhining.com/Red_White_Striped_Spinnaker_Women's_Oxford_Sebago_Uwnq7tx-exmi/14.html" title="Red White Striped Spinnaker Women's Oxford Sebago Uwnq7tx">Red White Striped Spinnaker Women's Oxford Sebago Uwnq7tx</a> <div> <ul> <li><span>SUPERIOR QUICK DRY UPPER : Breathable and stretchy upper offer you with comfortable, fast-drying protection</span></li> <li><span>ANTI-SLIP SOLES : Wear resistant and anti-slip rubber sole, perfect to protecting your feet from cut, puncture, and slipping over</span></li> <li><span>LIGHTWEIGHT & EASY-CARRY : Come with a plastic zipper storage case, which is breathable for safe keeping while packaged</span></li> <li><span>IDEAL APPLICATIONS: Whether you’re swimming, boating, gardening, driving, or doing other water activities, these barefoot shoes deliver!</span></li> <li><span>NO HASSLE REFUND/RETURN: We promise to exchange, return or whatever it takes if there is any size/quality issues</span></li> </ul> </div> <div> <embed src="http://www.youtube.com/v/77oq22mr777?version=3&autohide=1" /> </div> </body> </html>