<?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>Forem: Oluwasegun Olatunji</title>
    <description>The latest articles on Forem by Oluwasegun Olatunji (@segunolatunji).</description>
    <link>https://forem.com/segunolatunji</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%2F868565%2F5cf6e969-26d7-4746-8c4f-0bd1880c3c6a.jpg</url>
      <title>Forem: Oluwasegun Olatunji</title>
      <link>https://forem.com/segunolatunji</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/segunolatunji"/>
    <language>en</language>
    <item>
      <title>Mastering CSS Sizing: A Guide to Responsive Design</title>
      <dc:creator>Oluwasegun Olatunji</dc:creator>
      <pubDate>Wed, 19 Apr 2023 16:55:48 +0000</pubDate>
      <link>https://forem.com/segunolatunji/mastering-css-sizing-a-guide-to-responsive-design-49hd</link>
      <guid>https://forem.com/segunolatunji/mastering-css-sizing-a-guide-to-responsive-design-49hd</guid>
      <description>&lt;p&gt;The presentation and layout of web pages are managed using the powerful styling language known as Cascading Style Sheets, or CSS.&lt;/p&gt;

&lt;p&gt;Size is one of the most important parts of responsive and adaptive designs, among others. In this article, we will dive deep into the world of CSS sizing, exploring the different units, techniques, and best practices for responsive design.&lt;/p&gt;

&lt;p&gt;Here's a list of what we will cover in this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;CSS Units&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CSS Sizing Properties&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Responsive Design Techniques&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CSS Units
&lt;/h2&gt;

&lt;p&gt;To change the size of elements in CSS, you need to know how to use the different units, and the three different types of CSS units are viewport units, relative units, and absolute&lt;/p&gt;

&lt;h3&gt;
  
  
  Absolute
&lt;/h3&gt;

&lt;p&gt;Absolute units have a set size that is independent of the parent element's and the user's device sizes. Common absolute units are as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Pixel (px) on a user's screen corresponds to a single dot. Although this is the most often used absolute unit, responsive design cannot effectively use it because it does not scale for different screen sizes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Points (pt): One point, which was formerly employed in print media, is equivalent to 1/72 of an inch. Because it does not scale well across different devices, it is not advised for web design.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Relative Units
&lt;/h3&gt;

&lt;p&gt;Relative units are perfect for flexible design since they can change in size according to the size of the parent element or other characteristics. Common related units are as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Em: This measurement unit is based on the parent element's font size. For instance, 1em is equivalent to 16px if the parent's font size is 16px. Scalable typography can be made with the use of em units.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rem: By using rem, which is unaffected by parent components' font sizes, you may guarantee uniform sizing across all of your elements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Percentages (%): This measurement is based on how big the parent element is. For instance, a child element with a width of 50% would be 100px wide if the parent element had a width of 200px.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Viewport Units
&lt;/h3&gt;

&lt;p&gt;The size of the user's device viewport determines the viewport units. These components are especially helpful for producing responsive designs that change according to the size of the screen. Common viewport units are as follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Viewport Width (vw): One unit is equal to one per cent of the viewport's width. For instance, 1vw is equal to 10px on a device with a viewport width of 1000px.&lt;/li&gt;
&lt;li&gt;Viewport Height (vh): One unit equals one per cent of the viewport's height (vh).&lt;/li&gt;
&lt;li&gt;Viewport Minimum (vmin): The smaller of vw or vh is equal to one unit in the Viewport Minimum (vmin) system.&lt;/li&gt;
&lt;li&gt;Viewport Maximum (vmax): The larger vw or vh is equal to one unit in the Viewport Maximum (vmax) system.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Choosing the Right Units
&lt;/h3&gt;

&lt;p&gt;Choosing the appropriate unit for sizing is crucial for creating responsive designs. In general, it is recommended to use relative units like em, rem, and percentages for most sizing tasks. Viewport units can be used when you want the size of an element to adapt directly to the viewport dimensions.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS Sizing Properties
&lt;/h2&gt;

&lt;p&gt;Now that we are familiar with the various units, let's look at some of the most popular CSS properties for element sizing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Width and Height
&lt;/h3&gt;

&lt;p&gt;The width and height properties define the size of an element's content area. They can be set using any of the units discussed above.&lt;/p&gt;

&lt;p&gt;The parameters of an element's width and height determine the size of its content area. To set them, any of the previously mentioned units can be used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div {
  width: 50%;
  height: 200px;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Padding, Margin, and Border
&lt;/h3&gt;

&lt;p&gt;Controlling the area around an element's content is made easier with padding, margin, and border attributes. In contrast to margin, which adds space outside the element, padding adds space inside the element, and the border attribute controls the element's border width.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div { padding: 1em;
    margin: 2rem;
    border: 1px solid black; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Box-sizing
&lt;/h3&gt;

&lt;p&gt;The box-sizing property controls how to calculate an element's dimensions. The default value, content-box subtracts padding and borders from the content area to determine the width and height.&lt;/p&gt;

&lt;p&gt;It is simpler to control element sizing using the border-box value because padding and border are taken into account when calculating width nd height.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div {
  box-sizing: border-box;
  width: 50%;
  padding: 1em;
  border: 1px solid black;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Background-size and Background-position
&lt;/h3&gt;

&lt;p&gt;The background image of an element can be positioned and scaled using these properties. You can change the background-size attribute to values like contain, cover, or particular measurements. The background-position attribute determines where the background image is located within the element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div {
  background-image: url('image.jpg');
  background-size: cover;
  background-position: center;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Responsive Design Techniques
&lt;/h2&gt;

&lt;p&gt;To make responsive designs, the layout must be changed to fit different screen sizes and devices. Here are a few well-liked methods for doing this:&lt;/p&gt;

&lt;h3&gt;
  
  
  Media Queries:
&lt;/h3&gt;

&lt;p&gt;Based on the user's device parameters, such as screen width or device orientation, media queries let you apply several styles and also construct breakpoints that modify the layout at particular screen sizes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
@media (max-width: 768px) {
  div {
    width: 100%;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Flexbox
&lt;/h3&gt;

&lt;p&gt;Flexbox is a CSS layout module that offers a more effective method of spacing out and aligning elements inside a container. By utilizing Flexbox, you can design responsive layouts that change to fit the available space.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  display: flex;
  flex-wrap: wrap;
}

.item {
  flex: 1;
  min-width: 200px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Grid Layout
&lt;/h3&gt;

&lt;p&gt;Another layout module that uses a two-dimensional grid structure to enable the creation of intricate and responsive designs is CSS Grid. Using CSS Grid, you may specify rows and columns and insert objects inside grid cells.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.item {
  grid-column: span 1;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Transitions and Transforms in CSS
&lt;/h3&gt;

&lt;p&gt;Responsive animations and effects can be made using CSS transformations and transitions. While transitions manage the timing of these changes, transforms let you alter the position, scale, and rotation of an element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div:hover {
  transform: scale(1.2);
  transition: transform 0.3s ease-in-out;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;The ability to understand CSS sizing is crucial for web designers and developers. You can only make responsive designs that look great on any device if you know about the different devices, features, and especially CSS sizing.&lt;/p&gt;

&lt;p&gt;For the majority of sizing activities, remember to use relative units like em, rem, and percentages, use viewport units for items that must adjust to the size of the viewport and to adjust element proportions, use properties like box-sizing, padding, margin, and border. For responsive layouts, look into new layout modules like Flexbox and Grid.&lt;/p&gt;

&lt;p&gt;Last but not least, remember to combine CSS transforms and transitions for responsive animations and effects and utilise media queries to establish breakpoints for various screen sizes. You'll be well on your way to producing stunning, responsive designs with CSS if you adhere to these best practices.&lt;/p&gt;

&lt;p&gt;See you next time!&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@afgprogrammer"&gt;Mohammad Rahmani&lt;/a&gt; on &lt;a href="https://unsplash.com/"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Understanding Container Theory And It's Application In Web Coding</title>
      <dc:creator>Oluwasegun Olatunji</dc:creator>
      <pubDate>Sun, 18 Sep 2022 12:16:27 +0000</pubDate>
      <link>https://forem.com/segunolatunji/understanding-container-theory-and-its-application-in-web-coding-5e11</link>
      <guid>https://forem.com/segunolatunji/understanding-container-theory-and-its-application-in-web-coding-5e11</guid>
      <description>&lt;p&gt;Container, in general term means to contain something; goods or other items inside an enclosed box or even a room.&lt;/p&gt;

&lt;p&gt;In web coding (HTML), the concept of container is not different from the above. It means containing some element into an opening and ending tag of an HTML document. Containing an element varies with each language and framework, but in this article it will be explained only in relation to HTML.&lt;/p&gt;

&lt;p&gt;In this article, we will extensively cover the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  HTML Tags&lt;/li&gt;
&lt;li&gt;  Types of Container Tags&lt;/li&gt;
&lt;li&gt;  Semantic Elements&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  HTML Tags
&lt;/h2&gt;

&lt;p&gt;HTML stands for Hypertext Markup Language which employs predefined elements and tags to instruct the browser on how to display the contents on a webpage .&lt;br&gt;
Tags are merely a few commands that are surrounded in angle braces(&amp;lt;, &amp;gt;) and are unofficially divided into two, which are: Empty tags and container tags. &lt;/p&gt;
&lt;h3&gt;
  
  
  Empty Tags
&lt;/h3&gt;

&lt;p&gt;In HTML, opening tags without a closing tag(/&amp;gt;) are known as empty tags, void tags, or self-closing tags.&lt;br&gt;
Syntax:&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;tag_name&amp;gt;content&amp;gt;

&amp;lt;br&amp;gt;
break this line
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;They are unable to hold more elements but are used in adding lists, images, hyperlinks meta-data, etc. into a website.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Adding a closing brace to an empty tag automatically makes it an invalid syntax&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;br&amp;gt;&amp;lt;/br&amp;gt;
invalid
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notably there are 15 empty tags listed in the HTML5 specification and they include:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; which represents the elements and information included in the meta-data of an HTML document.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;, also called carriage return. It is a tag that indicates line break in a text.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;area&amp;gt;&lt;/code&gt;, used to make a portion which mapped click able on an image.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt;, is used to embed an image into the document.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt;, it is used to to create a connection between content and an external resources. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;base&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;col&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;embed&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;hr&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;param&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;source&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;track&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;wbr&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;base&amp;gt;&lt;/code&gt; are other empty tags in HTML. &lt;/p&gt;

&lt;h3&gt;
  
  
  Container Tags
&lt;/h3&gt;

&lt;p&gt;Whenever a content is written between an opening and ending tag in an HTML document, the tag is referred to as a container tag. &lt;/p&gt;

&lt;p&gt;Syntax:&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;tag_name&amp;gt; contents &amp;lt;/tag_name&amp;gt;
&amp;lt;p&amp;gt;Container tag&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;In a line of code, the document is divided into three parts, i.e., an opening tag, content (which can also contain other tags) closing tag which put an end to the line.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The content is displayed in the browser in accordance to the structure of the document. If the container tag isn't closed, the browser applies the effect of the opening tag until the end of the page. &lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tags are examples of container tags. Many other tags are contained in them because they form the basic structure of an HTML document.&lt;/p&gt;

&lt;h3&gt;
  
  
  Examples of Container Tags
&lt;/h3&gt;

&lt;p&gt;There are lots of container tags in HTML but we are  going to cover a very significant few which houses both container tags and empty tag in an HTML document. &lt;/p&gt;

&lt;p&gt;The few tags are: &lt;br&gt;
&lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag, this tag is the second tag in an HTML document, all other tags are written in it and it has its closing tag written as, &lt;code&gt;&amp;lt;/html&amp;gt;&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;By using the opening &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag, the browser is informed that the page will be formatted in HTML.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag which has its closing tag written as &lt;code&gt;&amp;lt;/head&amp;gt;&lt;/code&gt; expressly contains details about the body, the page's title, the labels, etc. of a web page.&lt;/p&gt;

&lt;p&gt;Only specific markup elements like meta, link, script, etc. are permitted in the HTML5 head title.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag is used to specify the primary content that will be shown on a website. SUCH content include: text, images, videos, links, etc. It has its closing written as, &lt;code&gt;&amp;lt;/body&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Types of Container Tags
&lt;/h2&gt;

&lt;p&gt;Embedded within the html &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag are types of container tags that includes; styled container tags and block container tags which are classified by their intents. &lt;/p&gt;
&lt;h3&gt;
  
  
  Styled Container Tags
&lt;/h3&gt;

&lt;p&gt;This type of container tag consists of tags that are styled with the browser automatically by default. &lt;/p&gt;

&lt;p&gt;For instance, an hyperlink tag &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; will be styled by the browser to make it clickable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a: {
  color: link;
  cursor: pointer;
  text-decoration: underline;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above is styled using a CSS user agent stylesheet that is provided by the browser to make it specially defined in a manner that suites the HTML standard. &lt;/p&gt;

&lt;p&gt;The following tags are examples of styled tag and are specially styled by the browser.&lt;/p&gt;

&lt;p&gt;Header tags&lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;h3&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;h4&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;h5&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt; for different heading types.&lt;/p&gt;

&lt;p&gt;The button tag &lt;code&gt;&amp;lt;btn&amp;gt;&lt;/code&gt; for buttons.&lt;/p&gt;

&lt;p&gt;List tags &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;ol&amp;gt;&lt;/code&gt; for different kinds of lists.&lt;/p&gt;

&lt;p&gt;Hyperlink tag &lt;code&gt;&amp;lt;href&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Paragraph tag &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Text styling tags to either make a text bold &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; or in italics &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Block Container Tags
&lt;/h3&gt;

&lt;p&gt;Block container tags are mainly used to divide HTML document into sections such as; header, footer, etc. in other for the document to be easily accessible and understood by browsers and developers. &lt;/p&gt;

&lt;p&gt;Before the inception of HTML5, dividing an HTML document can only be done using a  &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tag with an id attribute. But now, &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;articles&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; tags have been drafted into the HTML5 specifications for dividing HTML documents. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Div&lt;/code&gt; Tag
&lt;/h3&gt;

&lt;p&gt;A division or segment is created in a document by the container tag known as &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;Div&amp;gt;&lt;/code&gt; tag is used to organize HTML elements so that they can be styled with CSS without changing its original content or layout. &lt;/p&gt;

&lt;p&gt;A &lt;code&gt;div&lt;/code&gt; tag has the flexibility to contain any HTML tag, including another &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Span&lt;/code&gt; Tag
&lt;/h3&gt;

&lt;p&gt;The HTML tag &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; is a general inline container for information that does not automatically denote anything.&lt;/p&gt;

&lt;p&gt;It can be used to group items that needs to be styled using the class or id attribute because they have similar attribute values, like &lt;code&gt;&amp;lt;lang&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Note that; It can only be used when other sematic tag is not appropriate for the purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sematic Elements
&lt;/h2&gt;

&lt;p&gt;An element is a part of an HTML file that instructs a web browser how to organize and interpret a particular section of the HTML file.&lt;/p&gt;

&lt;p&gt;In the case of sematic elements, they are elements that surround the html tags. They give an HTML page content rather than just presentation. It clarifies the many sections and page layouts of HTML, making it easier to understand.&lt;/p&gt;

&lt;p&gt;Also they consist of an opening tag, content, and closing tag like container tags. They are: &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;,  &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Header&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;It defines a header for a web page.&lt;/p&gt;

&lt;p&gt;A collection of introductory or navigational aids is often represented by the HTML element known as &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;. In addition to some heading components, it might also have a logo, a search form, the author's name, among other things.&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;header&amp;gt;
    &amp;lt;h2&amp;gt;Nigeria&amp;lt;/h2&amp;gt;
  &amp;lt;/header&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;Nav&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;It is the semantic element that designates a portion of a page whilst providing smooth navigation links, either within the current content or to other documents. &lt;/p&gt;

&lt;p&gt;Tables of contents, menus, and indexes are  examples of sections that can be navigated using the &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; 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;nav class="menu"&amp;gt;
&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;About&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&amp;lt;/nav&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;Section&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Chapters, headers, footers, and other sections are all defined using the &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; 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;section&amp;gt;
&amp;lt;a href="#"&amp;gt;My blog&amp;lt;/a&amp;gt;
&amp;lt;a href="#"&amp;gt;My LinkedIn profile&amp;lt;/a&amp;gt;
&amp;lt;/section&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;Article&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;It is a container element that is meant to be independently distributed within a document, page, application, or website. &lt;/p&gt;

&lt;p&gt;This element contains the main part which has the major information about the web page.&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;article class="Container tag"&amp;gt;
  &amp;lt;h2&amp;gt;examples of container tag&amp;lt;/h2&amp;gt;
&amp;lt;/article&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;Aside&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;In an HTML document, the &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt; element is majorly used to indicate the sidebar of a webpage.&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;article&amp;gt;
  &amp;lt;aside&amp;gt;
    &amp;lt;p&amp;gt;I am a young man&amp;lt;/p&amp;gt;
&amp;lt;/aside&amp;gt;
  &amp;lt;p&amp;gt;More about me...&amp;lt;/p&amp;gt;
&amp;lt;/article&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;Footer&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;It defines a footer for a document or a section&lt;br&gt;
And the footer contains major information relating to the author and the page.&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;footer&amp;gt;
This is a footer
&amp;lt;/footer&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;The coherent statement, rules, ideas and guiding principles that sets the operation behind the HTML container is that it entails opening and closing tags and have been duly explained in this article.  &lt;/p&gt;

&lt;p&gt;Like other HTML attributes and qualities, &lt;br&gt;
the explained parts that span through general html tags, types of containers and the sectioning semantic tags and their uses can't be overemphasized. &lt;/p&gt;

&lt;p&gt;In subsequent articles, I shall continue to dissect more essential attributes of web coding. &lt;/p&gt;

&lt;p&gt;Thank you and see you soon!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>Basic Web Principles - HTML And CSS Explained</title>
      <dc:creator>Oluwasegun Olatunji</dc:creator>
      <pubDate>Thu, 01 Sep 2022 21:11:05 +0000</pubDate>
      <link>https://forem.com/segunolatunji/basic-web-principles-html-and-css-explained-4o4l</link>
      <guid>https://forem.com/segunolatunji/basic-web-principles-html-and-css-explained-4o4l</guid>
      <description>&lt;p&gt;According to widely agreed tale, getting started &lt;br&gt;
in tech has always been difficult, on my path I had the same experience. I was practically confused finding what to learn, starting out with courses I didn't understand its prerequisites and jostling from one online learning platform to the other. &lt;/p&gt;

&lt;p&gt;In all, it felt like I was wasting my time until I spoke with a couple of friends and a mentor on adplist.com who told me that everything in programming revolves round the web and if I want to start off, I should start from the web.&lt;/p&gt;

&lt;p&gt;Starting from the web apparently means learning HTML, CSS and Javascript which are the web development fundamentals. In this article, I'll explain the basic web principle, niching down HTML and CSS and how they make the web work.&lt;/p&gt;

&lt;p&gt;Here’s a list of what we’ll cover in this article:&lt;/p&gt;

&lt;p&gt;•  The Web&lt;/p&gt;

&lt;p&gt;•  HTML&lt;/p&gt;

&lt;p&gt;•  CSS&lt;/p&gt;

&lt;h2&gt;
  
  
  The Web
&lt;/h2&gt;

&lt;p&gt;For a basic understanding of web, it is a subset of the internet.&lt;/p&gt;

&lt;p&gt;World Wide Web, is a portion of the Internet that consists of pages that can be accessed by a Web browser. In other words, the web is a collection of files and codes that are stored in a server that is divided into two; (web browser client and web server) and are connected to the internet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Internet
&lt;/h3&gt;

&lt;p&gt;This is a network of computers that communicate with each other to send and receive data (information), and each computer is identified by a unique number called the IP address.&lt;/p&gt;

&lt;h3&gt;
  
  
  IP Address
&lt;/h3&gt;

&lt;p&gt;An IP address is a lengthy string of numbers linked to every device connected to a network that uses the Internet as the medium for communication.&lt;/p&gt;

&lt;p&gt;To access a web on the internet, it loads through a browser which is known as the web client. For instance, someone sends you a link and when you click the link, your browser (web client) send a message to the website (web server) asking for the content of the link and the website's server receives the message and shows the link contents. &lt;/p&gt;

&lt;p&gt;The client-side and server-side are referred to as the “front end” and the “back end", respectively. This whole process has to be constructed as lines of codes and that's where HTML, CSS and the whole web development process comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is HTML?
&lt;/h2&gt;

&lt;p&gt;HTML stands for Hypertext Markup Language. &lt;br&gt;
It was founded in 1989 and it's the first building block of a web page, core of every web page and  starting point for anyone learning how to create content for the web.&lt;/p&gt;

&lt;h3&gt;
  
  
  How HTML works
&lt;/h3&gt;

&lt;p&gt;Rather than using a programming language to perform functions, it uses a Markup language which uses tags end elements to create primary content of a web page. The browser then reads to understand the contents and purpose it serves in a webpage.&lt;/p&gt;

&lt;h3&gt;
  
  
  HTML Document
&lt;/h3&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;Title of the webpage&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;blockquote&gt;
&lt;p&gt;To define a page, each and every HTML 5 document uses a different set of component and element.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While an HTML 5 document is made up of various elements, the following components are always present on every page: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A declaration statement at the top stating that the document is an HTML 5 document&lt;/li&gt;
&lt;li&gt;Header&lt;/li&gt;
&lt;li&gt;Body&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;!DOCTYPE&amp;gt;&lt;/code&gt; tag in HTML is used to specify the version of HTML that a document is utilizing. This is also described as document type declaration(DTD).&lt;br&gt;
Note that unlike other HTML tag, the &lt;code&gt;&lt;br&gt;
&amp;lt;!DOCTYPE&amp;gt;&lt;/code&gt; tag does not have an end tag.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag is the second tag in an HTML document, all other tags are written in it and it closes as &lt;code&gt;&amp;lt;/html&amp;gt;&lt;/code&gt; By using the opening &lt;code&gt;&lt;br&gt;
&amp;lt;html&amp;gt;&lt;/code&gt; tag, the browser is informed that the page will be formatted in HTML.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag which has its closing written as &lt;code&gt;&amp;lt;/head&amp;gt;&lt;/code&gt; expressly contain details about the body, the page's title, the labels, etc. of a web page. Only specific markup elements like meta, link, script, etc. are permitted in the HTML 5 head title.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; is used to specify the primary content that will be shown on a website. Such content include: text, images, videos, links, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is CSS?
&lt;/h2&gt;

&lt;p&gt;CSS stands for Cascading Style Sheet. &lt;br&gt;
CSS is a stylesheet language created in late 1990s to make beautiful web designs. Adding CSS to a web page will make the web pages appear aestetically pleasing.&lt;/p&gt;

&lt;h3&gt;
  
  
  How CSS works
&lt;/h3&gt;

&lt;p&gt;Like humans, we were created with skeleton which serves as a framework for the body, then we're covered with the skin which gives beauty and makes human beautiful&lt;/p&gt;

&lt;p&gt;The same thing with CSS, it works as the skin that covers HTML, it is used to create background colors, layout, styling, padding and every other designs that makes a webpage smart and beautiful. &lt;/p&gt;

&lt;p&gt;Presentation and ease of use are a couple of the main things that CSS has bought to web design by translating the way content looks on a webpage and what else goes on it to complement that content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSS Syntax&lt;/strong&gt;&lt;br&gt;
A selector, property, and its value are the components of a CSS Syntax. The HTML element where CSS style is applied is indicated by the selector. Semicolons are used to separate each CSS property.&lt;/p&gt;

&lt;p&gt;selector { Property: value; }&lt;/p&gt;

&lt;p&gt;The HTML element you want to style is indicated by the selector.&lt;br&gt;
One or more declarations are contained in the declaration block and are separated by semicolons.&lt;br&gt;
A comma separates the name of the CSS property from its value in each declaration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of CSS
&lt;/h2&gt;

&lt;h3&gt;
  
  
  - Internal CSS
&lt;/h3&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;style&amp;gt;
body {background-color: aliceblue;}
p    {color:yellow;}
&amp;lt;/style&amp;gt;

&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;p&amp;gt;This is paragraph is set at yellow color.&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;p&gt;Internal or embedded CSS works by adding CSS codes into &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; tag in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;section of an HTML document.&lt;br&gt;
A single page can be effectively styled with this CSS style but takes time to use this style for several pages because CSS rules must be added to each page of the website.&lt;/p&gt;

&lt;h3&gt;
  
  
  - External CSS
&lt;/h3&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" type="text/css" href="mystyle.css"&amp;gt;
&amp;lt;/head&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This type of CSS works by adding an external &lt;code&gt;.css&lt;/code&gt; folder that contains the whole stylesheet into the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag in an HTML document. &lt;/p&gt;

&lt;p&gt;A large website can be styled more effectively using this CSS type. An entire website can be changed at once by making changes to the &lt;code&gt;.css&lt;/code&gt; file.&lt;/p&gt;

&lt;h3&gt;
  
  
  - Inline CSS
&lt;/h3&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;Inline CSS&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;p style="color:yellow; font-size:40px;"&amp;gt;Yellow&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;p&gt;Typically, inline CSS is only used to style one type of HTML element, by adding the CSS style attribute to each HTML element.&lt;/p&gt;

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

&lt;p&gt;The first step to understanding web programming and web development is learning and understanding HTML and CSS and the most common and extensive use of learning HTML and CSS is to code for the web. Even if programming has applications in a wide range of fields, from cybersecurity to design employment, webpages are still built using HTML and CSS, with HTML serving as the structure and CSS serving as the finishing touches.&lt;/p&gt;

&lt;p&gt;Understanding and utilizing the alternatives provided by these two programming languages will not only put you in a strong position to build your own websites, but it will also open up numerous doors and opportunities for learning additional programming languages.&lt;/p&gt;

&lt;p&gt;In subsequent articles I shall be dissecting structures of each language and continue to open up our minds to web development. &lt;/p&gt;

&lt;p&gt;Thank you for reading and see you soon!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
