<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Uroojfatimaa on Medium]]></title>
        <description><![CDATA[Stories by Uroojfatimaa on Medium]]></description>
        <link>https://medium.com/@uroojfatimaa71?source=rss-e292857fb700------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Uroojfatimaa on Medium</title>
            <link>https://medium.com/@uroojfatimaa71?source=rss-e292857fb700------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 19:54:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@uroojfatimaa71/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HTML Basic Coding Rules & Formatting Guide]]></title>
            <link>https://medium.com/@uroojfatimaa71/html-basic-coding-rules-formatting-guide-a8d9bb0e6613?source=rss-e292857fb700------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8d9bb0e6613</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Uroojfatimaa]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 05:34:34 GMT</pubDate>
            <atom:updated>2026-10-06T05:34:34.546Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re learning HTML, it’s useful to have a <strong>basic coding style/formatting checklist</strong> so your code stays clean and readable from the beginning.</p><h3>1. Always use a proper HTML structure</h3><p>Every HTML page should generally start like this:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;My Page&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;</pre><pre>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>2. Use indentation for nested elements</h3><p>Whenever an element is <strong>inside another element</strong>, indent it.</p><h3>❌ Don’t do this</h3><pre>&lt;body&gt;<br>&lt;header&gt;<br>&lt;h1&gt;My Website&lt;/h1&gt;<br>&lt;nav&gt;<br>&lt;a href=&quot;#&quot;&gt;Home&lt;/a&gt;<br>&lt;a href=&quot;#&quot;&gt;About&lt;/a&gt;<br>&lt;/nav&gt;<br>&lt;/header&gt;<br>&lt;/body&gt;</pre><h3>✅ Do this</h3><pre>&lt;body&gt;<br>    &lt;header&gt;<br>        &lt;h1&gt;My Website&lt;/h1&gt;<br><br>        &lt;nav&gt;<br>            &lt;a href=&quot;#&quot;&gt;Home&lt;/a&gt;<br>            &lt;a href=&quot;#&quot;&gt;About&lt;/a&gt;<br>        &lt;/nav&gt;<br>    &lt;/header&gt;<br>&lt;/body&gt;</pre><p><strong>Basic rule:</strong></p><blockquote><em>One level inside = one indentation.</em></blockquote><p>Usually use <strong>4 spaces</strong> or <strong>2 spaces</strong>. Pick one and stay consistent. For beginners, <strong>4 spaces</strong> is easy to see.</p><h3>3. When should you leave a blank line?</h3><p>Use a blank line when you’re separating <strong>different logical sections</strong>.</p><h3>✅ Good</h3><pre>&lt;body&gt;<br><br>    &lt;header&gt;<br>        &lt;h1&gt;My Website&lt;/h1&gt;<br>    &lt;/header&gt;<br><br>    &lt;main&gt;<br>        &lt;section&gt;<br>            &lt;h2&gt;About Us&lt;/h2&gt;<br>            &lt;p&gt;Welcome to our website.&lt;/p&gt;<br>        &lt;/section&gt;<br><br>        &lt;section&gt;<br>            &lt;h2&gt;Our Services&lt;/h2&gt;<br>            &lt;p&gt;We provide different services.&lt;/p&gt;<br>        &lt;/section&gt;<br>    &lt;/main&gt;<br><br>    &lt;footer&gt;<br>        &lt;p&gt;Copyright 2026&lt;/p&gt;<br>    &lt;/footer&gt;<br><br>&lt;/body&gt;</pre><p>Here, blank lines separate:</p><ul><li>Header</li><li>Main</li><li>Different sections</li><li>Footer</li></ul><h3>Don’t add blank lines everywhere</h3><p>❌ Too much:</p><pre>&lt;h1&gt;<br><br>    My Website<br><br>&lt;/h1&gt;<br><br><br>&lt;p&gt;<br><br>    Welcome to my website.<br><br>&lt;/p&gt;</pre><p>Keep related content together.</p><h3>4. Don’t put blank lines between closely related elements</h3><p>For example, these belong together:</p><pre>&lt;nav&gt;<br>    &lt;a href=&quot;#&quot;&gt;Home&lt;/a&gt;<br>    &lt;a href=&quot;#&quot;&gt;About&lt;/a&gt;<br>    &lt;a href=&quot;#&quot;&gt;Contact&lt;/a&gt;<br>&lt;/nav&gt;</pre><p>You don’t need:</p><pre>&lt;nav&gt;<br><br>    &lt;a href=&quot;#&quot;&gt;Home&lt;/a&gt;<br><br>    &lt;a href=&quot;#&quot;&gt;About&lt;/a&gt;<br><br>    &lt;a href=&quot;#&quot;&gt;Contact&lt;/a&gt;<br><br>&lt;/nav&gt;</pre><h3>5. Put each major element on its own line</h3><h3>❌ Avoid</h3><pre>&lt;header&gt;&lt;h1&gt;My Website&lt;/h1&gt;&lt;p&gt;Welcome&lt;/p&gt;&lt;/header&gt;</pre><h3>✅ Better</h3><pre>&lt;header&gt;<br>    &lt;h1&gt;My Website&lt;/h1&gt;<br>    &lt;p&gt;Welcome&lt;/p&gt;<br>&lt;/header&gt;</pre><p>This becomes especially important when your HTML gets bigger.</p><h3>6. Keep opening and closing tags aligned</h3><h3>✅</h3><pre>&lt;section&gt;<br>    &lt;h2&gt;About Us&lt;/h2&gt;<br>    &lt;p&gt;We are a web development company.&lt;/p&gt;<br>&lt;/section&gt;</pre><p>Notice:</p><pre>&lt;section&gt;<br>    content<br>&lt;/section&gt;</pre><p>The opening and closing tags are at the <strong>same indentation level</strong>.</p><h3>7. Indent nested elements</h3><p>For example:</p><pre>&lt;section&gt;<br>    &lt;div&gt;<br>        &lt;h2&gt;Our Services&lt;/h2&gt;<br><br>        &lt;p&gt;We provide web development services.&lt;/p&gt;<br><br>        &lt;ul&gt;<br>            &lt;li&gt;Web Development&lt;/li&gt;<br>            &lt;li&gt;UI Design&lt;/li&gt;<br>            &lt;li&gt;SEO&lt;/li&gt;<br>        &lt;/ul&gt;<br>    &lt;/div&gt;<br>&lt;/section&gt;</pre><p>Think of indentation like levels:</p><pre>section<br>    div<br>        h2<br>        p<br>        ul<br>            li<br>            li<br>            li</pre><h3>8. Don’t indent everything manually based on visual appearance</h3><p>Indent according to <strong>HTML nesting</strong>, not how you think it looks.</p><p>For example:</p><pre>&lt;div&gt;<br>    &lt;h2&gt;Heading&lt;/h2&gt;<br><br>    &lt;div&gt;<br>        &lt;p&gt;Some text&lt;/p&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;</pre><p>The second &lt;div&gt; is inside the first &lt;div&gt;, so it gets another level of indentation.</p><h3>9. Attributes stay inside the opening tag</h3><h3>✅</h3><pre>&lt;a href=&quot;about.html&quot; target=&quot;_blank&quot;&gt;About Us&lt;/a&gt;</pre><p>Don’t put spaces around =:</p><h3>❌</h3><pre>&lt;a href = &quot;about.html&quot;&gt;</pre><h3>✅</h3><pre>&lt;a href=&quot;about.html&quot;&gt;</pre><h3>10. Use quotes around attribute values</h3><h3>✅</h3><pre>&lt;img src=&quot;images/logo.png&quot; alt=&quot;Company Logo&quot;&gt;</pre><p>Avoid:</p><pre>&lt;img src=images/logo.png alt=Company Logo&gt;</pre><p>Use <strong>double quotes</strong> consistently.</p><h3>11. Keep attributes in a sensible order</h3><p>For example:</p><pre>&lt;img src=&quot;images/profile.jpg&quot; alt=&quot;John&#39;s profile picture&quot; width=&quot;200&quot;&gt;</pre><p>A useful general order is:</p><pre>id<br>class<br>src / href<br>alt / title<br>other attributes</pre><p>Don’t obsess over this when you’re starting. <strong>Consistency matters more than the exact order.</strong></p><h3>12. Long elements can be split across multiple lines</h3><p>If an opening tag becomes too long:</p><h3>Instead of:</h3><pre>&lt;input type=&quot;text&quot; id=&quot;username&quot; name=&quot;username&quot; placeholder=&quot;Enter your username&quot; required&gt;</pre><p>You can format it as:</p><pre>&lt;input<br>    type=&quot;text&quot;<br>    id=&quot;username&quot;<br>    name=&quot;username&quot;<br>    placeholder=&quot;Enter your username&quot;<br>    required<br>&gt;</pre><p>This makes it easier to read.</p><h3>13. Lists should be properly indented</h3><h3>Unordered list</h3><pre>&lt;ul&gt;<br>    &lt;li&gt;HTML&lt;/li&gt;<br>    &lt;li&gt;CSS&lt;/li&gt;<br>    &lt;li&gt;JavaScript&lt;/li&gt;<br>&lt;/ul&gt;</pre><h3>Ordered list</h3><pre>&lt;ol&gt;<br>    &lt;li&gt;Open the website&lt;/li&gt;<br>    &lt;li&gt;Create an account&lt;/li&gt;<br>    &lt;li&gt;Log in&lt;/li&gt;<br>&lt;/ol&gt;</pre><h3>14. Nested lists need another indentation level</h3><pre>&lt;ul&gt;<br>    &lt;li&gt;<br>        Frontend<br>        &lt;ul&gt;<br>            &lt;li&gt;HTML&lt;/li&gt;<br>            &lt;li&gt;CSS&lt;/li&gt;<br>            &lt;li&gt;JavaScript&lt;/li&gt;<br>        &lt;/ul&gt;<br>    &lt;/li&gt;</pre><pre>    &lt;li&gt;<br>        Backend<br>        &lt;ul&gt;<br>            &lt;li&gt;Node.js&lt;/li&gt;<br>            &lt;li&gt;PHP&lt;/li&gt;<br>        &lt;/ul&gt;<br>    &lt;/li&gt;<br>&lt;/ul&gt;</pre><h3>15. Forms should be grouped logically</h3><p>Instead of putting everything together:</p><pre>&lt;form&gt;<br>    &lt;label&gt;Name&lt;/label&gt;<br>    &lt;input type=&quot;text&quot;&gt;</pre><pre>    &lt;label&gt;Email&lt;/label&gt;<br>    &lt;input type=&quot;email&quot;&gt;</pre><pre>    &lt;button&gt;Submit&lt;/button&gt;<br>&lt;/form&gt;</pre><p>For a larger form, group related fields:</p><pre>&lt;form&gt;<br><br>    &lt;div&gt;<br>        &lt;label for=&quot;name&quot;&gt;Name&lt;/label&gt;<br>        &lt;input type=&quot;text&quot; id=&quot;name&quot;&gt;<br>    &lt;/div&gt;<br><br>    &lt;div&gt;<br>        &lt;label for=&quot;email&quot;&gt;Email&lt;/label&gt;<br>        &lt;input type=&quot;email&quot; id=&quot;email&quot;&gt;<br>    &lt;/div&gt;<br><br>    &lt;div&gt;<br>        &lt;label for=&quot;message&quot;&gt;Message&lt;/label&gt;<br>        &lt;textarea id=&quot;message&quot;&gt;&lt;/textarea&gt;<br>    &lt;/div&gt;<br><br>    &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;<br><br>&lt;/form&gt;</pre><p>Blank lines help separate the different form groups.</p><h3>16. Use comments to separate major sections</h3><p>Comments are useful when they actually provide structure.</p><pre>&lt;body&gt;<br><br>    &lt;!-- Header --&gt;<br>    &lt;header&gt;<br>        ...<br>    &lt;/header&gt;<br><br>    &lt;!-- Main Content --&gt;<br>    &lt;main&gt;<br>        ...<br>    &lt;/main&gt;<br><br>    &lt;!-- Footer --&gt;<br>    &lt;footer&gt;<br>        ...<br>    &lt;/footer&gt;<br><br>&lt;/body&gt;</pre><p>Don’t comment obvious things like:</p><pre>&lt;!-- This is a paragraph --&gt;<br>&lt;p&gt;Hello&lt;/p&gt;</pre><p>That’s unnecessary.</p><h3>17. Keep related content together</h3><h3>Good</h3><pre>&lt;article&gt;<br>    &lt;h2&gt;How to Learn HTML&lt;/h2&gt;<br>    &lt;p&gt;HTML is used to structure web pages.&lt;/p&gt;<br>    &lt;a href=&quot;#&quot;&gt;Read More&lt;/a&gt;<br>&lt;/article&gt;</pre><p>These three elements belong to the same article, so they stay together.</p><h3>18. Separate major page sections</h3><p>A good general structure is:</p><pre>&lt;body&gt;</pre><pre>    &lt;header&gt;<br>        ...<br>    &lt;/header&gt;</pre><pre>    &lt;nav&gt;<br>        ...<br>    &lt;/nav&gt;</pre><pre>    &lt;main&gt;</pre><pre>        &lt;section&gt;<br>            ...<br>        &lt;/section&gt;</pre><pre>        &lt;section&gt;<br>            ...<br>        &lt;/section&gt;</pre><pre>    &lt;/main&gt;</pre><pre>    &lt;footer&gt;<br>        ...<br>    &lt;/footer&gt;</pre><pre>&lt;/body&gt;</pre><p>Notice the pattern:</p><pre>&lt;body&gt;<br>    header<br><br>    nav<br><br>    main<br>        section<br>        section<br><br>    footer<br>&lt;/body&gt;</pre><h3>19. Don’t use &lt;br&gt; for spacing</h3><p>This is a <strong>very important beginner rule</strong>.</p><h3>❌ Don’t do this</h3><pre>&lt;h1&gt;Welcome&lt;/h1&gt;<br>&lt;br&gt;<br>&lt;br&gt;<br>&lt;br&gt;<br>&lt;p&gt;Hello!&lt;/p&gt;</pre><p>If you want spacing, that’s a <strong>CSS job</strong>.</p><h3>✅</h3><pre>&lt;h1&gt;Welcome&lt;/h1&gt;<br>&lt;p&gt;Hello!&lt;/p&gt;</pre><p>Then CSS handles the spacing.</p><h3>20. Don’t use spaces to create indentation on the webpage</h3><p>This:</p><pre>&lt;p&gt;Hello          World&lt;/p&gt;</pre><p>doesn’t mean you should use spaces to position text.</p><p>HTML is for <strong>structure</strong>.</p><p>CSS is for <strong>appearance/layout</strong>.</p><p>Think:</p><pre>HTML → What is it?<br>CSS  → How does it look?<br>JS   → How does it behave?</pre><h3>21. Use semantic HTML where possible</h3><p>Instead of using &lt;div&gt; for everything:</p><pre>&lt;div&gt;<br>    &lt;div&gt;<br>        &lt;div&gt;My Article&lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Prefer meaningful elements:</p><pre>&lt;header&gt;<br>    ...<br>&lt;/header&gt;<br><br>&lt;main&gt;<br>    &lt;article&gt;<br>        &lt;h1&gt;My Article&lt;/h1&gt;<br>    &lt;/article&gt;<br>&lt;/main&gt;<br><br>&lt;footer&gt;<br>    ...<br>&lt;/footer&gt;</pre><p>Common semantic elements to learn:</p><pre>&lt;header&gt;<br>&lt;nav&gt;<br>&lt;main&gt;<br>&lt;section&gt;<br>&lt;article&gt;<br>&lt;aside&gt;<br>&lt;footer&gt;</pre><h3>22. Use lowercase HTML tags</h3><h3>✅</h3><pre>&lt;section&gt;<br>    &lt;h2&gt;About Us&lt;/h2&gt;<br>&lt;/section&gt;</pre><p>Avoid:</p><pre>&lt;SECTION&gt;<br>    &lt;H2&gt;About Us&lt;/H2&gt;<br>&lt;/SECTION&gt;</pre><p>HTML isn’t case-sensitive, but <strong>lowercase is the standard convention</strong>.</p><h3>23. Keep file structure clean too</h3><p>For a simple project:</p><pre>project/<br>│<br>├── index.html<br>├── about.html<br>├── contact.html<br>│<br>├── css/<br>│   └── style.css<br>│<br>├── js/<br>│   └── script.js<br>│<br>└── images/<br>    ├── logo.png<br>    └── banner.jpg</pre><h3>24. A simple rule for blank lines</h3><p>This is probably the easiest rule to remember:</p><h3>No blank line when:</h3><p>Elements are closely related.</p><pre>&lt;h2&gt;Our Services&lt;/h2&gt;<br>&lt;p&gt;We offer the following services:&lt;/p&gt;<br>&lt;ul&gt;<br>    &lt;li&gt;Web Design&lt;/li&gt;<br>    &lt;li&gt;Development&lt;/li&gt;<br>&lt;/ul&gt;</pre><h3>Blank line when:</h3><p>You’re moving to another logical group.</p><pre>&lt;section&gt;<br>    &lt;h2&gt;Our Services&lt;/h2&gt;<br>    &lt;p&gt;We offer web development services.&lt;/p&gt;<br>&lt;/section&gt;</pre><pre>&lt;section&gt;<br>    &lt;h2&gt;About Us&lt;/h2&gt;<br>    &lt;p&gt;We are a software company.&lt;/p&gt;<br>&lt;/section&gt;</pre><h3>25. A simple rule for indentation</h3><p>Remember this:</p><blockquote><strong><em>If an element is inside another element, indent it.</em></strong></blockquote><pre>&lt;section&gt;                &lt;!-- Level 1 --&gt;<br>    &lt;div&gt;                &lt;!-- Level 2 --&gt;<br>        &lt;article&gt;        &lt;!-- Level 3 --&gt;<br>            &lt;h2&gt;...&lt;/h2&gt; &lt;!-- Level 4 --&gt;<br>            &lt;p&gt;...&lt;/p&gt;   &lt;!-- Level 4 --&gt;<br>        &lt;/article&gt;<br>    &lt;/div&gt;<br>&lt;/section&gt;</pre><p>Closing tags return to the indentation of their opening tag.</p><h3>26. Your basic HTML formatting checklist</h3><p>Before considering your HTML “clean”, check:</p><ul><li>&lt;!DOCTYPE html&gt; is present</li><li>&lt;html lang=&quot;en&quot;&gt; is used</li><li>&lt;head&gt; and &lt;body&gt; are properly structured</li><li>Nested elements are indented</li><li>Opening and closing tags align</li><li>Major sections have blank lines between them</li><li>Related elements stay together</li><li>Attributes use double quotes</li><li>No unnecessary spaces around =</li><li>Tags are lowercase</li><li>Long tags are split across lines when necessary</li><li>&lt;br&gt; isn&#39;t being used just for spacing</li><li>CSS isn’t being replaced with excessive HTML spacing</li><li>Semantic elements are used where appropriate</li><li>Comments are used for major sections, not obvious elements</li><li>Formatting is consistent throughout the file</li></ul><h3>The easiest mental model</h3><p>When writing HTML, think in <strong>blocks</strong>:</p><pre>&lt;body&gt;<br><br>    &lt;!-- Block 1 --&gt;<br>    &lt;header&gt;<br>        ...<br>    &lt;/header&gt;<br><br>    &lt;!-- Block 2 --&gt;<br>    &lt;main&gt;<br><br>        &lt;!-- Block 2.1 --&gt;<br>        &lt;section&gt;<br>            ...<br>        &lt;/section&gt;<br><br>        &lt;!-- Block 2.2 --&gt;<br>        &lt;section&gt;<br>            ...<br>        &lt;/section&gt;<br><br>    &lt;/main&gt;<br><br>    &lt;!-- Block 3 --&gt;<br>    &lt;footer&gt;<br>        ...<br>    &lt;/footer&gt;<br><br>&lt;/body&gt;</pre><p><strong>Indentation = hierarchy.</strong><br><strong>Blank line = separation between logical groups.</strong><br><strong>HTML = structure, not spacing/design.</strong></p><p>If you’re practicing HTML/CSS, these rules are enough to establish a <strong>good professional formatting habit from the start</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8d9bb0e6613" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>