<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marina LABS</title>
    <description>The latest articles on DEV Community by Marina LABS (@marina_labs).</description>
    <link>https://dev.to/marina_labs</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1924458%2Fe340bc53-0906-4738-a7c1-a3dbc50d0fd5.jpg</url>
      <title>DEV Community: Marina LABS</title>
      <link>https://dev.to/marina_labs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marina_labs"/>
    <language>en</language>
    <item>
      <title>Develop yourself to build Web UIs: Part Two: Art of styling the web🎨</title>
      <dc:creator>Marina LABS</dc:creator>
      <pubDate>Mon, 26 Aug 2024 17:53:00 +0000</pubDate>
      <link>https://dev.to/marina_labs/develop-yourself-to-build-web-uis-part-two-art-of-styling-the-web-39g1</link>
      <guid>https://dev.to/marina_labs/develop-yourself-to-build-web-uis-part-two-art-of-styling-the-web-39g1</guid>
      <description>&lt;p&gt;CSS, short for Cascading Style Sheet🎨, dictates how an html should look.&lt;/p&gt;

&lt;p&gt;From the previous &lt;a href="https://medium.com/@marinalabs/develop-yourself-to-build-web-uis-part-1-understanding-html-41f1498baabf" rel="noopener noreferrer"&gt;article&lt;/a&gt; on HTML, we knew that the html file will be parsed and Document Object Model will be created. In a similar fashion, CSS file will be parsed and a &lt;code&gt;CSSOM&lt;/code&gt;📜 will be created. Alongside &lt;strong&gt;DOM&lt;/strong&gt;, CSSOM will be applied to create a render tree, which forms the layout. Once the layout has been formed, the stylings like the display of elements as specified and then the colors that are to be applied will be decided and rendered in the web page.&lt;/p&gt;

&lt;h3&gt;
  
  
  Applying CSS: Inlining, Embedding and Linking
&lt;/h3&gt;

&lt;p&gt;There are several ways to apply CSS to an HTML document:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Inline Styles&lt;/strong&gt;🎯: Directly within the HTML element using the style attribute. This approach is rarely used due to its lack of reusability and separation of concerns&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Internal Styles&lt;/strong&gt;🏡: Within a &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; tag inside the &lt;/p&gt; of your HTML document. This method improves performance as no additional server request is needed to fetch the styles, but it’s less scalable for larger projects.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;External Stylesheets&lt;/strong&gt;🔗: Using a separate &lt;code&gt;.css&lt;/code&gt; file linked in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; section. This is the most scalable approach, allowing for reuse of styles across multiple pages and easier maintenance.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- inline styling --&amp;gt;
&amp;lt;h1 style="color: white;"&amp;gt;Welcome to My Website&amp;lt;/h1&amp;gt;

&amp;lt;!-- internal styling --&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;style&amp;gt;
    body {
      background-color: lightblue;
    }
    h1 {
      color: navy;
    }
  &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;!-- external stylesheet --&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;link rel="stylesheet" href="styles.css"&amp;gt;
&amp;lt;/head&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While specifying inside the style tag improves performance since there will be no server call made to fetch the styles, it also proves to be redundant in case of complex projects since the css will be confined to the html document📩 and can’t be used in other documents.&lt;/p&gt;

&lt;p&gt;On the other hand, using link element to link the style sheets might seem like a solution but might be an overkill🗡 when working on smaller projects or test cases. Still, it offers scalability, and reduced redundancy.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Genius🧠 is not just applying everything, it is about knowing which🕶 to apply and when⌚ to apply&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  CSS Syntax and Selectors
&lt;/h3&gt;

&lt;p&gt;CSS is structured around selectors that target HTML elements, and properties that apply styles to those elements. Here’s a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  background-color: lightblue;
}
h1 {
  color: navy;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Element Selectors&lt;/strong&gt;: Target all instances of a specific HTML element.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1 {
  color: white;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Class Selectors&lt;/strong&gt;: Target elements with a specific class, prefixed with a &lt;code&gt;.&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p class="className"&amp;gt;Text&amp;lt;/p&amp;gt;
&amp;lt;a class="className"&amp;gt;Link&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.className {
  color: white;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ID Selectors&lt;/strong&gt;: Target a single element with a specific ID, prefixed with a &lt;code&gt;#&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p id="idName"&amp;gt;Text&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#idName {
  color: white;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that for class selectors we need &lt;code&gt;.&lt;/code&gt; as prefix and for id we need &lt;code&gt;#&lt;/code&gt; as prefix.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key CSS Concepts and Properties
&lt;/h3&gt;

&lt;p&gt;Before diving into advanced topics, let’s explore some essential CSS properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Width &amp;amp; Height&lt;/strong&gt;: Set the dimensions📐 of an element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Viewport&lt;/strong&gt;: The visible🔎 area of a web page on a user’s screen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexbox&lt;/strong&gt;: A layout model that allows elements to align and distribute space within a container.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grid&lt;/strong&gt;: A 2D layout system that enables complex designs with rows and columns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will kick off our journey into writing CSS by starting with the enigma😵 that has proved tough even for pragmatic programmers👨‍💻 — Centering a div 😈&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div, section {
  display: flex;
  justify-content: center;
  align-items: center;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code centers any child elements within the div or section.&lt;/p&gt;

&lt;p&gt;Similarly,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div, section {
  background: linear-gradient(to bottom right, red, blue);
  border: 1px solid black;
  height: 100vh;
  text-align: center;
  border-radius: 5px;
  gap: 15px;
  margin: 20px;
  padding: 10px;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 100;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Background&lt;/strong&gt;: Sets a gradient background.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Border&lt;/strong&gt;: Defines the element’s border.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Margin&lt;/strong&gt;: Adds space outside the element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Padding&lt;/strong&gt;: Adds space inside the element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Font&lt;/strong&gt;: Customizes the text appearance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Others are semantic and their name does justice to their function.&lt;/p&gt;

&lt;h3&gt;
  
  
  CSS In Action: Building a Travel Website
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;There is no greater fun than creating🛠 something from scratch by yourself.&lt;/p&gt;

&lt;p&gt;Don’t feel intimidated by the sheer number of prerequisites required to apply css — it only gets easier once we start.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Oftentimes, at work, software developers wont be designing the website. Dedicated designers🖼, who understand the features of the product, requirements of the users💻 and their behavior, will be designing the website and software developers will need to replicate that.&lt;/p&gt;

&lt;p&gt;So, we will find a template from google and try and replicate that.&lt;/p&gt;

&lt;p&gt;Head out to the google🌐 and search for “Travel Website Templates” and you can find many of the contemporary designs and once you have chosen something like the one in the image, we can start building.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiz9e5cxcl5bnrraxh80t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiz9e5cxcl5bnrraxh80t.png" alt="Google Search Result" width="720" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Start by creating two files: &lt;code&gt;index.html&lt;/code&gt; and &lt;code&gt;index.css&lt;/code&gt;. Here’s the basic structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8" /&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&amp;gt;
    &amp;lt;title&amp;gt;Travel Site&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="index.css" /&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: #4d85a2;
  color: #333;
  padding: 20px;
  height: 100vh;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can see the result once we start the index.html file in the browser. If you don’t see the changes, refresh the browser tab to see it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81k6nrfxuytsxhgmqkrs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81k6nrfxuytsxhgmqkrs.png" alt="Creating only background" width="720" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we will start building on top of this, we will create a main container which will hold the image as background, and texts on top of it to achieve the UI.&lt;/p&gt;

&lt;p&gt;Write the following code in the body tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div id="main_container"&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#main_container {
  background-image: linear-gradient(to bottom right, grey, black)
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  height: 100%;
  border: 1px solid red;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice, that for background-image attribute, the value should be provided as url(file name) and background-repeat is set to no-repeat and size is set to cover. As for now, we have set the image to a color to visualize.&lt;/p&gt;

&lt;p&gt;This ensures that the provided image from the url is set to not repeat and appear only once and appear to the full extent(background-size) unlike only to the dimensions of the image itself. The cover value dictates the image to appear to the container fully. The border has been applied to make it visually teaching on how much height that element is occupying.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5tdl7j72qr1urftxo7et.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5tdl7j72qr1urftxo7et.png" alt="Linear Gradient Background" width="720" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now after applying the image, it should be visible like,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcfgm1s2k099ti6jymn1p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcfgm1s2k099ti6jymn1p.png" alt="Background with image" width="720" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice that the image is repeating because we haven’t set background-repeat to no-repeat.&lt;/p&gt;

&lt;p&gt;Now we will create a nav bar🧭 that sticks to the top of main container and a centered div to contain information and a button.&lt;/p&gt;

&lt;p&gt;Oftentimes, you, as a developer would need to use code that others have written and leverage from that. In this website, we would need to use some icons from other libraries in order to delegate some of the diligent work needed to build that.&lt;/p&gt;

&lt;p&gt;I have integrated font-awesome icons in the index.html file by&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;head&amp;gt;
  &amp;lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/&amp;gt;
&amp;lt;/head&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures that the css written for font-awesome can be extended to my html file without me writing much code.&lt;/p&gt;

&lt;p&gt;Now in the body, add the following code,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0n1dvtx714129lz69dsg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0n1dvtx714129lz69dsg.png" alt="Image description" width="720" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhc022olsw4gjf4bx8nip.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhc022olsw4gjf4bx8nip.png" alt="Image description" width="720" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will notice certain new terms like keyframes, animations, transition etc.&lt;br&gt;
I will explain them soon, but first lets take a look at the output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkzgegnyxindiy0bheqh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkzgegnyxindiy0bheqh.png" alt="Finished website with certain changes" width="720" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above picture is the output of the code with borders so as to make it easy to visualize the containers height and width.&lt;/p&gt;

&lt;p&gt;The below picture is the finalized output after removing the borders.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff84lk1y7zkv9kp1e508q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff84lk1y7zkv9kp1e508q.png" alt="Image description" width="720" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to the ambiguous code,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;:hover&lt;/code&gt;&lt;/strong&gt; — You can see this for page title. This “:” dictates the css to listen for the user actions like hover, focus, etc and then apply css when that action occurs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Transition&lt;/code&gt;&lt;/strong&gt; — This specifies an animation effect causing motion of the elements as specified like translate, rotate in specified axes, the time that should be taken to complete the effect and the type of effect like ease-in, ease-out, etc.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;rgba&lt;/code&gt;&lt;/strong&gt; — This specifies the color alongside the opacity for that color. Notice the black transparent background for the content area? This transparency came because rgba was set to color and 0.7.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;animation&lt;/code&gt;&lt;/strong&gt; — Same as transition but only that it can happen even without user interactions. But in here we applied only with user interaction. Other differences include animations can be set to have intermediary steps like on completion of 25% of time, an effect can happen, and same on 50% and 75%, but for transition, only 0% and 100% (start and end) can be specified.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;keyframe&lt;/code&gt;&lt;/strong&gt; — These are the tools that are required to set the intermediary steps. Any name can be given including the existing transition names, for which the specified transitions will be applied.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Since without video it is tough to show the animation, you can try hovering your mouse over the &lt;strong&gt;Discover Now&lt;/strong&gt; button to see it pop up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Outro
&lt;/h3&gt;

&lt;p&gt;You’ve now taken your first steps into the world of CSS. From centering a &lt;code&gt;div&lt;/code&gt; to building a basic travel website, you’ve gained hands-on experience with some of the core concepts that will serve as the foundation for more advanced techniques.&lt;/p&gt;

&lt;p&gt;The next milestones💎 could include diving into frameworks like Bootstrap or SASS, or moving on to JavaScript and React while simultaneously learning CSS by applying on the go — the limits are &lt;strong&gt;endless&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Remember, CSS is a vast and powerful language. With continuous practice and exploration, you can unlock endless possibilities for creative and responsive web designs.&lt;/p&gt;

&lt;p&gt;Stay tuned for the next article where we will dive into JavaScript, integrating it with the HTML and CSS skills you’ve just acquired.&lt;/p&gt;

&lt;p&gt;This article is written by &lt;code&gt;Anantha Krishnan&lt;/code&gt;, a professional with experience in both IT and Mechanical Engineering. With a background in full stack development and a passion for mechanical and electrical systems, &lt;code&gt;Anantha Krishnan&lt;/code&gt; is now focused on creating educational content to help beginners in fields of his expertise.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>css</category>
    </item>
    <item>
      <title>Develop yourself to build Web UIs: Part 1 : Understanding HTML</title>
      <dc:creator>Marina LABS</dc:creator>
      <pubDate>Fri, 16 Aug 2024 06:19:59 +0000</pubDate>
      <link>https://dev.to/marina_labs/develop-yourself-to-build-web-uis-part-1-understanding-html-4of9</link>
      <guid>https://dev.to/marina_labs/develop-yourself-to-build-web-uis-part-1-understanding-html-4of9</guid>
      <description>&lt;p&gt;Web Development is one of the most in-demand skills today. It involves creating user-friendly and engaging websites that can be accessed via a browser. The first step in becoming a web developer is understanding HTML.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2d62v07ilfp6m4prxkih.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2d62v07ilfp6m4prxkih.png" alt="Web UI Template" width="720" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt; (&lt;strong&gt;Hyper Text Markup Language&lt;/strong&gt;) is the backbone of any web page. It’s the standard language used to structure a webpage, determining how content is displayed in browser. While the appearance of a page is decided by &lt;strong&gt;CSS&lt;/strong&gt; (&lt;strong&gt;Cascading Style Sheets&lt;/strong&gt;) and its functionality by &lt;strong&gt;JS&lt;/strong&gt; (&lt;strong&gt;Javascript&lt;/strong&gt;), &lt;strong&gt;HTML&lt;/strong&gt; is responsible for the fundamental skeleton or structure.&lt;/p&gt;

&lt;p&gt;Before diving in this part of the course, it’s important to understand famous and recurring jargons that will be used in your journey. These will help you understand the concepts as we progress (and also make it easy for the author to explain things ;-) ).&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding the Jargons
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Programming Language&lt;/strong&gt;: A set of instructions written in a specific syntax (way of a programming language) that a computer can execute. Remember the computer understands only binary code (either 1 or 0), now, in order to make the computer understand the logic and also to find a trade-off, we (humans), have created a programming language such that it is easy for us to code and also for the computer to understand it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compiler&lt;/strong&gt;: A tool that translates code written in a programming language into machine language that a computer can understand and execute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Syntax&lt;/strong&gt;: The rules that define the structure of a programming language. Think of it as the way words are arranged in a sentence to make sense.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comments&lt;/strong&gt;: Notes within the code that explain what certain parts of the code do. Comments help other developers (or your future self) understand the logic behind your code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DOM (Document Object Model)&lt;/strong&gt;: The DOM is a tree-like representation of the HTML document. Every tag in your HTML becomes a node in this tree. For example, if your HTML has a &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag with a &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; (paragraph) inside it, the browser creates a body node with a paragraph node as its child.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Children&lt;/strong&gt;: You will understand this as you progress. Elements nested within another element. For example, in HTML, a paragraph tag (&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;) within a div tag (&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;) would be considered a child of the &lt;code&gt;div&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Block-level element&lt;/strong&gt;: You will be introduced to this jargon as you progress. This term usually describes the feature of the element that it will be taking the full available width.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Firing up with HTML
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt; stands for &lt;strong&gt;Hyper Text Markup Language&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hyper Text&lt;/strong&gt;: Refers to the ability of HTML to link different documents together.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Markup Language&lt;/strong&gt;: Uses tags to annotate text, defining how it should be displayed in a browser.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s the basic structure of an HTML document:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;HTML Tutorial&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;p&amp;gt;Hello, world!&amp;lt;/p&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tags&lt;/strong&gt;: In HTML, tags are used to define elements. Tags are enclosed in angle brackets, like &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Elements&lt;/strong&gt;: Consist of an opening tag and a closing tag, which may contain content. For example, &lt;code&gt;&amp;lt;p&amp;gt;Hello, world!&amp;lt;/p&amp;gt;&lt;/code&gt; is a paragraph element.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  HTML Document Structure
&lt;/h2&gt;

&lt;p&gt;Every HTML document follows a basic structure:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/code&gt;: Declares the document type and version of HTML.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;html&amp;gt;&amp;lt;/html&amp;gt;&lt;/code&gt;: The root element that encloses all other HTML elements.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;/code&gt;: Contains meta-information about the document, such as the title and links to stylesheets.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;/code&gt;: Sets the title of the webpage, displayed in the browser's title bar or tab.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt;: Provides metadata about the HTML document, such as character set, author, and viewport settings. It's a self-closing tag.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;style&amp;gt;&amp;lt;/style&amp;gt;&lt;/code&gt;: Embeds CSS code to style the HTML elements.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;script&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;: Embeds JavaScript code for adding interactivity to the webpage.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;&lt;/code&gt;: Encloses the content that will be visible to users on the webpage.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Commonly Used HTML Elements
&lt;/h2&gt;

&lt;p&gt;Here are some basic HTML elements you’ll use frequently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;&lt;/code&gt;: Defines a paragraph.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;: A block-level element used to group other elements together.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&lt;/code&gt;: An inline element used to group text for styling purposes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;header&amp;gt;&amp;lt;/header&amp;gt;&lt;/code&gt;: Represents the introductory content or navigational links of a section.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;h6&amp;gt;&amp;lt;/h6&amp;gt;&lt;/code&gt;: Headings, with &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; being the highest level and &lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt; the lowest.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;: Inserts a line break (self-closing tag — meaning there is no need to close the tag).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;form&amp;gt;&amp;lt;/form&amp;gt;&lt;/code&gt;: Used to create an HTML form for user input.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt;: Creates an input field, typically used within a form.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;select&amp;gt;&amp;lt;/select&amp;gt;&lt;/code&gt;: Creates a dropdown list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;&lt;/code&gt;: Associates a text label with a form element.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;table&amp;gt;&amp;lt;/table&amp;gt;&lt;/code&gt;: Defines a table.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;tr&amp;gt;&amp;lt;/tr&amp;gt;&lt;/code&gt;: Defines a row in a table.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;/code&gt;: Defines a cell in a table row.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;th&amp;gt;&amp;lt;/th&amp;gt;&lt;/code&gt;: Defines a header cell in a table row.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;ul&amp;gt;&amp;lt;/ul&amp;gt;&lt;/code&gt;: Defines an unordered (bulleted) list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;ol&amp;gt;&amp;lt;/ol&amp;gt;&lt;/code&gt;: Defines an ordered (numbered) list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;&lt;/code&gt;: Defines a list item.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Creating Your First HTML File
&lt;/h2&gt;

&lt;p&gt;To create an HTML file, you can use any text editor, such as Notepad or VS Code. Here’s a simple example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your text editor and type the following code:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;title&amp;gt;HTML Tutorial&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;h1&amp;gt;Example Number 1&amp;lt;/h1&amp;gt;
  &amp;lt;p&amp;gt;Hello, world!&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Save the file with a .html extension (e.g., &lt;code&gt;index.html&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Open the file in your web browser to see your first HTML webpage in action!&lt;/li&gt;
&lt;li&gt;To inspect your code, press &lt;code&gt;Ctrl + Shift + C&lt;/code&gt; in Google Chrome to open the Developer Tools and explore the DOM structure.&lt;/li&gt;
&lt;li&gt;Go to the network tab in the Developer Tools and refresh your browser tab.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can find that there is a request in the name that you have saved as in this picture.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpxkobmtnt4vnsbw2vwx3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpxkobmtnt4vnsbw2vwx3.png" alt="Request in the network tab" width="720" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the response tab, you will find the code that you have written as in the following picture&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F29wo1uj51rbwbjwnvj25.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F29wo1uj51rbwbjwnvj25.png" alt="Response in the network tab" width="720" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, what happened is that, once you opened the file you have saved as html, the computer began running the file in browser. The browser wanted something to show, so it made a request call to the file from which it was launched. The file gave the browser your code and that was found in the response section. Since it was a html file, the browser begins reading the HTML code from the top to the bottom. This process is known as parsing. During parsing, the browser encounters different HTML tags (like &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;, etc.) and starts to build a structure called &lt;strong&gt;DOM&lt;/strong&gt; based on these tags. As the browser builds the &lt;strong&gt;DOM&lt;/strong&gt;, it simultaneously renders the content on your screen.&lt;/p&gt;




&lt;h2&gt;
  
  
  Creating a Table
&lt;/h2&gt;

&lt;p&gt;Let’s take a step further by creating a simple table in HTML:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the same HTML file and add the following code inside the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p&amp;gt;Table Example&amp;lt;/p&amp;gt;
&amp;lt;table&amp;gt;
  &amp;lt;tr&amp;gt;
    &amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;
    &amp;lt;th&amp;gt;Power&amp;lt;/th&amp;gt;
    &amp;lt;th&amp;gt;Is Kurama Present&amp;lt;/th&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr&amp;gt;
    &amp;lt;td&amp;gt;Naruto&amp;lt;/td&amp;gt;
    &amp;lt;td&amp;gt;Rasengan&amp;lt;/td&amp;gt;
    &amp;lt;td&amp;gt;Yes&amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr&amp;gt;
    &amp;lt;td&amp;gt;Sasuke&amp;lt;/td&amp;gt;
    &amp;lt;td&amp;gt;Sharingan&amp;lt;/td&amp;gt;
    &amp;lt;td&amp;gt;No&amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Save the file and refresh your browser to see the table displayed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Notice the heading is being rendered by paragraph tag. Alternatively, you can also use &lt;code&gt;&amp;lt;caption&amp;gt;&lt;/code&gt; tag, which will center the heading of the table. Experiment with the caption tag and refresh to see the changes.&lt;/p&gt;

&lt;p&gt;Note that &lt;code&gt;&amp;lt;caption&amp;gt;&lt;/code&gt; tag should only be used immediately after the &lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt; opening tag.&lt;/p&gt;

&lt;p&gt;You’ve now successfully created a basic table in HTML. Feel free to experiment with additional rows and columns to get more comfortable with HTML syntax.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Congratulations on completing your first steps into web development with HTML! The key to mastering HTML is practice. Experiment with different elements, create your own webpages, and don’t be afraid to make mistakes — every error is a learning opportunity.&lt;/p&gt;

&lt;p&gt;Remember, this is just the beginning. As you continue to build on this foundation, you’ll soon be able to create more complex and dynamic websites. Let’s make the web a better place, one line of code at a time.&lt;/p&gt;

&lt;p&gt;This article is written by &lt;strong&gt;&lt;code&gt;Anantha Krishnan&lt;/code&gt;&lt;/strong&gt;, a professional with experience in both IT and Mechanical Engineering. With a background in full stack development and a passion for mechanical and electrical systems, &lt;strong&gt;&lt;code&gt;Anantha Krishnan&lt;/code&gt;&lt;/strong&gt; is now focused on creating educational content to help beginners in fields of his expertise.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
