<?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 Joaquim Costa on Medium]]></title>
        <description><![CDATA[Stories by Joaquim Costa on Medium]]></description>
        <link>https://medium.com/@joaquimdacosta1999?source=rss-5501c69de547------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TjsbVvh_o0giXPuwsX4gEQ.jpeg</url>
            <title>Stories by Joaquim Costa on Medium</title>
            <link>https://medium.com/@joaquimdacosta1999?source=rss-5501c69de547------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 03:30:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joaquimdacosta1999/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[Introduction to HTML and CSS]]></title>
            <link>https://medium.com/@joaquimdacosta1999/introduction-to-html-and-css-c1cc8649f058?source=rss-5501c69de547------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1cc8649f058</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Joaquim Costa]]></dc:creator>
            <pubDate>Sat, 27 Sep 2025 06:26:05 GMT</pubDate>
            <atom:updated>2025-09-27T06:26:05.647Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*gvGhtgk_S_IT8YO7.jpg" /></figure><h3>Learning objectives</h3><p>After completing this article, you should be able to:</p><ul><li>Describe how web developers use HTML elements to build a web page</li><li>Identify and explain common HTML elements</li><li>Define HTML attributes and uses</li><li>Identify and explain common attributes</li><li>Identify coding organization techniques that benefit web developers and users</li><li>Describe methods and techniques to apply CSS to HTML</li><li>Describe the CSS box model and the components of CSS boxes</li><li>Describe best practices for writing HTML and CSS</li><li>Describe key features of an integrated development environment (IDE) that help improve workflow for web developers</li></ul><h4><strong>Tags and elements</strong></h4><p>HTML is built with <strong>elements</strong>. Elements are pairs of<strong> tags</strong> that encapsulate or wrap around text. Tags are made up of opening and closing angle brackets with a tag name in the middle. An element typically includes an <strong>opening tag </strong>and a <strong>closing tag</strong>.</p><p>For example, developers use the <strong>emphasis tag</strong> to make words on a page stand out.</p><ul><li>The tag name for an emphasis tag is <strong>em</strong>.</li><li>Developers write <strong>&lt;em&gt;</strong> as the opening tag for the emphasis element.</li><li>A closing tag is like an opening tag but includes a backslash before the name. The closing tag for the emphasis element is <strong>&lt;/em&gt;</strong>.</li></ul><p><strong>The full italic element would look like this:</strong></p><pre>&lt;em&gt;I&#39;m emphasized&lt;/em&gt;</pre><p>And here is a diagram to show you how to compose this element:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ORp2nZFcMpGgcZZEqYZUlQ.png" /></figure><p>This is the first step in creating content in HTML! The language is made up of elements and content. As you learn the <strong>syntax </strong>of HTML, you can create web pages that do all sorts of interesting things. Keep in mind:</p><ul><li>Syntax is the structure or grammar of a language.</li><li>Syntax includes the terms you can use and how the terms relate to each other.</li><li>Tags and elements are key parts of the HTML syntax.</li></ul><h3>Browsers and elements</h3><p>How would the <strong>em</strong> element appear on a web page in a browser? That’s a good question, and it’s not always easy to answer. HTML is a <strong>declarative language</strong>. This means that HTML describes the rules for what a page should display and how it should act, but not how a browser should implement those rules.</p><p>The standards body <a href="https://whatwg.org/">Web Hypertext Application Technology Working Group (WHATWG)(opens in a new tab)</a> governs the language of HTML by defining what HTML rules <strong>parsers</strong> should support. Parsers are tools that interpret HTML rules. An example of a parser is a web browser.</p><blockquote>The em element represents stress emphasis of its contents</blockquote><p>Notice that this text does not tell developers <em>how </em>to display an emphasis on the text in between the element tags when a browser encounters that element. It only specifies that the text in between the element needs to stand out from other text around it. Many browsers implement the emphasis element as italicized text. Because of this, the specification includes this note:</p><blockquote>The em element isn‘t a generic italics element. Sometimes, the text is intended to stand out from the rest of the paragraph, as if it were in a different mood or voice. For this, the i element is more appropriate.</blockquote><blockquote>“The em element also isn’t intended to convey importance; for that purpose, the strong element is more appropriate.</blockquote><h3><strong>Nesting elements</strong></h3><p>Elements can relate to one another and aren’t isolated from other elements around them.</p><p>Suppose you are packing your suitcase for a trip. You have to figure out the best way to put items in so your suitcase stays relatively organized while you travel. One approach would be to put all your items in the main part of the suitcase. Your socks, shampoo, and shoes all occupy the same space as the main part of the suitcase.</p><p>This might work fine when you pack, but your suitcase will quickly become disorganized as you travel and need to pull things out.</p><p>Another approach is to use smaller bags for each category of items you pack. You have a small bag for your socks, another for your shampoo, and a third for your shoes. Each of these bags goes into your suitcase, and you can pull out each bag individually as needed.</p><p>Developers can <strong>nest</strong> HTML elements as you would nest the small bags and the suitcase. Nesting occurs when developers include some <strong>HTML elements</strong> in between other <strong>HTML elements</strong>. An HTML element that contains another is that element’s <strong>parent</strong>. The HTML elements inside the parent are the <strong>child elements</strong>.</p><p>Here is an example of child paragraph (p) elements nested in a parent division (div) element:</p><pre>&lt;div&gt;<br> &lt;p&gt;paragraph 1&lt;/p&gt;<br> &lt;p&gt;paragraph 2&lt;/p&gt;<br> &lt;p&gt;paragraph 3&lt;/p&gt;<br>&lt;/div&gt;</pre><p>This<strong> nesting </strong>approach helps give the <strong>HTML document structure</strong>. It also tells parsers like <strong>web browsers</strong> how to handle the properties of those elements. For example, child elements can <strong>inherit </strong>style properties that apply to the parent element. <strong>Inheritance</strong> occurs when all the child elements take on a property set on a<strong> parent element.</strong> A <strong>parent element</strong> with a <strong>bold style</strong> might pass down that style to all the child elements.</p><h3><strong>The anatomy of an HTML page</strong></h3><p><strong>Web pages</strong> that most people experience are the interesting text, cool graphics, and engaging videos that make up the content of the page. Each of those content pieces is enclosed in HTML tags. However, there are parts of an HTML page that users don’t see that make up the page’s structure.</p><p>The standards body<strong> WHATWG </strong>defines the basic structural elements each HTML page should include. These elements are sections of a web page that parsers use to define how they should handle the elements in those sections. HTML documents should include all the following <strong>section elements</strong>.</p><p><strong>The DOCTYPE declaration</strong></p><ul><li>The <strong>DOCTYPE declaration </strong>is &lt;!DOCTYPE html&gt; .</li><li>This declaration describes the version of HTML that is being used.</li></ul><p><strong>The HTML element</strong></p><ul><li>The <strong>HTML element </strong>is &lt;html&gt; &lt;/html&gt;.</li><li>This element wraps all other elements on a page. It defines the type of document — an HTML document — that the parser is reading.</li></ul><p><strong>The header element</strong></p><ul><li>The <strong>header element</strong> is &lt;head&gt;&lt;/head&gt;.</li><li>This element defines other resources, such as<strong> metadata, scripts, </strong>and <strong>styles</strong> that the HTML page uses. Typically, the items in the head element are not experienced directly by the user.</li></ul><p><strong>The body element</strong></p><ul><li>The <strong>body elemen</strong>t is &lt;body&gt;&lt;/body&gt;.</li><li>This element is where most of the page‘s content will be placed. The elements in this section might use resources like scripts and styles defined in the head section.</li></ul><p><strong>In HTML, these elements are related as follows:</strong></p><pre>&lt;!DOCTYPE html&gt; <br>&lt;html&gt;<br> &lt;head&gt;<br> &lt;/head&gt;<br> <br> &lt;body&gt;<br> &lt;/body&gt;<br>&lt;/html&gt;</pre><p>Every HTML document should start with this basic framework. Notice that the head and body elements are nested in the HTML element.</p><h3><strong>Common HTML elements</strong></h3><p>Building an HTML page from scratch is a lot like making a meal. When you are preparing food, you have the option to use different spices.</p><p>For some dishes, recipes might call for common spices like salt, pepper, garlic, or curry. Spices like saffron, coriander, dill, and sumac are used in fewer dishes. Many HTML pages use common elements though the possibilities are broad. You will learn about some of the more common elements and their functions.</p><h4>Here are some common text and image elements you can use to build basic web pages:</h4><ul><li><strong>Paragraph</strong> &lt;p&gt;&lt;/p&gt;</li></ul><p>Use to format text that needs to flow with one another.</p><p>Paragraph elements typically have a margin at the top and bottom to provide space between surrounding elements.</p><ul><li><strong>Header</strong> &lt;h[1–6]&gt;&lt;/h[1–6]&gt;</li></ul><p>Use to emphasize sections of text hierarchically.</p><p>There are six main heading levels each formatted differently to show a decreasing level of hierarchy. The h1 element is the highest level and h6 is the lowest. This is different than the &lt;head&gt; element which is an HTML section.</p><ul><li><strong>Anchor</strong> &lt;a&gt;&lt;/a&gt;</li></ul><p>Use to link to another document or resource.</p><p>The anchor tag requires additional information to link to another document. For example, you can link to the home page of your favorite website by using the anchor element.</p><ul><li><strong>Span</strong> &lt;span&gt;&lt;/span&gt;</li></ul><p>Use for word or sentence-level text.</p><p>This element is useful for styling single sentences within a paragraph or section. This element is also useful when laying out pages with a lot of individual words or sentences.</p><ul><li><strong>Blockquote </strong>&lt;blockquote&gt;&lt;/blockquote&gt;</li></ul><p>Use for the text of a quote from another source.</p><ul><li><strong>Break</strong> &lt;br&gt;</li></ul><p>Use to break text to a new line.</p><p>There is no other formatting implied with this element. For example, the element does not add a top margin. This element does not have a closing tag.</p><ul><li><strong>Image</strong> &lt;img&gt;&lt;/img&gt;</li></ul><p>Use to include an image in an HTML document.</p><p>It must include the src (source) attribute which points to a valid location of the image. For example, you can use &lt;img src=“https://www.mysite.com/images/myimage.jpg”&gt;Image of my cat&lt;/img&gt;</p><ul><li><strong>Horizontal rule</strong> &lt;hr&gt;</li></ul><p>Use to place a visual break between other elements.</p><p>This typically is implemented as a straight, horizontal line. It can be modified with styles. This element does not have a closing tag.</p><blockquote>These common HTML elements can be found in almost every document, and they are the most common and basic elements.</blockquote><h3><strong>Introduction to attributes</strong></h3><p>When you purchase a new device like a mobile phone, you can modify the phone with options. You can get more memory, choose from a variety of colors, choose the size, and choose from different camera options. These options differentiate the phone you choose from the base model. In each case, the options you choose are attributes of the phone. An <strong>attribute</strong> in this context is a feature of something that modifies the base item in some way.</p><p>Attributes modify HTML elements. Web developers use attributes to change the style of the element, set a property like where an anchor tag should send the user and include metadata for use by a scripting program.</p><p>Typically, HTML attributes are included in the open tag of an element. They are included after the element name and before the closing bracket of the opening element. This example shows a paragraph tag with the style attribute that changes the color of the text in the paragraph element to green.</p><pre>&lt;p style=“color:green;”&gt;This text is green&lt;/p&gt;</pre><p><strong>And here is a diagram to show the parts of the element with this style attribute:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NNcrHxXoDMTXm1ZG4Pd8OA.png" /></figure><p><strong>Modify an element’s style: </strong>Using the style attribute, you can change the appearance of the elements. You also can use the class or id attribute to use a stylesheet style to control how it appears.</p><p><strong>Provide data for interactions and media: </strong>You use an attribute in the anchor and image tags to tell the browser where to send people or what images to bring to your web page.</p><p><strong>Specify event interactions: </strong>You can point to JavaScript functions by using event attributes on certain elements. This will make your web pages dynamic and provide interactive elements.</p><p><strong>Include metadata: </strong>Metadata is information used by the website that users typically do not see. Some of the attributes are used to add more information to elements to make the website visible to search engines or accessible to screen readers.</p><blockquote>Attributes are ways to extend the power of elements on your web page and create exactly the look and feel you want to give your users. Like all HTML code, attributes have a syntax. Learning the syntax for any element you want to modify will be an important part of your web development experience.</blockquote><h3>Attributes of attributes</h3><p>Suppose you want to change the background color of your mobile device. You might go into your phone’s settings, find the background setting, and then find the color setting for the background. The background is an attribute of your phone. The color setting is an attribute of the background attribute. Devices use these types of embedded settings for many aspects of the overall experience.</p><p><strong>Some HTML attributes work in the same way. Many attributes also have their own attributes (also called properties) that you can set:</strong></p><ul><li>The “parent” is an attribute of the element.</li><li>The “child” attributes are modifications you can set on the parent.</li></ul><p>The style attribute is a good example. Previously, you learned about styling a paragraph tag:</p><pre>&lt;p style=“color:green;”&gt;This text is green&lt;/p&gt;</pre><p>The style attributes are applied to the paragraph element. The style element also has an attribute, which is <strong>color</strong>. That is set to green. Style has a variety of attributes you can set, and they‘re separated by semicolons. Here is an example of the paragraph element with two style attributes set.</p><pre>&lt;p style=&quot;color:green; font-weight:bold;&quot;&gt;This text is green&lt;/p&gt;</pre><p>The style attribute will turn the text green and bold the text “This text is green”. All the properties of an attribute, like style, change the parent element. So color is an attribute of the style attribute that changes the color of the text of the paragraph element.</p><blockquote>When learning HTML syntax, you‘ll learn which attributes a given element supports. This is the first step. The next step is learning how to modify the elements using the properties of those attributes.</blockquote><blockquote>Web developers place attributes inside the opening tag of the element.</blockquote><h3><strong>Common attributes</strong></h3><p>The attributes you will use as a web developer vary greatly on the elements you need to include based on your design. However, there is a set of attributes that are common to many elements which you‘ll use often, such as:</p><ul><li>Style and layout attributes</li><li>Action attributes</li><li>Event attributes</li></ul><p>It‘s not only important that you know how to write your code, but also that you can read code from other developers. Being familiar with common attributes will help you, both as a code author and as a reviewer.</p><h4>Style and layout attributes</h4><p>Many elements can be styled using an inline style or using stylesheet attributes. Styling elements enable users to have an engaging experience. Here are some common attributes you can use when laying out and styling your pages.</p><p><strong>style — </strong>Sets the style of the element using a variety of properties and values. Which properties can be set to is determined by the element to which the style attribute is applied.</p><p><strong>id</strong>- Sets the reference of an id style in a stylesheet. id styles are used by a single element.</p><p><strong>class- </strong>Sets the reference of a class style in a stylesheet. Class styles can be used by one or more elements.</p><p><strong>display- </strong>Sets how the element should be presented relative to other elements. For example, “display: inline” will force the element and nearby elements to be presented next to each other horizontally</p><p><strong>aria-label- </strong>Sets a name or label to HTML elements for assistive technology (for example, screen readers).</p><h4>Action attributes</h4><p>Some elements rely on attributes to determine what action to enable for that element. For example, the attribute can specify what to do when a user clicks a link or when the web page needs to locate a resource. Here are some common action attributes.</p><p><strong>href- </strong>Sets the destination of a linked resource like a hyperlink.</p><p><strong>src- </strong>Sets the location of a resource like a media file that should be brought into the web page.</p><p><strong>Autofocus- </strong>Instructs the browser that the element should get the focus when the page loads.</p><p><strong>Draggable- </strong>Indicates whether the element is draggable or not.</p><h4>Event attributes</h4><p>Some elements rely on attributes to determine how to respond to an event. For example, the attribute can specify what script to run when a user clicks a button. There are many event attributes you can use to create a dynamic website. Here are a few of the most used attributes.</p><p><strong>onclick- </strong>Sets the script function to run when the user clicks the element.</p><p><strong>onerror- </strong>Sets the script function to run when an error occurs.</p><p><strong>onkeypress- </strong>Sets the script function to run with the user pressing a key.</p><p><strong>onscroll</strong>- Sets the script function to run when the user scrolls the page.</p><blockquote>As a user moves up and down the page, they are scrolling. Toby can add an onscroll element that sets a script function for images to appear when the user scrolls.</blockquote><blockquote>By using the style attribute, you can change the appearance of text that is in an element.</blockquote><blockquote>You can use the href attribute to set the destination of a linked resource, such as a hyperlink.</blockquote><h3><strong>Organizing code</strong></h3><p><strong>Why does organizing code matter?</strong></p><p>Imagine you are traveling overseas and need to get a passport. To apply for the document, you need your personal identification card, like a social security card. It‘s been years since you‘ve had to use your social security card, and you put it in a drawer with a lot of other documents. You open the drawer to find the card, and all you see is a jumble of papers and folders. You have no idea where it is in the mess of papers. Ten minutes later, you discover it in a random folder. “I should have organized this drawer months ago!” you think to yourself.</p><p>Similarly, when you‘re developing a web page, it is important to organize the code and content on the page. Organizing your code will help your users and it will help you as a developer. You‘ll benefit from <strong>code organization</strong> as a developer. Your users will benefit from <strong>information organization</strong>.</p><h4>How does organizing your code help you as a web developer?</h4><h4>Find code easily</h4><p>As a developer, organizing your web page will help make your code scannable and easier to navigate. Many times, you will leave a project for weeks or months at a time. When you get back to it, you‘ll need an easy way to find sections of code. Organizing your code can make it easier to find what you need.</p><h4>Make collaboration smoother</h4><p>Well-organized HTML can help you when coding with others. If everyone on your team knows the expected layout, then others can find, create, and edit code to make handoffs smoother.</p><h4>Load information faster</h4><p>Certain organization techniques can help your site load faster. This is both a benefit for you and your users. For example, putting your scripts in the head element can speed up how quickly your users can access the information on the site.</p><h3>How does organizing information help your users?</h3><p><strong>Information is easier to find. </strong>Organizing information for users is a different responsibility than writing, documenting, and maintaining legible code. A UX designer might provide layout guidance in a design that the developer must deliver that makes it easier for users to find what they need. An organized information layout has these features:</p><ul><li>There is a grouping of similar items.</li><li>There is enough <strong>negative space</strong> (areas where there is no content) to make reading easier.</li><li>There is judicious and thoughtful use of menus.</li><li>The use of fonts and colors is thoughtful and used consistently.</li></ul><p><strong>Information is searchable. </strong>Modern HTML includes what are called <strong>semantic elements</strong>. Semantic elements are self-describing in that the element name indicates what the element contains. Search engines are designed to look for semantic elements, making sites that use them easier to search for information.</p><h3>Organization techniques that help developers</h3><p>As with any complex environment, there are lots of ways to organize your code. Even so, web developers have settled on a small set of best practices that will help any web developer stay organized.</p><ul><li><strong>Include code comments</strong></li></ul><blockquote>Web developers use <strong>code comments</strong> to earmark sections, document how code works, and keep to-do lists, among other practices. Code comments are not visible in the presentation of a web page. But be careful! Your page‘s source code is available for users so don‘t include anything in comments that you don‘t want to be made public.</blockquote><blockquote>Commenting code takes time and effort to do well, but the overall time and effort saved by web developers who will use this code in the future is significant.</blockquote><blockquote>Each web language has its own syntax for comments so the interpreter or compiler does not try to treat the comment as a line of code.</blockquote><p><strong>. Follow code style conventions</strong></p><blockquote>Many web development teams adopt a <strong>code style convention</strong>. A code style convention specifies how developers should write certain types of code objects. This helps teams follow a consistent pattern making it easier to find and edit code. Here are some conventions teams use.</blockquote><blockquote><strong>Camel casing</strong> is a method for naming certain types of objects. Camel casing a name combines multiple words without spaces and makes the first word lowercase and capitalizes the first letter of subsequent words. Developers might use camel casing to name all their styles.</blockquote><blockquote>Suppose you want to create a function for a table that you’ll use to display data for a yearly report. You might create a function with the name “yearly report table.” To camel case this name, you would write it as <strong>“yearlyReportTable”</strong>. If all functions use camel casing, then whenever a developer encounters a camel-cased name, they know it’s a function.</blockquote><blockquote><strong>Dot-notation</strong> is more of a convention than a style, but some teams will separate words in a certain type of code objects by a dot.</blockquote><blockquote>A <strong>JavaScript function </strong>that generates the yearly report, for example, might be named “<strong>reports.Annual.Generate</strong>”. In this case, camel case is used in conjunction with dot notation.</blockquote><blockquote><strong>Kabab casing</strong> uses lowercase letters for each word and dashes between words. This style is a norm for naming styles in a stylesheet.</blockquote><blockquote>This is an example of kabab casing: <strong>my-new-style</strong>.</blockquote><p><strong>Apply semantic elements to sections</strong></p><ul><li><strong>Semantic elements</strong> have been in the HTML specification since HTML was first developed. They are self-describing elements that developers use to organize sections of an HTML document. HTML5 introduced some new elements that make organization easier. Here are some semantic elements.</li><li><strong>&lt;section&gt;</strong> and <strong>&lt;article&gt;</strong> divide logical or categorical sections of information. This not only helps you find information as a developer, but it can also help search engines parse your content. An example is an <strong>About us </strong>section in a blog or article.</li><li><strong>&lt;time&gt;</strong> defines time content. This element helps identify content such as open and closed hours for a business.</li><li><strong>&lt;nav&gt;</strong> is useful for earmarking a section of navigational elements. For example, web developers can use it to put a list of hyperlinks in a reference section at the bottom of a web page.</li></ul><p><strong>Create head section properly</strong></p><ul><li>The head section of your <strong>main HTML page</strong> is where you‘ll place information and references that your entire website will use. Every site has a main or index page. It‘s the page that loads when a browser reaches the URL of your site. It’s typically named <strong>index.html</strong> or <strong>default.html</strong>. HTML that you put in the head section typically is not what users see, but it‘s used by search engines and your website. Create your head section properly to improve search indexing and the speed of your website.</li><li>The items in the head section get loaded first. The head section should include any resource that you need for the rest of your site. For example, if you create a stylesheet and depend on the styles in that stylesheet on your home page, some items might not appear properly if you load the stylesheet in the body section of your site.</li></ul><blockquote>Properly using the head section of your website is an important part of organizing your code. Pay special attention to what goes into your head section and spend time researching how best to optimize the organization of that section.</blockquote><h3>What kinds of elements go into the head section of your website?</h3><p><strong>Metadata</strong><br><strong>Metadata</strong> is information about a website. You can include metadata to your website to let social media platforms know about it. Additionally, metadata aids in search engine indexing and enables people to find your content when they search the web.</p><p>The following example shows what <strong>metadata </strong>for a fictional website would look like for the social media platform Twitter. Notice this metadata includes three meta elements, each with a name attribute. The attributes contain data that Twitter can read, which provides Twitter with information about what the page contains.</p><pre>&lt;meta name=&quot;twitter:card&quot; content=&quot;summary_large_image&quot;&gt; <br>&lt;meta name=&quot;twitter:title&quot; content=&quot;The Coder&#39;s Playground&quot;&gt;<br>&lt;meta name=&quot;twitter:description&quot; content=&quot;The Coder&#39;s Playground <br>is a social media site that connects software developers. <br>Our goal is to foster collaboration, code sharing, and community.<br>Come join our growing social network and experience <br>the best of software development.&quot;&gt;</pre><p><strong>Scripts</strong><br>A <strong>script</strong> is software code that web developers use to create interactivity, manage data, and lay out a web page. The more complex your website becomes, the more you’ll need to rely on scripts to do interesting and dynamic things.</p><p>There are a lot of <strong>open source</strong> <strong>libraries </strong>you can use to enable interactivity on your site. Open source software is free to use and modify. Putting references to the script files that you’ll use in the head section of your main page ensures that the resources you need for your site are available when your site loads.</p><p>Here’s an example of a script in the site’s head section that references open source software. Notice how the HTML code references two external JavaScript files by using <strong>src attributes</strong>.</p><pre>&lt;script src=&quot;jquery-3.6.0.min.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;</pre><p><strong>Fonts</strong><br><strong>Fonts </strong>determine the typography elements on a website. Fonts can be set on individual elements or globally for all text elements on a site. If you select a custom font for your website, you should make sure that all users can see it. You need to reference the font in the head section. Here is a code example of fonts getting referenced from an external font folder into a website.</p><pre>&lt;link rel=&quot;preload&quot; as=&quot;font&quot; href=&quot;/fonts/dashicons.ttf&quot; crossorigin&gt;<br>&lt;link rel=&quot;preload&quot; as=&quot;font&quot; href=&quot;/fonts/dashicons.woff&quot; crossorigin&gt;</pre><p><strong>Stylesheets</strong><br>It’s a best practice to place <strong>stylesheet </strong>references in the head of your site. This ensures that all the styles you need for your website will be available to the elements that need them.</p><p>Here’s an example of a custom stylesheet reference.</p><pre>&lt;link rel=&quot;stylesheet&quot; id=&quot;custom-style-css&quot;<br>  href=&quot;styles/style.css?ver=6.0.3&quot; /&gt;</pre><h3><strong>Organization techniques that help users</strong></h3><p>Have you ever gone into a shop and been unable to find what you need because it’s so unorganized? The shelves might be messy, the products might be missing prices or are mislabeled, and the shelves might contain a variety of products with no organization. This can be frustrating!</p><p>Ensuring your <strong>web pages</strong> have a clear<strong> layout</strong> and<strong> structure</strong> can help your users not only find what they need but enjoy the time spent on your site. How you lay out information on your site is a part of your site’s <strong>information architecture </strong>(<strong>IA</strong>). <strong>Information architecture</strong> is the plan for how the information on your site is organized, how different pieces link together, how users will access the information, and how you present it.</p><p><strong>Here are HTML elements you can use to organize how you present information.</strong></p><p><strong>Lists</strong><br>Lists, when done properly, can present a lot of information succinctly. They also can give the reader natural breakpoints, which can help learners separate and remember information. Keep these things in mind when creating lists for a website.</p><ul><li><strong>Keep the list items succinct. Too much information can defeat the point of using a list.</strong></li><li><strong>Use lists for specific types of information. Stories or narratives belong in paragraphs.</strong></li><li><strong>Use lists for single ideas.</strong></li><li><strong>Remember formatting. List items that look great on mobile might not present as effectively on large-format screens.</strong></li></ul><p><strong>HTML supports three types of lists:</strong></p><ul><li><strong>Unordered lists</strong>, which you might think of as a bullet list, are designated by the element <strong>&lt;ul&gt;&lt;/ul&gt;</strong>.<strong> </strong>You can change the style of bullets from round to other shapes like square or diamonds using a stylesheet or an inline style.</li><li><strong>Ordered lists</strong>, as the name implies, are numbered or lettered. You create these using the <strong>&lt;ol&gt;&lt;/ol&gt;</strong> element.</li><li><strong>Description lists</strong> list terms. Each list item includes a description of its term.</li></ul><p>Both o<strong>rdered</strong> and <strong>unordered list</strong>s implement the <strong>&lt;li&gt;&lt;/li&gt;</strong> element to add items to their lists. Whether they appear as a bullet list or a number list is dependent on the parent element type. Notice that each of these elements are semantic in that the element names themselves describe what the elements contain.</p><p><strong>Here’s an example of an ordered list and the HTML that would produce it.</strong></p><ol><li><strong>Item 1</strong></li><li><strong>Item 2</strong></li><li><strong>Item 3</strong></li></ol><pre>&lt;ol&gt;<br>        &lt;li&gt;Item 1&lt;/li&gt;<br>        &lt;li&gt;Item 2&lt;/li&gt;<br>        &lt;li&gt;Item 3&lt;/li&gt;<br>&lt;/ol&gt;</pre><p>By using the <strong>unordered list element</strong>, the same list can be changed to a bullet list by changing the &lt;ol&gt; element to a &lt;ul&gt; element.</p><p><strong>Here’s an example of an unordered list and the HTML that would produce it.</strong></p><ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul><pre>&lt;ul&gt;<br>         &lt;li&gt;Item 1&lt;/li&gt;<br>         &lt;li&gt;Item 2&lt;/li&gt;<br>         &lt;li&gt;Item 3&lt;/li&gt;<br>&lt;/ul&gt;</pre><p><strong>Description lists </strong>work slightly differently, using the &lt;dt&gt; element for the term and the &lt;dd&gt; element for the description.</p><p><strong>Here’s an example of a description list and the HTML that would produce it.</strong></p><p><strong>Item 1<br> Description 1</strong></p><p><strong>Item 2<br> Description 2</strong></p><p><strong>Item 3<br> Description 3</strong></p><pre>&lt;dl&gt;<br> &lt;dt&gt;Item 1&lt;/dt&gt;<br>      &lt;dd&gt;Description 1&lt;/dd&gt;<br> &lt;dt&gt;Item 2&lt;/dt&gt;<br>      &lt;dd&gt;Description 2&lt;/dd&gt;<br> &lt;dt&gt;Item 3&lt;/dt&gt;<br>      &lt;dd&gt;Description 3&lt;/dd&gt;<br>&lt;/dl&gt;</pre><p><strong>Tables</strong><br>In HTML, you can use tables to present information in an organized way. Tables help users find information quickly and keep it structured.</p><p>Historically, tables were also used for layout. Newer versions of HTML (since HTML4) have discouraged this practice. The newest version of HTML, HTML5, along with the newest version of CSS, CSS3, provide tools to avoid using tables for layout. However, it’s important for web developers to know about the historic use of tables in case they encounter it on existing sites.</p><p><strong>Organizing code can make it easier for a web developer to find what they need and for others they collaborate with to find code and information they need.</strong></p><p><strong>A web developer includes information and references for the entire website, such as custom font files and metadata, in the head section of an HTML page.</strong></p><p><strong>Web developers use semantic elements to organize sections of an HTML document. For example, &lt;nav&gt; is useful for earmarking a section of navigational elements like a list of hyperlinks in a reference section at the bottom of a web page.</strong></p><h3><strong>Coding with style: Using CSS</strong></h3><h4><strong>What is CSS?</strong></h4><p>Do you paint the walls or hang posters? What colors do you want in your room? Do you want to show off your models and have all your collectibles on your desk? Or do you go for a cleaner look? You’re trying to decide what style you want for your room. Web developers decide on a style for websites, too.</p><p>A website’s style includes everything from the color palette to the fonts that users see. Web developers add styles to their sites using <strong>inline styles</strong> or a <strong>stylesheet</strong>.</p><ul><li>Inline styles are applied at the element level using the style attribute.</li><li>A stylesheet is a collection of styles.</li></ul><p>Web developers often use <strong>CSS </strong>to apply styles to a website. So, what is CSS? It is a programming language that web developers use to describe the style, layout, and presentation of web documents. CSS is used with web documents written in markup languages like HTML. And web developers use CSS because it helps organize web documents by separating presentation elements from content.</p><blockquote>The acronym CSS stands for<strong> cascading style sheets. </strong>While the term might imply that CSS technology only applies to stylesheets, CSS refers to styles in general whether they come from a stylesheet or an inline style. CSS was created to address challenges that web developers faced when adding design to web pages.</blockquote><h4><strong>How do styles cascade?</strong></h4><p>Children get their appearance and even their behaviors from their parents. The blend of their parents creates the unique features of the child. Even so, children develop their own unique personalities and appearances.</p><p>CSS styles behave in a similar way. As you’ve learned, elements can be in parent-child relationships. These relationships impact how elements are styled on a web page.</p><blockquote>There are two primary ways styles relate to each other in elements that have a parent-child relationship. Styles can be <strong>inherited</strong> or <strong>overridden</strong>. The following examples use inline styles, but the concepts apply to stylesheets as well.</blockquote><h3>Inherited style</h3><p>In HTML, styles can be inherited by <strong>child elements</strong> from <strong>parent elements</strong>.</p><ul><li><strong>A child element is one that is wrapped by one or more elements.</strong></li><li><strong>An element that wraps another element is that element’s parent.</strong></li></ul><p>The &lt;div&gt; element in the following example is the parent of the &lt;p&gt; element, which is the child:</p><pre>&lt;div&gt;<br>  &lt;p&gt;&lt;/p&gt;<br>&lt;/div&gt;</pre><p>You’ll notice the closing div (for division) tag comes after the closing p (for paragraph) tag, so the div tag wraps the p tag. This is important to understand in order to make sense of the cascading feature of cascading style sheets.</p><p>Styles <em>cascade </em>when a child element gets the style of parent elements.</p><p>In the following example, the parent element’s style will cascade to the child because the child doesn’t have a style applied to it.</p><pre>&lt;div style=&quot;margin-left:10px;&quot;&gt;<br>       &lt;p&gt;&lt;/p&gt;<br>&lt;/div&gt;</pre><p>What should you notice? The parent element — the div element — has an inline style that sets the left margin to 10 pixels. This will indent the element on the page by 10 pixels from the left. The child element — the p element — will also be indented by 10 pixels because the parent element style cascades to the child.</p><p>Next, in the following example, the child element also includes a left margin style with a value of 20 pixels. This will indent the paragraph element 30 pixels from the left of the page because the child element inherits the parent’s style and uses its own style. The parent style of a left margin of 10 pixels plus the child element’s style of 20 pixels will move the element 30 pixels from the left side of the page. The parent element still will be indented by 10 pixels.</p><p>Notice, too, that the p element is indented to show that it’s a child element of the div element. Indenting code for readability does not mean that the items will be indented when they appear in the browser. Developers use styles to indent items for users. Indenting the code makes it easier for web developers to identify parent and child relationships between elements.</p><pre>&lt;div style=&quot;margin-left:10px;&quot;&gt;<br>     &lt;p style=&quot;margin-left:20px;&quot;&gt;&lt;/p&gt;<br>&lt;/div&gt;</pre><h3>Overridden style</h3><p>Child elements can override some styles of parent elements. A style is overridden if the child element implements the same styles of the parent using a different value. If a style can have only one value, like a color style, the child element will override the style of parent.</p><p>The following example illustrates how this works.</p><pre>&lt;div style=&quot;color:red;&quot;&gt;<br>   &lt;p style= &quot;color: blue;&quot;&gt;&lt;/p&gt;<br>&lt;/div&gt;</pre><p><strong>Inheriting</strong></p><pre>&lt;section style=“margin-top: 20px;”&gt; <br><br>          &lt;div style=“margin-top: 10px;”&gt; &lt;/div&gt;<br>&lt;/section&gt;</pre><p><strong>Overriding</strong></p><pre>&lt;span style= “color:green;”&gt;<br>      &lt;span style= “color:black”&gt;Hello there&lt;/span&gt;<br>&lt;/span&gt;</pre><h4><strong>How do inline styles work?</strong></h4><p>Web developers can apply an inline style to an element by using the style attribute with any number of child attributes. Inline styles are useful for simple websites that use a limited number of styles.</p><p>Here’s an example of how to apply an inline style to an element using the style attribute.</p><pre>&lt;p style= &quot;font-decoration:underline;&quot;&gt;underline me&lt;/p&gt;</pre><p>While you can put styles inline in the HTML elements, doing so can become very hard to manage as you add more styles. Also, suppose you want many elements to have similar styles. When using inline styles, you’d have to apply the style attribute to every element individually. If you decide to change the style, you must change every element.</p><p>Developers created stylesheets to address some of the challenges using inline styles.</p><h4><strong>How do stylesheets work?</strong></h4><p>Stylesheets are a collection of two or more styles. Web developers who build websites with more than a few pages typically will put their styles in a separate file with a <strong>.css extension</strong>. This is called an <strong>external stylesheet</strong>.</p><p>Since a stylesheet is just a collection of styles, you also can put a stylesheet within the head element of an HTML document. Web developers refer to this as an internal stylesheet. Let’s learn about how external and internal stylesheets work.</p><h4>External stylesheets</h4><p>HTML is very good at linking to other resources rather than including everything a page needs in the page itself. If a web developer needs to include an image on a web page, they can use an image element and point to an image file. Stylesheets work in a similar way. Styles can be created in an external file with a .css extension and then brought into the HTML document.</p><p><strong>Here’s an example of an external stylesheet reference in the head section1 of an HTML document using the link element with the href attribute:</strong></p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br> &lt;head&gt;<br> &lt;link href=&quot;pagestyle.css&quot;&gt;<br> &lt;/head&gt;<br>&lt;body&gt;<br>&lt;/body&gt;<br>&lt;html&gt;</pre><p>In the previous example, the link element points to a file called pagestyle.css.<br>The following code is what pagestyle.css would contain.</p><pre>p {<br>  margin-left:20px;<br>}</pre><h4>Internal stylesheets</h4><p>While a best practice is to put styles in an external stylesheet, you can include a stylesheet in an HTML document itself. This is useful for testing or when a developer needs a single web page temporarily. Here is an example of an internal stylesheet:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>     &lt;head&gt;<br>     &lt;style&gt;<br>     p {<br>          margin-left:20px;<br>       }<br>     &lt;/style&gt;<br>     &lt;/head&gt;<br>&lt;body&gt;<br>     &lt;p&gt;text&lt;/p&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>The developer used an internal stylesheet since it is included in the HTML page.</strong></p><h3>The anatomy of a style</h3><p>Like HTML, CSS has a syntax or grammar that developers use when creating a stylesheet.</p><p><strong>The syntax</strong> for an individual style in a stylesheet is identical to the<strong> syntax </strong>a <strong>web developer</strong> uses for inline styles. For example, a developer will use the <strong>margin-left property </strong>to set the<strong> left margin</strong> in both an inline style and a stylesheet.</p><p>Stylesheets have additional syntax. A style in a stylesheet has three basic parts: <strong>A selector, a node name, and a declaration block</strong>. The declaration block has one or more styles that are made up of properties and values.</p><p><strong>The image uses the class selector as an example.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tvy5AUeXVCgt4Ra-lfIpKA.png" /></figure><ul><li><strong>Selector</strong> indicates the style type. The selector indicates whether the style can be used by one element, many elements, or all elements of a given type.</li><li><strong>Node name</strong> is the name used for the selector. The name cannot have spaces. A best practice is to use kabab casing for CSS node names.</li><li><strong>Property</strong> indicates the part of the element the style will change.</li><li><strong>Value</strong> is the unit or term that determines how the property changes the element. An example of a unit is 10px. An example of a term is bold or gray. Some properties are set by units and other properties are set by terms. Some, like font-weight, can take a unit like 700 or a term like bold which are equivalent.</li><li><strong>Declaration</strong> is the combination of a property and a value.</li><li><strong>Declaration block</strong> is the set of styles that developers write between the curly braces.</li></ul><h3>Types of stylesheet styles</h3><p>Web developers have options when implementing styles on their websites. Sometimes a developer creates a stylesheet that they want to use just on a single element. Other times, a developer wants to apply a style to every element of a given type. For example, they might want to style every paragraph element to use a particular font. Types of styles in CSS are designated by a selector.</p><p><strong><em>The three selector types in CSS.</em></strong></p><p><strong>id selector</strong></p><p>The id selector is a hash or pound symbol. id selectors can only be used on a single HTML element. Here’s an example of an id selector style:</p><pre>#font-style-bold {<br>…<br>}</pre><p><strong>Class selector</strong></p><p>The class selector is a dot or period. Class selectors can be used on any element in an HTML document that can be styled. Here’s an example of a class selector style:</p><p>.<strong>background-style-red</strong>{<br>…<br>}</p><p><strong>Element selector</strong></p><p>The element selector is an element name and automatically applies to every element with that name. To create an element selector, use the element name as the selector name and create the style or styles between the opening and closing brackets. Here’s an example.</p><pre>div {<br>margin-right: 10px;margin-right: 10px;<br>margin-top: margin-top: 20px;<br>}</pre><h3>Two selectors with the same name</h3><p>If a web developer uses the same selector name more than once in a stylesheet, the browser will combine the styles from both selectors and apply them all to the elements that use the selector. Here are two selectors that use the same name in the same stylesheet.</p><pre>.style-alert-message<br>{<br>font-weight: bold;<br>}<br>.style-alert-message<br>{<br>font-style: italic;<br>}</pre><p>The style-alert-message class will be a combination of both selectors and will display text as<strong> bold and italic.</strong></p><h3><strong>Using CSS selectors</strong></h3><p>Stylesheets are the place where web developers create the styles they want to use.</p><p>They create them in the head section of HTML pages in an internal stylesheet or in a separate file with a .css extension and reference the file in the head section in an external stylesheet.</p><p>In order to use the styles on elements in an HTML document, web developers have to apply them.</p><h4><strong><em>Here’s how web developers apply elements for the three types of selectors.</em></strong></h4><ul><li><strong>The element selector</strong></li></ul><p>The element selector is the easiest to apply. Once a web developer creates the style and references the stylesheet in the head section of the HTML document, the styles are automatically applied. Every time a browser encounters an element that matches the selector, it styles the element.</p><p>Here’s an example of a div element. If the stylesheet includes a div element selector, this div element would get the style. Notice that the element doesn’t include an attribute because the element selector applies to all elements for which the style was created.</p><pre>&lt;div&gt;Reading list&lt;/div&gt;</pre><ul><li><strong>The id selector</strong></li></ul><p>To apply an id selector to a particular element, web developers use the id attribute on that element. The id attribute can only be used on one element. If more than one element has the same id selector style, the browser will apply the style to the first element it finds with that style id.</p><p>Here’s an example of an HTML element using the id attribute.</p><pre>&lt;p id= &quot;font-style-bold&quot;&gt;This is my bolded text&lt;/p&gt;</pre><ul><li><strong>The class selector</strong></li></ul><p>Web developers apply a class selector style to an element by using the class attribute. Unlike the id selector, the class selector can be applied to as many elements as the developer would like. Web developers typically will create a class selector style for a particular type of thing on a web page like alerts, images, and forms.</p><p>Here’s an example of an element with a class selector style applied to it.</p><pre>&lt;img class= &quot;background-style-red&quot; src= /images/img1.jpg&gt;This is my image&lt;/img&gt;</pre><blockquote><strong>With this basic structure, web developers can apply styles to elements in HTML!</strong></blockquote><p><strong>CSS is a programming language that web developers use to describe the style, layout, and presentation of web documents. They use CSS with web documents written in markup languages like HTML.</strong></p><p><strong>When designing multiple pages, web developers can link to a common external stylesheet to ensure their pages all use the same style.</strong></p><h3><strong>CSS box model</strong></h3><p><strong>What is the CSS box model?</strong></p><p>Web developers can use a table to lay out a page or section of a page, but using tables isn’t considered a best practice. There are some challenges, such as a lack of flexibility.</p><p>Instead, most web developers use the<strong> CSS box model</strong> to mimic the behavior of a table with columns and rows, but with additional flexibility. The CSS box model defines how a browser will render the HTML elements on a page by putting every element into its own box. In a CSS box model web developers consider the height, width, margins, content, and more for a web page.</p><p>Web developers can expect various benefits in using the CSS box model to structure the layout of web pages.</p><p><strong>Responsive design</strong></p><p>A design is responsive when it reacts to the user’s device so that a web page or web app looks native to any form factor on which it appears. Web developers want to make sure sites look and function well on devices that range from the smallest mobile phones to the largest monitors. The CSS box model provides flexibility when developers are creating web pages to develop responsive designs more easily.</p><p><strong>Customizability</strong></p><p>By structuring web pages with CSS, web developers have more options to refine how content is presented to users. With tables, developers can define the width and the height of cells, but beyond that, development is challenging.</p><p><strong>Accessibility</strong></p><p>Using the CSS box model will help make websites more accessible than other methods. Using tables for layout requires assistive technologies to provide a lot of contexts to users and can be more challenging for screen readers. For example, a screen reader will need to let users know which row and column they’re in each time they read the content of a cell. By using CSS and the box model to lay out their sites, developers can help ensure their sites are a great experience for everyone.</p><h4><strong>The components of boxes</strong></h4><p>You can start to think of the box model as you might think about a neighborhood. Imagine your city is developing a new neighborhood near you. There are going to be multiple plots of land. Each piece of land is going to include a house plus a yard that surrounds it. A fence will enclose each yard, and rows of trees or a sidewalk will surround the fences. A small section of the neighborhood might look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rcUvMNKASlpu9JP_4mmYfw.png" /></figure><p>With the CSS box model, each piece of content on your website, like a body of text or an image, has its own box, as each house in the neighborhood has its own plot of land. By using CSS, you can set things like the width and height of the box as well as margins and padding.</p><p>Using this neighborhood example, take a moment to examine the following diagram. It shows the CSS box model and its main components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ad-X6HQfAXh0r3nOvZ_-pg.png" /></figure><p><strong>You can see CSS boxes have these four main components:</strong></p><ul><li>Content area</li><li>Padding</li><li>Border</li><li>Margins</li></ul><p>Web developers can control how each box behaves, depending on the scenario, by applying attributes to each of these components.</p><p>Early in web development, the box properties were set in <strong>pixels (px)</strong>. A pixel is the size of the smallest individual element of a screen. Computers build images on a screen with millions of individual pixels!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*QnBM44pitTVZ8ewFxcMQQw.png" /></figure><p>In web design, calculating the length and width of a pixel is complex. What’s important is that a pixel is a consistent size in terms of layout. For example, when you specify a width in CSS, you specify it in pixels, such as <strong>width: 20px</strong>.</p><p>When you develop your CSS this way, you are instructing the computer that the width of a particular element should always be the same width regardless of the size of the screen on which it appears.</p><p>One of the main advantages of the CSS box model is that web developers can define the components of each element box to truly customize the layout of a page.</p><p><strong>Height</strong></p><p>Web developers can set the height of the box to dynamically respond to the size of the browser or other boxes around it. They can also set the height to remain fixed regardless of the size of other boxes around it or the browser. Developers can even set the maximum and/or minimum height the box can be</p><p><strong>Width</strong></p><p>Similar to height, web developers can set a dynamic or static width and can set a maximum and/or minimum width.</p><p><strong>Margins</strong></p><p>Web developers can set margins for the top, bottom, right, and left of the box. Margins determine the distance to other elements on the screen. Margins can also be set to be dynamic or static.</p><p><strong>Padding</strong></p><p>Web developers set the padding distance from inside the box to the content items it contains and set top, bottom, right, and left padding in one style or individually. Margins can also be set to be dynamic or static.</p><p><strong>Border</strong></p><p>Web developers use borders to frame content within an area. Borders can be set the same size or different, varying sizes. If a border is not specified, then no border will be set.</p><p>Now you know what each of the CSS box model components is and how developers can define each component.</p><p>But when a developer sets the attributes of each of the components, how does it impact the design of the page?</p><p>Understand how height, width, margins, and padding impact layout and design of an example web page.</p><p>The colored areas are not visible to users, rather they show how the CSS box is created using CSS attributes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eZOtSDDblwFoCwMmpxaCcQ.png" /></figure><p><strong>What’s important to learn from this example?</strong></p><ul><li>You will notice that the height of box is set to 1024 pixels, while the width is set to 100%. In this example, the height of the box is <strong>static</strong>, meaning that it will not change, even on a smaller screen. But the width is <strong>dynamic</strong>, meaning that if the size of the screen is reduced, the width of this particular box will be 100% of the width of the screen.</li><li>You will also notice that the developer set the top, bottom, left, and right margins. If the web developer were to place another box below this box, there would be 50 pixels of space between the two boxes unless that box had a defined top margin.</li><li>Finally, the web developer set the top, bottom, left, and right padding. The content of the box would always be 10 pixels from the left of the box border.</li></ul><p><strong>The margin sets the distance from the box to other boxes. Web developers use margins to create additional space between elements on web pages.</strong></p><h3><strong>Set the width and height of a CSS box</strong></h3><p>You know how to identify the components of the CSS box model, but what code does a web developer need to write to create a box?</p><p>Suppose you want to create a box for the <strong>hero section</strong> of your site. The hero section is usually the first content a user will see when they visit your site. It appears below your logo and header information.</p><p>For your page, you want the width of your hero CSS box to be the full width of the browser. As the browser changes width, you would like the box to change with it. You want the height to always be 500 pixels.</p><p><strong>Here are the steps you should take to create this style:</strong></p><p>1- Create an id selector in your CSS stylesheet, and name it <strong>“hero-main-page”</strong>, which is self-describing. You’ll use an id selector since you‘ll only use the style on the hero box. Your code should look like this:</p><pre>#hero-main-page{</pre><p>2- Next, you’ll set the width to 100%. Your code should look like this:</p><pre>#hero-main-page{<br>width: 100%;<br>}</pre><p>3- Then, you should set the height to 500 pixels. Your code should look like this:</p><pre>#hero-main-page{<br><br>    width: 100%;<br><br>    height: 500px;<br>}</pre><p>4- And finally, you’ll apply the style to a div element in your HTML file. Your code should look like this:</p><pre>&lt;div id=“hero-main-page”&gt;<br><br>..<br><br>&lt;/div&gt;</pre><p>As you just experienced, creating a CSS box is simply a matter of setting CSS properties on a style and applying that style to an element such as a &lt;div&gt;. You can apply the same approach to setting other box properties, such as margin and padding.</p><p><strong>The CSS box model supports accessibility because their elements are easier for a screen reader to parse and read back to the user.</strong></p><p><strong>The benefits of the CSS box model is that web developers can define the main components of each element box to customize the layout of a page, develop responsive designs, and make websites more accessible for users of different abilities.</strong></p><h3><strong>Best practices for writing HTML and CSS</strong></h3><h4><strong>HTML and CSS best practices</strong></h4><p>Web developers rarely work alone. Many work in teams and on projects that include many pages and hundreds, if not thousands, of lines of code. Because of this, software teams develop <strong>best practices</strong> to ensure code is readable, maintainable, and can be read by any software developer. A best practice is a set way to complete a task so that the results turn out as expected. It is a standard, practice, or convention that people follow to ensure consistency, predictability, and quality. Some best practices are defined at a team level. Others are defined at the industry level.</p><h4><strong>Set a proper doctype declaration</strong></h4><p>Suppose you have a friend who is a native English speaker and speaks three more languages: French, Spanish, and Hindi. When a Hindi speaker approaches your friend and begins speaking in their native tongue, your friend immediately determines which language it is and begins internally translating what they’re hearing. While it happens almost immediately, your friend categorizes which language they’re hearing and begins translating based on that categorization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x19q_S9XuXEdERzk9rYl1w.png" /></figure><p>Like your friend in the example, web browsers can read many different languages. But unlike your friend, for the browser to understand the code of a markup language, it has to be told which version of the language it is about to read. Every HTML document needs a <strong>doctype declaration</strong> so the browser renders your web page in the way that you expect. The doctype declaration tells the browser what version of HTML you are using. It must appear at the top of your document.</p><p>The following image shows a code editor with HTML set as the document type and English as the language. The doctype declaration is at the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*Z22vrdnO6HpW-uzgwdh-CA.png" /></figure><p>For HTML5, the doctype declaration is placed at the very top of the HTML file. In fact, it’s the first line of the file and comes before the &lt;head&gt; element. Its syntax is relatively simple:</p><pre>&lt;!DOCTYPE  html&gt;</pre><p>While the syntax is fairly simple for HTML5, there are a few important things to keep in mind.</p><h4>HTML has variations</h4><p>The doctype declaration is not the same for all versions of HTML. For example, the HTML4 declaration would be written as:</p><p>&lt;!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”</p><p>“http://www.w3.org/TR/html4/strict.dtd&quot;&gt;</p><h4>It’s not an element or a tag</h4><p>The doctype declaration is neither an element nor a tag. Web developers only use the doctype declaration at the very beginning of a document to declare the version of HTML that is being used. But they don’t use the declaration anywhere else in a document, and it does not need a closing tag.</p><h4>Case doesn’t matter</h4><p>When a developer puts the doctype declaration at the beginning of an HTML document, the browser doesn’t particularly care if it is written &lt;!DOCTYPE html&gt; or &lt;!doctype html&gt; or &lt;!Doctype html&gt;. However, it is commonly written &lt;!DOCTYPE html&gt;.</p><h3><strong>Use stylesheets over inline styles</strong></h3><p>Inline styling can seem like the best option if you are just building a small page or don’t want to go through the hassle of creating a separate CSS file. While inline styles have a purpose, they are not the best way to build a website. It’s a best practice to use external stylesheets, or even internal stylesheets. Separating the style from the HTML content is known as <strong>separation of concerns</strong>.</p><p>The following image show a code editor in which the HTML code is linking to an external stylesheet called “addCSSdemo.css”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*wDok1PcGPmVFuipUboDG8w.png" /></figure><p>Stylesheets help web developers create better websites. Here are some reasons and benefits of using stylesheets to build a website.</p><p><strong>Size and speed</strong></p><p>Inline styles require web developers to apply the same style individually to each element. This means that the web page file sizes are larger and might slow down load times because the browser has to parse the style for each element separately.</p><p>So, for size and speed, it’s better for developers to use external style sheets. These keep the web page file sizes smaller and enables faster load times so that users can interact with websites more quickly.</p><p>Say you have a large HTML document that has five headers, 13 paragraphs, and eight quotes. By using an external stylesheet, you could create a single stylesheet that contains one style for your headers, another one for your paragraphs, and a third for your quotes. Then you could apply those styles using class selectors.</p><p><strong>Maintenance</strong></p><p>Putting all styles in an external stylesheet can make it easier for web developers to change the style of web pages and update style work done by other members of a web development team. Since all the styles are in one place, finding and updating, removing, or replacing styles is more straightforward.</p><p>Imagine a company brings you in as a new web developer to work on a website that they just rebranded. The website is a few years old, and the client would like you to update it with new branding for the colors, logo, fonts, and brand images. They also want you to support a refresh of the content and functions of the site. The previous web developer used a mix of external, internal, and inline styling in the website’s code base.</p><p>Now, to make the changes, you need to check three different places to make sure that you implement all the new styles to all the elements on all the pages. You can see how maintenance would be much easier and save time if the previous web developer put most of the styles in an external CSS file.</p><p><strong>Separation of concerns</strong></p><p>Separation of concerns is a principle that aims to keep separate parts and functions of a computer separate to simplify code and make the system easier to maintain.</p><p>In web development, developers primarily use:</p><ul><li>HTML (the HTML document) for the layout and presentation of content.</li><li>CSS (the CSS file) to define presentation style.</li></ul><p>Web developers consider separating content and design as a best practice because it makes code easier to read and easier to maintain.</p><h3><strong>Remember to close tags</strong></h3><p>When you learned to write, you learned about punctuation and how to form sentences using punctuation. Now, if you were to write a report, you would follow proper punctuation conventions. If you left out punctuation, the reader would probably still be able to read the sentences, but it would become much more difficult. So, when you write, you add punctuation to your sentences to help the reader.</p><p>In the same way, browsers and HTML syntax are very forgiving, but browsers still rely on code to tell them what to render. Most HTML elements have an <strong>opening tag </strong>and a <strong>closing tag</strong>. Closing tags look like opening tags, but the tag name is preceded by a backslash.</p><p><strong>Here’s an example of an element with opening and closing tags.</strong></p><pre>&lt;p&gt;This is a paragraph&lt;/p&gt;</pre><p><strong>And here’s an example of an element without a closing tag.</strong></p><pre>&lt;p&gt;This is a paragraph</pre><p>While most modern browsers would still be able to figure out how to render an element without a closing tag, it is a best practice to close elements.</p><p><strong>Makes pages nimble</strong></p><p>Like punctuation, tags help a browser know when one piece of content ends, and another begins. Browsers parse the HTML document one character at a time. So, closing tags help the browser define the scope of the content. Without the proper closing tags, the browser will need to work harder to determine how the document is structured and this can slow the page or site down.</p><p><strong>Makes pages cross-compatible</strong></p><p>Another reason to use closing tags is that it is important for HTML documents to be cross-compatible with as many browsers as possible. Some browsers will take care of errors in poorly written HTML, but not all browsers can handle errors.</p><p><strong>Makes code legible</strong></p><p>Finally, using closing tags is good coding practice to keep code readable and legible for everyone. It helps web developers work better within teams and understand code months after they‘ve written it. Writing clean code also makes it easier for web developers to diagnose bugs in the code.</p><h3><strong>Use the power of integrated development environments (IDEs)</strong></h3><p>Some do-it-yourself aficionados have a workbench in their garage that organizes and holds their tools in one space. In the same way, web developers can use <strong>integrated development environments </strong>(<strong>IDEs</strong>) to keep their development tools in one place. IDEs are software that have a central user interface that includes all the tools a developer needs. IDEs were created to simplify the workflow of developers and to help them adhere to coding best practices.</p><p><strong>Intelligent code completion</strong> — Code completion reduces typos and errors by offering auto-complete recommendations as the web developer is coding. For instance, code completion technology can add closing tags when developers create an opening tag, so they never forget to close tags</p><p><strong>Autosave — </strong>Most IDEs offer the ability to autosave work. Web developers will create and open a file through the IDE, and then the IDE will automatically save work at regular intervals.</p><p><strong>Integrated debugger — </strong>Even the most well-written code can contain issues. In programming, these issues are called <strong>bugs</strong>. Integrated debuggers enable web developers to debug directly in the IDE and access all the features of the IDE to edit the code to fix the bug.</p><ol><li><strong>Tags are made up of an opening and closing angle bracket with a tag name in the middle. Elements are pairs of tags that encapsulate or wrap-around other elements or web content.</strong></li><li><strong>HTML is a declarative language, meaning it describes the rules for what a page should display and act, but not how a browser should implement those rules.</strong></li><li><strong>Nesting occurs when developers include some HTML elements in between other HTML elements.</strong></li><li><strong>An HTML element that contains another is the elements parent. The HTML elements inside the parent are the child elements.</strong></li><li><strong>HTML documents should include the &lt;html&gt; &lt;/html&gt;, &lt;head&gt;&lt;/head&gt;, and &lt;body&gt;&lt;/body&gt; elements.</strong></li><li><strong>Attributes can change the style of the element, set a property, and include metadata for use by a scripting program.</strong></li><li><strong>Organizing code and content on the page helps make code scannable and easier to navigate making collaboration smoother.</strong></li><li><strong>The best practices to help web developers stay organized are commenting, style conventions, semantic elements, and organizing the head section in a HTML document.</strong></li><li><strong>CSS is a collection of styles than a web developer uses to add design to web pages.</strong></li><li><strong>Styles can be inherited by child elements in HTML from parent elements.</strong></li><li><strong>External stylesheets are styles that are put in a separate file with a .css extension.</strong></li><li><strong>A style in a stylesheet has three basic elements: A selector, a node name, and a declaration block.</strong></li><li><strong>A declaration block has one or more style declarations that consist of properties and values.</strong></li><li><strong>To add a style to an HTML element, web developers use the class selector, id selector, element selector, or in-line styling on the element that is to be styled.</strong></li><li><strong>The CSS box model is a method of laying out a website using CSS.</strong></li><li><strong>CSS boxes have five main components: height, width, margins, padding, and border. Each of these have attributes that provide the web developer with fine-grained control over how the box behaves in a variety of scenarios.</strong></li><li><strong>Web developers follow best practices of setting doctype declarations for every HTML document, using stylesheets, using closing tags help the browser define the scope of the content, and saving and checking their work often.</strong></li><li><strong>IDEs are software that has a central user interface that includes all the tools a web developer needs. IDEs simplify the workflow for a developer.</strong></li><li><strong>IDE features include a code editor, intelligent code compilation, autosave, and integrated debugger.</strong></li><li><strong>The CSS box model is essential for creating responsive designs because it allows developers to control layout dimensions, padding, borders, and margins, ensuring the content adjusts well to different screen sizes.</strong></li><li><strong>Parser — A web browser is a tool that interprets and processes a markup language, such as HTML, and renders web pages for users.</strong></li><li><strong>The onscroll attribute sets the script function to run when the user scrolls the page, allowing Hiroto to trigger actions based on that scroll.</strong></li><li><strong>Web developers can use code comments to earmark sections, document how code works, and keep to-do lists, among other things. Commenting code takes time and effort to do well, but the overall time and effort saved by web developers who will use this code in the future is significant.</strong></li><li><strong>Moving the styles from internal CSS stylesheets to an external stylesheet centralizes the styles, making it easier to manage and update the logo color and font across the entire website. It also enhances consistency and maintainability.</strong></li><li><strong>Linking an external CSS file to HTML files allows styles to be collected in one place, ensuring that the website has a consistent style across all pages. Separating the style from the HTML content with an external CSS files is an example of separation of concerns.</strong></li><li><strong>Setting a proper doctype declaration tells the browser what version of HTML web designers are using and ensures that the browser renders web pages the way they expect.</strong></li><li><strong>Closing tags help the browser accurately interpret the document structure, which improves page load performance.</strong></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1cc8649f058" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Function of JavaScript: Interaction]]></title>
            <link>https://medium.com/@joaquimdacosta1999/function-of-javascript-interaction-dab361e3b15e?source=rss-5501c69de547------2</link>
            <guid isPermaLink="false">https://medium.com/p/dab361e3b15e</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Joaquim Costa]]></dc:creator>
            <pubDate>Tue, 16 Sep 2025 14:34:57 GMT</pubDate>
            <atom:updated>2025-09-16T14:34:57.138Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GlLVt2wvHdaBD37O" /></figure><h3><strong>What is a scripting language?</strong></h3><p>Early on, web pages contained text with hyperlinks. Today’s web pages are filled with functionality that lets you do everything from banking to creating art. As you’ve learned, HTML and CSS mainly focus on the page’s structure and how the content is presented to the user. While there are some action-oriented elements to HTML, such as hyperlinks, to create web pages that have <strong>interactions</strong>, you need to use a <strong>scripting language</strong>.</p><blockquote>When you think of the word “script,” the idea of a rehearsed set of lines in a play or movie might come to mind. That’s what early programming scripts were — a rehearsed set of lines — and why they were used to automate tasks. For example, a developer would use a script to run a program each evening to move data from a database to a backup instead of moving data one file at a time.</blockquote><p>Unlike a compiled language, a <strong>scripting language</strong> is human-readable, both when it’s written and when the browser reads it. A <strong>compiled language</strong> is not human-readable when it’s made ready for the computer. It’s <strong>compiled</strong> into machine code that only the computer can understand.</p><blockquote>Scripting languages are in the family of interpreted languages. Interpreted languages need an interpreter, which is a piece of software that reads each line of code independently and executes the code line by line.</blockquote><p>Developers originally created scripting languages to execute small tasks quickly. In fact, in the early days of computing, scripting languages were the only programming languages.</p><p>Today’s scripting languages are full-fledged programming languages, and they’re very powerful. When it comes to the web, developers use JavaScript more than any other scripting language.</p><p><strong>Speaking the language</strong></p><p>Scripting languages are interpreted right when the computer needs them. This means the code the developer writes is the code the computer uses.</p><p>Compiled languages must be translated into the language the computer understands before programs can be used.</p><p><strong>Ease of use</strong></p><p>If a change needs to be made to code written in a scripting language, a web developer can open the code file, make the change, and upload it to the web server.</p><p>Making quick changes to compiled code is more difficult because it needs to be translated before it can be used.</p><p><strong>Fast processing time</strong></p><p>Scripting languages are interpreted when the computer reads them. This means they are translated from human-readable code to code the computer understands when the program is run. This processing time tends to make scripts slower than compiled code.</p><p>Compiled languages are faster for the computer to process because they’re already in the language the computer understands.</p><h3>History of JavaScript</h3><p><strong>Inception</strong></p><p>Like CSS, <strong>JavaScript</strong> was created in the early days of the World Wide Web to address a very specific need. Early HTML pages were static because they focused on presentation. Developers wanted a way for users to be able to interact with the elements on a page. Brendan Eich, a software engineer at Netscape (a manufacturer of one of the first web browsers), helped create<strong> </strong>JavaScript to provide this ability to make web pages dynamic.</p><p><strong>Standardization</strong></p><p>As JavaScript became more popular, Netscape decided to standardize it. (A standard sets the rules and the grammar that users of the language should follow.) They submitted the language to the European Computer Manufacturers Association (ECMA) for standardization. ECMA manages the standard for JavaScript, and the generic, standardized form of JavaScript is called <strong>ECMAScript</strong>.</p><p><strong>Evolution</strong></p><p>JavaScript has evolved tremendously over the years. Due to the need for <strong>backward compatibility</strong>, the language has evolved to include many ways to do the same. Often in technology, developers find easier ways of doing certain tasks. Languages are known to be backward compatible when they support new and old ways of doing things.</p><p>You might have heard of the programming language called <strong>Java</strong>. Java is a compiled language developed by Sun Microsystems. JavaScript and Java have very little in common, and the similarity in their names causes confusion. As the story goes, the name <strong>JavaScript</strong> was given to this new scripting language mainly as a marketing tactic to capitalize on the popularity of the Java programming language at the time. The fact is that the two languages are not related.</p><p>Over time, some developers also preferred to work in an <strong>object-oriented language</strong>. An object-oriented language can create entities in the code that can persist or be modified as they are used in other parts of the program. This creates a lot of flexibility and opportunities for code reuse.</p><p>JavaScript is not strictly object oriented. For this reason, Microsoft developed <strong>TypeScript</strong>, a programming language that <strong>transpiles</strong> to JavaScript. A transpiler converts one scripting language into another. When a developer writes TypeScript, a processing script turns it into JavaScript before it is published.</p><p><strong>JavaScript is backward compatible, which means that older code will continue to work even though the language is continually updated and offers more features.</strong></p><h3><strong>What does JavaScript do?</strong></h3><p>JavaScript is likely behind the interaction when you click a button or use a drop-down menu on the web. Browsers implement an interpreter that reads JavaScript and performs actions based on the script. Like CSS, developers can place JavaScript directly in an HTML document or a separate file so all web pages can use it.</p><p>Developers often use JavaScript code to respond to an <strong>event</strong>. An event is something that happens on a web page. Here’s how it works!</p><blockquote>You initiate an event when you click a button or drag a photo on a web page. HTML elements, such as a button element, have <strong>event listeners</strong>. Event listeners receive instructions from an interaction on a web page.</blockquote><blockquote>When they get those instructions, then they can carry-out the specific tasks. In programming languages, these tasks are called <strong>event handlers</strong>. Event handlers on the web are writing in JavaScript.</blockquote><p>Here is an example of JavaScript in a button interaction in an HTML <strong>code snippet</strong>. A code snippet is a section of code that you typically use for sharing and examples. It doesn’t show the entire code that a web page needs to run properly. Notice that the event listener waits for the learner to select the button. When the learner selects the button, the event handler executes a script to show an alert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KLFjqs_cuxtB_b7pAJDTMA.png" /></figure><p>This animation shows the flow of event listeners, events, and event handlers and how JavaScript handles events. The animation shows the following HTML, which is for a button with an <strong>onclick</strong> event pointing to a JavaScript function called “sayHello”:</p><pre>&lt;button onclick=&quot;sayHello()&quot;&gt;Click&lt;/button&gt;</pre><p>The corresponding JavaScript is placed within an HTML script element and might look something like this:</p><pre>&lt;script language=&quot;JavaScript&quot;&gt; <br>sayHello(){<br>    alert(&quot;Hi there!&quot;); <br>} <br>&lt;/script&gt;</pre><p>In this example, the developer would put the script section in the header section of the web page, and the onclick event would call the sayHello function when the user clicks the button. When the JavaScript runs, a little box appears on the screen that reads, “Hi there!”</p><h3><strong>How does JavaScript interact with CSS and HTML?</strong></h3><p>JavaScript is powerful, so developers not only use it for events but also to manage data and even create HTML and CSS dynamically based on certain conditions. As in the previous code snippet example, developers use JavaScript in conjunction with HTML to extend its power.</p><p>Without JavaScript (and other scripting languages like it), users were unable to do many things that seem commonplace today like uploading and viewing photos, sending chat messages, or even watching videos.</p><p>Web developers use JavaScript in conjunction with CSS and HTML to manage data and provide feedback to users. For example, JavaScript has the ability to find CSS selectors on a page and use those selectors to find specific fields that you might want to modify based on what the user does.</p><p>Suppose you build a form with a section that uses CSS id selectors. This code snippet is a simple form that asks the user for their first name and last name.</p><pre>&lt;section&gt; <br>        &lt;input id=&quot;firstName&quot;&gt;First name&lt;/input&gt; <br>        &lt;input id=&quot;lastName&quot;&gt;Last name&lt;/input&gt;<br> &lt;/section&gt;</pre><p>A web developer can write JavaScript code and use a function called querySelector to find the HTML element with the id selector <strong>firstName</strong>. The following code snippet shows the command in JavaScript.</p><pre>document.querySelector(&#39;#firstName&#39;);</pre><p>This line of code will scan the HTML document for an element with the id attribute of firstName. Once the code finds the element, the developer can evaluate the value of the field.</p><p>Suppose the developer runs that command after the user selects the <strong>Submit </strong>button on the form and determines that the <strong>First Name field</strong> was not filled in. They can then provide a message stating that the user must fill in the field to submit the form.</p><blockquote><strong>The event is onclick. Freda programmed the onclick event to call the alert message when users select Submit.</strong></blockquote><blockquote><strong>The pound or hash symbol (#) in the querySelector function tells JavaScript to look for an id attribute.</strong></blockquote><blockquote><strong>JavaScript provides web developers with the ability to add interactivity to web pages and make them more dynamic. This is an example of this type of interactivity.</strong></blockquote><blockquote><strong>JavaScript allows web developers to build interactions such as triggering alerts based on events, building form validation, allowing users to upload and view images, and providing a way to add dynamic content to your website.</strong></blockquote><h3><strong>From requirements to launch</strong></h3><p><strong>Software development lifecycle (SDLC)</strong></p><p>When Tom Kilburn wrote the first piece of software in 1948, it contained only 17 instructions and took 52 minutes to compute. But from the beginning, computers and their programs have been complex systems. The first mainframe computers filled entire rooms! Organizations needed a way to manage large software projects running on those computers.</p><p>The systems development lifecycle was born in the 1960s, and variations of the framework evolved over time into the <strong>software development lifecycle (SDLC)</strong>. The SDLC is a framework for systematically building high-quality software and websites that meet user requirements. The SDLC provides a way to plan large projects and offers a set of standard steps and deliverables for each project.</p><p>While there are many variations of the SDLC, a few common phases exist:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*oW2Pnf5PLsL3U93FUkA_vQ.png" /></figure><h4><strong>Planning</strong></h4><p>The planning phase of the SDLC aims to gather requirements from various stakeholders and analyze what is achievable. In web development, the planning stage defines the goals and purpose of the website. In this phase, the team might also determine the website’s audience and start to plan what types of content will be on the site.</p><h4><strong>Design</strong></h4><p>When you hear “design,” you might think of a website’s visual layout, colors, and brand elements. While the team focuses on these things during the design phase, they also design all other aspects of the website to meet user requirements.</p><blockquote>The team will design the website’s <strong>sitemap</strong>, <strong>navigation structure</strong>, and <strong>information architecture</strong>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*ghc9KKianMxpMBISXQYimg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*LDRTuSkcs3_XpSehRPTK_Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*mY6xNOZHUq0DYhOOkb48Rg.png" /></figure><h4><strong>Development</strong></h4><p>During this phase, web developers use the requirements, design wireframes, and other deliverables from the design phase to build the website using web development languages such as HTML, CSS, and JavaScript.</p><h4><strong>Testing</strong></h4><p>During this phase, web developers, quality assurance (QA) testers, and other members of the team will test the website for usability, accessibility, and more. This phase aims to ensure that the website works according to the requirements gathered during the planning phase.</p><h4><strong>Launch</strong></h4><p>During this phase, the team will publish the files to the server and launch the website.</p><h4><strong>Maintenance</strong></h4><p>During this phase, the team will review user feedback, customer support issues, and other technology advances, and then update the website. The team might also update content or media during this phase to keep the website fresh for users.</p><h3><strong>Waterfall versus agile approach to development</strong></h3><p>Initially, each phase of the SDLC followed a step-by-step method from planning to maintenance. Developers refer to this approach to the SDLC as the <strong>waterfall approach</strong> because it flows from one phase to the next phase in a downward fashion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*rW5-1t5j7Ue21gEWjfTibw.png" /></figure><p>There are benefits to this approach for developing software; however, there are some disadvantages, including:</p><ul><li><strong>Long cycle times. </strong>Since each phase of the approach might take any amount of time, the entire process might take months, if not years, to complete. By the time projects were complete, the product they had developed might be outdated.</li><li><strong>Less user interaction.</strong> With the waterfall approach, users are brought in only at the beginning of the planning phase to gather requirements and at the end of the cycle. This means that users’ needs are only determined at the beginning of the project, and if their needs change throughout the project’s lifecycle, those needs will not be addressed.</li><li><strong>Postpones testing until the end.</strong> Because testing is at the end of the cycle, the team might not recognize issues until much work has already been completed. Depending on the size of the issues, solutions might be costly and delay the project’s launch.</li></ul><p>Given these challenges, what do you do? Well, in the early 2000s, a few developers came together to address some of these issues with the waterfall approach. A few variations to waterfall had already been developed, but this group wanted a new approach that allowed organizations to speed up development times.</p><p>With the goal of faster development times in mind, these developers created the <a href="https://agilemanifesto.org/">Manifesto for Agile Software Development(opens in a new tab)</a>, which laid out four key values:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*war1TkJ0qXUITZCA7pk6yw.png" /></figure><blockquote><strong>Agile allows teams to deliver products in small increments, minimizing the disadvantages of the waterfall approach. Agile is inherently about these four values.</strong></blockquote><h3>Scrum framework</h3><p>Organizations have adopted methodologies such as <strong>scrum</strong>, an iterative approach to implementing agile. <strong>Iterative </strong>means the process is repeated often and sometimes the same steps can be repeated several times. The scrum framework is made up of <strong>scrum teams</strong> that deliver work in <strong>sprints </strong>and participate in scrum <strong>ceremonies</strong>.</p><p>Following is a diagram of a typical scrum framework in which teams work to deliver in short increments. Notice that the framework emphasizes a more iterative approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*fI9aFyC2m3sphxWPFySWaQ.png" /></figure><h4><strong>Scrum teams</strong></h4><p>Development teams work in small teams to focus on developing a solution for one objective at a time.</p><h4><strong>Sprints</strong></h4><p>Developers complete work in <strong>sprints</strong>. A sprint is a set period of time in which the team works on a specific, small set of work. The work goes through the entire development lifecycle from planning to launch.</p><p>Before starting a sprint, the team conducts sprint planning to determine what work needs to be done and how long it will take.</p><p>A <strong>sprint backlog</strong> captures work that needs to be completed but has not been started.</p><p>The sprint concludes with a <strong>retrospective</strong>, which is a review of what worked during the sprint and what practices can be improved in the next sprint.</p><h4>Ceremonies</h4><p>Teams participate in specific meetings, called ceremonies, such as sprint planning, daily scrum, or stand-ups, sprint reviews or demos, and retrospectives. These ceremonies provide commitment from the team on what they will develop, early feedback on the product, and quick identification of issues that might arise.</p><blockquote>While scrum and agile are often thought of as the same, they are not. Agile is a set of values and principles. Scrum is one of many methods for implementing agile principles.</blockquote><p>Much like waterfall, methods of implementing agile have evolved, and new variations have been created over time. <a href="https://en.wikipedia.org/wiki/Kanban">Kanban(opens in a new tab)</a> and <a href="http://www.extremeprogramming.org/">extreme programming (XP)(opens in a new tab)</a> are a couple of examples.</p><p>It’s valuable for you to be aware of the different approaches that web development teams take for projects.</p><p><strong>In an agile framework, developers complete work in sprints. Sprints are a set period of time where a specific, small set of work goes through the entire development lifecycle from planning to launch.</strong></p><p><strong>Selena and her team can implement a scrum framework. It enables her team to work together in short increments, such as two-week sprints, to develop a solution for one objective at a time.</strong></p><p><strong>A sitemap is a hierarchical model of all pages and content of a website that inform the navigation structure. The navigation structure outlines the organizational structure of the different pages on the site and defines how they are connected.</strong></p><h3>Key points to remember</h3><ol><li>The browser interprets HTML markup and reports using human-readable styles and formats when rendering an HTML document.2</li><li>Markup is wrapping text with indicators that guide what should be done with that text.</li><li>Markups are text-based and include links to resources, making them easy to interpret and display.</li></ol><p>4. A properly structured HTML document includes the HTML tag, the head section, and the body section.</p><p>5. HTML attributes are additional data a tag might need to provide the parser with enough information to create the formatting the element needs.</p><p>6. A semantic tag clearly describes what it does to the browser and the web developer.</p><p>7. Frameworks are tools that heavily use a scripting language like JavaScript to handle data.</p><p>8. Developers created the cascading style sheets (CSS) language to add styling to elements of the same class or id without needing to style every element in an HTML document.</p><p>9. A style in a stylesheet has three basic parts: A selector, a node name, and a declaration block. The declaration block has one or more styles that are made up of properties and values.</p><p>10. A primary feature of CSS is that child elements get the style of parent elements unless they’re overridden.</p><p>11. CSS mainly focuses on website presentation, and the code can program the text, style, and function of the site.</p><p>12. JavaScript controls interactivity on a website, such as button clicking, popups, and refreshing a web page.</p><p>13. JavaScript, HTML, and CSS all work together through code to display a web page and all its features.</p><p>14. The waterfall approach is a step-by-step action plan that flows downward like a waterfall.</p><p>15. The agile approach is iterative, meaning the process is repeated often and sometimes the same steps can be repeated several times.</p><p>16. Scrum is an iterative approach to implementing agile in which teams deliver work in sprints and participate in scrum ceremonies.</p><h4>TEST MY KNOWLEDGE:</h4><blockquote>Development is the phase in between Design and Testing, in which developers translate design specifications into a functional website by implementing features using coding languages like HTML, CSS, and JavaScript</blockquote><blockquote>A style attribute describes how the text, image, video, or other elements should appear.</blockquote><blockquote>The id selector allows the web developer to apply a unique style to one specific section, ensuring that the style does not affect other parts of the document.</blockquote><blockquote>Semantic tags have names that clearly describes how they function on the web page and what they are designed to contain.</blockquote><blockquote>JavaScript is backward compatible, which allows older code to continue to work even as new features and updates are introduced. This allows developers to maintain and enhance their sites without losing functionality.</blockquote><blockquote>Web developers use both types of symbols as selectors. They use the dot or period symbol for class selectors, and the hash or pound symbol for id selectors.</blockquote><blockquote>This &lt;section&gt; element is essential for organizing the structure and content in an HTML document.</blockquote><blockquote>JavaScript is designed to handle user interactions, such as triggering a message when someone clicks a button on a web page.</blockquote><blockquote>The waterfall approach is a step-by-step action plan that flows downward like a waterfall. The steps include: Planning, Design, Development, Testing, Launch, and Maintenance.</blockquote><blockquote>An attribute is additional data a tag might need to provide the browser with enough information to create the formatting or action the element requires, such as a strong attribute for font weight.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dab361e3b15e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LESSON: What are stylesheets?]]></title>
            <link>https://medium.com/@joaquimdacosta1999/lesson-what-are-stylesheets-37ceb8880ba7?source=rss-5501c69de547------2</link>
            <guid isPermaLink="false">https://medium.com/p/37ceb8880ba7</guid>
            <category><![CDATA[tailwind-css]]></category>
            <category><![CDATA[html-css]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Joaquim Costa]]></dc:creator>
            <pubDate>Sat, 13 Sep 2025 05:31:50 GMT</pubDate>
            <atom:updated>2025-09-13T05:31:50.287Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mrMh5SJg7pHpXbcl" /></figure><p>While you can put <strong>styles inline </strong>in the <strong>HTML elements</strong>, doing so can become very hard to manage the more<strong> style </strong>you add. Suppose you want many feactures to have similar styles. Using inline styles, you’s have to apply the style attribute to every element individually. Then, if you decide to change the style, you must change every element.</p><blockquote><strong>A stylesheet is a collection of styles. Developers created cascading stylesheets to address the challenges with styling web pages.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8eoZqbqGHR3qxKvZ" /></figure><h3>The cascade of CSS</h3><p>Say you are developing a report on why you love your favorite sports team. Your report will contain headings, subheading and the text of your report. Within that text, you also need to add charts supporting your claims, some images of great players on the team, and links to your source. Each of these piece is a single element and a separate type of element. But when you create your report, you might nest images or charts within your text. And you might nest source links within your images or charts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h6_VLN3o6naxfpP4" /></figure><p>In HTML, developers can also put elements within one another. Consider the following code:</p><pre>&lt;p&gt;<br>	&lt;img&gt;&lt;/img&gt;<br>&lt;/p&gt;</pre><p>In this example, the developer wrapped the <strong>opening &lt;img&gt;</strong> and<strong> closing &lt;/img&gt; tags </strong>within an <strong>opening &lt;p&gt;</strong> and <strong>closing &lt;/p&gt; tag</strong>. The browser would place the image within a <strong>paragraph</strong>. If you were building your report as a <strong>web page</strong>, you might use similar code to place an image of your favorite player within a paragraph of text about why you like them.</p><p>eb development professionals consider these elements <strong>parent elements </strong>and <strong>child elements</strong>. A parent element wraps around another element. One or more elements wrap a child element. In the previous code example, the &lt;p&gt; element is the parent of the &lt;img&gt; element, which is the child.</p><p>This is important to understand to make sense of the <strong>cascading feature</strong> of cascading stylesheets. Styles <strong>cascade</strong> in that child elements get the style of parent elements unless they’re overridden. Web developers can override a style if the child element implements the same style as the parent with a different value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*ru5LR3RY0n-nC5jfY2kcKw.png" /></figure><p>Now say that you want to offset your image on the page from the text by another 10px. A web developer might do this with the following code:</p><pre>&lt;p style=&quot;margin-left:10px;&quot;&gt;<br>	&lt;img style=&quot;margin-left:20px;&quot;&gt;&lt;/img&gt;<br>&lt;/p&gt;</pre><p>Now, because the child element has the same style as the parent element (margin-left), but the values are different, the parent element’s style is overridden. In this example, the parent element will be indented by 10 pixels, but the child element will indent the image 20 pixels from the left of the page.</p><blockquote>Child elements get the style of parent elements unless they’re overridden. Web developers can override a style if the child element implements the same style as the parent with a different value.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*P0arYKjz98WtEZHl.png" /></figure><h3><strong>Using CSS syntax</strong></h3><p><strong>Syntax</strong> is the vocabulary of a given software language. It refers to the terms and<strong> construction</strong> used to build the individual lines of the language and how each line works with other lines in the <strong>programming language.</strong> It’s similar to syntax in any natural language like <strong>English</strong> or Hindi.</p><p><strong>CSS syntax</strong> is broad, and you can build many powerful style elements with the language.</p><p>When creating a style element in CSS, you can build a <strong>class selector</strong> or an <strong>id selector</strong>.</p><h4>Class selector</h4><blockquote>You build a class style when you want a given style to apply to many HTML elements in a document. You build an id style when you want that style to apply to just one HTML element. You also can use HTML element names, such as &lt;p&gt; or &lt;h1&gt;, as selectors.</blockquote><blockquote>For example, suppose you want a style to apply to every paragraph element in your HTML document. You would create either a style with a class selector or HTML element selector so you can build the style once, and every paragraph element will get that style. Now, you won’t have to apply the style to every paragraph element in the HTML document. And, if you want to change the style, you make the change to the stylesheet, and all the paragraph elements will get the change.</blockquote><h4>Id selector</h4><blockquote>If you have a particular element in your HTML document, say a section element, that you want to have a unique style, you will use an id selector on that element.</blockquote><blockquote>For example, suppose you have a section that you want bolded and in italics because it contains a legal disclaimer that you want to ensure everyone reads. You can create an id selector and use that style just for that section.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H24dnTiycRuWrjiq.jpeg" /></figure><p>When creating a <strong>class selector,</strong> you use a <strong>dot</strong> or <strong>period </strong>on your keyboard. In <strong>CSS,</strong> the <strong>dot </strong>or <strong>period</strong> symbol designates a <strong>class style</strong>. It is placed before the style name.</p><p><strong>class selector</strong></p><p>When creating a <strong>class selector</strong>, you use a dot or period on your keyboard. In CSS, the dot or period symbol designates a class style. It is placed before the style name.</p><p><strong>id selector</strong></p><p>An <strong>id selector</strong> is designated by a <strong>pound symbol </strong>or<strong> hash mark.</strong> The hash or <strong>pound</strong> symbol designates an id style. It is placed before the style name.</p><h3><strong>A style in a stylesheet has the following three basic elements:</strong></h3><h4>Selector</h4><p>The selector is either an HTML element, a dot for classes, or a hash symbol for ids.</p><h4>Node name</h4><p>Assigning a name to the style will help you understand what the style does. The name cannot have spaces. A best practice is to use <strong>camel casing</strong> for CSS style names. Camel casing uses a lower-case letter for the first word and an upper-case letter for each following word. This is an example of camel casing: <strong>myNewStyle</strong>.</p><h4>Declaration block</h4><p>Each style element will have one or more declaration blocks. These include styles surrounded by curly braces. Styles might include font weight and font color.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WOcKSe7qEbfhSTmsuzCMwQ.png" /></figure><p>CSS styles can add more dynamic functions and make a website more interesting. Using styles, web developers can fine-tune how elements appear and create a better web page experience for everyone.</p><blockquote>You use an id style when you want that style to apply to just one HTML element.</blockquote><blockquote>Even though HTML was focused on information, the way that information was presented is important. CSS was standardized as the stylesheet language that web developers use because developers understood the importance of presentation but needed a better way to manage styling HTML. They also had many versions of stylesheet languages that became unwieldy to manage.</blockquote><blockquote>Each style in a stylesheet has three basic elements the selector indicator (in this case <strong>a. </strong>as you want to style <strong>every</strong> heading element on the site), a style name (this can be anything you would like, but best practice is to write in camel case), and the style. You must wrap the style in curly brackets { }.</blockquote><blockquote>Styles cascade in that child elements get the style of parent elements unless they’re overridden. This is a primary feature of cascading style sheets (CSS).</blockquote><blockquote>Cascading style sheets (CSS) adds styling to elements of the same class or id without needing to style every element in an HTML document.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37ceb8880ba7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LESSON: History of Cascading Style Sheets (CSS)]]></title>
            <link>https://medium.com/@joaquimdacosta1999/lesson-history-of-cascading-style-sheets-css-22b129e20cda?source=rss-5501c69de547------2</link>
            <guid isPermaLink="false">https://medium.com/p/22b129e20cda</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html-css]]></category>
            <dc:creator><![CDATA[Joaquim Costa]]></dc:creator>
            <pubDate>Fri, 12 Sep 2025 18:57:41 GMT</pubDate>
            <atom:updated>2025-09-12T18:57:41.048Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zM7w5-UHNWxt7Z0I" /></figure><p>Did you know the first <strong>HTML documents</strong> were just text with many links to demonstrate the technology? As <strong>web technology</strong> advanced, engineers made it easier for <strong>web developers </strong>to make pages more <strong>dynamic</strong>. The appearance of the elements of a<strong> web pages</strong> is called <strong>styling</strong>.</p><p>Here’s a Brief history about c<strong>ascading style sheets(CSS) </strong>for web pages so you are aware of how it all began.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VobUviSzvTdohZ13" /></figure><blockquote>Originally, HTML’s power was in its ability to link documents. HTML focused on information. But as the development of HTML grew, developers saw the power of presentation in HTML, and the need to improve managing how to apply style to HTML grew.</blockquote><blockquote>Early in the development of the web, some browser developers built styling languages into the browsers themselves. But the need for a standard stylesheet language became apparent as multiple implementations became difficult to manage for web developers.</blockquote><blockquote>CSS development coincided with the development of HTML and the World Wide Web.</blockquote><blockquote>Håkon Wium Lie proposed the original idea for CSS in 1994 while working with Tim Berners-Lee, the originator of HTML and the World Wide Web.</blockquote><p>Even thought <strong>HTML</strong> was focused on <strong>information</strong>, the way that information was presented was important. <strong>CSS</strong> was <strong>standardized</strong> as the <strong>stylesheet language</strong> that <strong>web developers</strong> used because <strong>developers </strong>understood the importance of presentation but need a better way to manage <strong>styling HTML.</strong> They also had many versions of s<strong>tylesheet languages</strong> that become difficult to manage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TgagHIRcI9na6Vqu" /></figure><p>Like <strong>HTML, CSS</strong> is a <strong>declarative language</strong>. It does not describe how a browser should render a style. It just describes the<strong> rules</strong> that <strong>browsers</strong> need to <strong>support</strong>. If <strong>CSS declares t</strong>hat an element should be <strong>bold</strong>, the browser must support the declaration to comply with the <strong>standard.</strong> How the browser supports it is up to the<strong> browser’s developer.</strong> But the adoption of the <strong>CSS standard </strong>by browsers such as <strong>Netscape’s Navigator</strong> and <strong>Microsoft’s Internet Explorer</strong> helped make <strong>CSS </strong>the <strong>stylesheet language</strong> of <strong>web developers.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SrXFtsvXevmodBRJ" /></figure><p>Now you know a bit about why and how the <strong>CSS language</strong> was created, but what exactly is styling?</p><h4>Formatting elements with style</h4><p>Think for a moment about a bicycle. All bicycles have two tires supported by a frame, pedals, gears and handlebars. If you were shopping for a bike, you might choose a specific frame color, bike height, handlebar style or mountain biking tires versus street tires. These are all example of your bike’s attributes.</p><p>Similarly, <strong>HTML element</strong> tags can have <strong>attributes.</strong> <strong>Attributes</strong> provide additional data that tell <strong>HTML browsers </strong>how the users will experience elements. A common <strong>attribute</strong> for many elements is the style attribute. By using the <strong>style attribute,</strong> you can fine-tune how elements appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cJtqU7d4TTqR7lPa" /></figure><p>For example, you might have text that you want to bold, and you can use the strong tag like this:</p><pre>&lt;strong&gt;My bold text&lt;/strong&gt;</pre><p>The strong tag makes the text appear bolded. But what if you wanted to make that bold text also appear dark gray? Using a style attribute can help. The following HTML snippet will make the text bold and gray:</p><pre>&lt;strong style=&quot;color: gray&quot;&gt;My bold text&lt;/strong&gt;</pre><p>In the example above, you’ll notice that the attribute is nested in the opening tag for the element and uses the <strong>style= construction</strong>. When web developers put attributes within element tags, they create an <strong>inline style</strong>. Inline styling got its name because the styles are contained directly in the line of HTML.</p><p>This doesn’t appear to be much of a language, does it? Well, there is a type of styling language that is built from the HTML specification. This language is called <strong>cascading style sheets (CSS)</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22b129e20cda" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LESSON: Big changes with HTML5]]></title>
            <link>https://medium.com/@joaquimdacosta1999/lesson-big-changes-with-html5-d5fa5fdeb130?source=rss-5501c69de547------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5fa5fdeb130</guid>
            <category><![CDATA[html5]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[html5-development]]></category>
            <dc:creator><![CDATA[Joaquim Costa]]></dc:creator>
            <pubDate>Fri, 12 Sep 2025 15:22:29 GMT</pubDate>
            <atom:updated>2025-09-12T15:22:29.736Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>LESSON: Big changes with HTML5</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ffKGZ-00Sj55G4sV" /></figure><p>When you browse a<strong> website</strong> today, interacting with <strong>items </strong>and <strong>data</strong> on <strong>web pages </strong>seem natural and commonplace. Did you know that<strong> HTML5</strong> made all this possible? Prior to <strong>HTML5,</strong> <strong>web developers </strong>had to rely on programs external to the browser to support<strong> animation</strong> and <strong>interactivity. </strong>Consider the following example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tIEbLAuzDLrPcKg1" /></figure><p>Suppose you use a<strong> task manager application</strong> to organize your school or project work. You can seamlessly interact with your data. For instance, you can:</p><ul><li>Use the drag and drop feature to move tasks around the page.</li><li>Automatically save any updates to the server, such as if you change the date for a task.</li><li>Add items like images and videos to your tasks and even edit them on the page.</li></ul><p>With the development of this <strong>fifth version</strong> of <strong>HTML</strong>, the language saw a dramatic improvement in how users interact with <strong>items</strong> and <strong>data</strong> on <strong>web pages</strong>, making some other <strong>programming languages</strong> like<strong> flash</strong> obsolete. Once one of the most popular programming languages.<strong> Flash</strong> was the primary way <strong>web developers</strong> enabled experiences like<strong> video</strong> and <strong>audio </strong>to make <strong>web pages </strong>behave more like native application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_I6to0Q0Ztv-7c-E" /></figure><p>But <strong>Flash</strong> had some challenges, such:</p><ul><li>It was not mobile-friendly.</li><li>It presented security challenges.</li><li>Users had to download and install an application for their browser before a web page used it.</li></ul><p><strong>HTML5 </strong>was developed to address limitations of using applications like <strong>Flash</strong>. It put the power of interactivity in the <strong>browser</strong>. To support the interactivity, <strong>HTML5</strong> required <strong>JavaScript</strong> and<strong> Cascading Style Sheet (CSS).</strong></p><p>While HTML5 looks similar to previous versions of HTML, improvements to document structure and tags allow more interactivity in web browsers. Here’s an example of some HTML5 tags to show you how they differ from HTML tags that you have learned about:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*Vd76U75o3Ttvsdr6Fh3UuA.png" /></figure><p>It’s valuable to know the differences between <strong>HTML</strong> and <strong>HTML5.</strong> What does <strong>HTML5 </strong>offer <strong>web developers</strong> and ultimately users?</p><h4>General Improvements</h4><p>First , <strong>HTML5 </strong>introduces more <strong>tags</strong> to describe how a document is laid out in the <strong>document structure</strong> and <strong>semantic structure.</strong></p><p>For example, a tag is <strong>semantic</strong> if the name clearly describes how it functions on <strong>web page</strong>. Prior versions of<strong> HTML</strong> supported the<strong> &lt;div&gt;</strong> or <strong>division tag</strong>. A <strong>division</strong> might mean a lot of different things. It might mean a section of a <strong>page </strong>or a section of text like a <strong>paragraph.</strong> <strong>HTML5</strong> introduced the <strong>&lt;article&gt;</strong> and<strong> &lt;footer&gt;</strong> tags (among others). These tags more clearly describe how a document is laid out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sPkMiUeXCyeZkraY" /></figure><p>Here are other general improvements <strong>HTML5 </strong>introduced:</p><ul><li>Semantic tags describe exactly what they are designed to contain.</li><li>Pages are ready to use, and the overall experience is improved.</li><li>HTML tags focus on the structure and content and allow other programming languages like CSS to manage graphic and layout elements.</li><li>Separate networks are able to communicate through secure tunnels.</li></ul><h4>Data and Connectivity</h4><p>In previous version of <strong>HTML</strong>, handling data involved users submitting changes <strong>manually</strong> and <strong>refreshing pages </strong>to access the latest updates. On Today’s <strong>desktop applications</strong>, users can set up <strong>autosave</strong>, a feature that automatically <strong>saves </strong>changes to data without users having to<strong> manually</strong> select the <strong>Save button</strong>. <strong>HTML5</strong> brought this functionality to the web.</p><p><strong>HTML5</strong> supports basic data handling and improves how <strong>websites manage data</strong>. However, many <strong>web developers</strong> rely on <strong>framework</strong> for robust data handling. A <strong>framework </strong>is a set of tools that heavily uses a scripting language like <strong>JavaScript </strong>to manage <strong>data handling</strong>. These <strong>frameworks</strong> are built on the foundation that <strong>HTML5 </strong>provides.</p><h4>Here are some examples of open source frameworks:</h4><ul><li>Meta’s React</li><li>Evan You’s Vue.js</li></ul><h4>Interactivity</h4><p>Perhaps the most interesting parts of the <strong>HTML5 </strong>specification for<strong> users</strong> (and fun for <strong>web developers)</strong> are the changes to i<strong>nteractions</strong>. <strong>HTML5</strong> interactions can be <strong>striking </strong>and <strong>robust</strong>. With <strong>HTML5</strong>, <strong>graphics</strong> and<strong> video</strong> can be added without installing third-party<strong> plug-ins</strong>. <strong>HTML5</strong> also enables <strong>web developers </strong>to use <strong>geolocation APIs</strong>, which can incorporate <strong>smart phone location</strong> capabilities into <strong>mobile services</strong> and <strong>application.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ruSvvZeuXQWU8TfX" /></figure><h4>Web Applications</h4><p><strong>HTML5</strong> ushered in the age of the <strong>web app. </strong>A <strong>web app</strong> is an application accessed using a<strong> browser </strong>that can be as <strong>robust</strong> and <strong>feature </strong>rich as <strong>desktop applications.</strong> Many popular applications are browser-only <strong>web apps</strong>.</p><p>While <strong>HMTL5</strong> has offered many improvements to how users interact with websites, browsers also need to be designed to support HTML5.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5fa5fdeb130" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>