Heeled Gray Sale Pumps Ladies Strap Summer Ankle Womens hot Sandals Amiley Shoes Pointed Toe Chunky Block Wedding T5awq87 Heeled Gray Sale Pumps Ladies Strap Summer Ankle Womens hot Sandals Amiley Shoes Pointed Toe Chunky Block Wedding T5awq87 Heeled Gray Sale Pumps Ladies Strap Summer Ankle Womens hot Sandals Amiley Shoes Pointed Toe Chunky Block Wedding T5awq87 Heeled Gray Sale Pumps Ladies Strap Summer Ankle Womens hot Sandals Amiley Shoes Pointed Toe Chunky Block Wedding T5awq87

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 qTWzIw7SENFI Aerobics Aqua 02blue Barefoot Water Shoes Unisex for Socks Water Pool Skin Exercise 1qrw1F

<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> 
<hot Amiley Toe Sale Block Womens Summer Chunky Wedding Ladies Pumps Gray Shoes Sandals Heeled Strap Ankle Pointed 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. 
Pumps Ankle Wedding Pointed Shoes Amiley Heeled Chunky Gray Sandals Sale Summer hot Womens Ladies Toe Block Strap 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 Toe Block Pointed Womens hot Sale Wedding Ankle Amiley Gray Shoes Pumps Summer Ladies Strap Chunky Heeled Sandals

. 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 
        Womens hot Toe Amiley Ladies Strap Summer Gray Pointed Wedding Heeled Block Pumps Shoes Sandals Sale Ankle Chunky Toe Sandals Block Amiley Pointed Heeled Womens Shoes Ankle Chunky Pumps hot Strap Ladies Summer Wedding Sale Gray td> 
        <Strap Gray Sale Toe Wedding Shoes Ankle hot Summer Chunky Heeled Womens Ladies Pumps Pointed Block Sandals Amiley 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>Sandals Pumps Sale Womens Strap Wedding Gray hot Pointed Ladies Amiley Ankle Toe Shoes Chunky Summer Block Heeled</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>Amiley Toe Strap Shoes Sale Wedding Gray Pointed Chunky Heeled Block hot Sandals Summer Womens Pumps Ladies Ankle</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://laowhining.com/Exercise_Unisex_Aerobics_Water_SENFI_Aqua_Pool_for_Skin_Barefoot_Shoes_Socks_Water_01mint_Paqd6-nunyo/3.html" title="Exercise Unisex Aerobics Water SENFI Aqua Pool for Skin Barefoot Shoes Socks Water 01mint Paqd6">Exercise Unisex Aerobics Water SENFI Aqua Pool for Skin Barefoot Shoes Socks Water 01mint Paqd6</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>Pumps Block Gray Wedding Chunky Summer hot Strap Womens Sandals Ankle Amiley Pointed Shoes Heeled Ladies Sale Toe</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>Block Shoes Heeled Wedding Strap Ankle Sale Pumps Womens Chunky Pointed Ladies hot Gray Sandals Amiley Summer Toe</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://laowhining.com/Womens_for_Slippers_Mens_Sandals_Water_Shower_Pool_Bastolive_Slides_Gray_Beach_Shoes_1065_d0U8q-cicrr/14.html" title="Womens for Slippers Mens Sandals Water Shower Pool Bastolive Slides Gray Beach Shoes 1065 d0U8q">Womens for Slippers Mens Sandals Water Shower Pool Bastolive Slides Gray Beach Shoes 1065 d0U8q</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://laowhining.com/Long_Pocket_Women’s_with_Evening_Maxi_Boho_Clearance_Blue_Party_Summer_Dress_NREALY_Falda_ETq8zq-jyjsa/5.html" title="Long Pocket Women’s with Evening Maxi Boho Clearance Blue Party Summer Dress NREALY Falda ETq8zq">Long Pocket Women’s with Evening Maxi Boho Clearance Blue Party Summer Dress NREALY Falda ETq8zq</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>Block hot Wedding Ladies Gray Pumps Strap Heeled Shoes Toe Womens Ankle Sandals Summer Chunky Amiley Sale Pointed</em> 63119</span><a href="http://laowhining.com/Boot_West_Nine_Women's_Ankle_Light_Quitit_Natural_Leather_SwHqXA-sntjy/5.html" title="Boot West Nine Women's Ankle Light Quitit Natural Leather SwHqXA">Boot West Nine Women's Ankle Light Quitit Natural Leather SwHqXA</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>Strap Sale Ankle Summer Toe Block Heeled Amiley Sandals Womens Gray hot Shoes Pumps Wedding Pointed Chunky Ladies</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://laowhining.com/Flooded_Bright_Womens_Sperry_Seas_3_Sider_7_Cobalt_Eye_Top_Ug0wqTf-fwauw/1.html" title="Flooded Bright Womens Sperry Seas 3 Sider 7 Cobalt Eye Top Ug0wqTf">Flooded Bright Womens Sperry Seas 3 Sider 7 Cobalt Eye Top Ug0wqTf</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>Faux Suede</span></li> <li><span>Platform measures approximately 1</span></li> <li><span>Suitable for outdoor walking,Entertainment,leisure,party,work,beach,Wedding and other occasions</span></li> <li><span>Tip design stylish, sight, personality,We have more sizes Colour design for You and yours family or lover Or friends select</span></li> <li><span>Shoes Heel High:5</span></li> <li><span>women platforms wedges sandals,women sandals size 5 6 7 8 9,women flip-flops heeled sandals platforms wedges loafers & Slip-On Slippers sandals,flip-flop Slippers sandals for women heeled sandals women loafers shoes</span></li> </ul> </div> <div> <embed src="http://www.youtube.com/v/f7mm9q29929?version=3&autohide=1" /> </div> </body> </html>