<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>AppCode</title>
	<atom:link href="https://appcode.app/feed/" rel="self" type="application/rss+xml" />
	<link>https://appcode.app</link>
	<description>Web Design Articles</description>
	<lastBuildDate>Thu, 03 Feb 2022 00:06:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.7.5</generator>
<site xmlns="com-wordpress:feed-additions:1">195475143</site>	<item>
		<title>The CSS justify-self Property</title>
		<link>https://appcode.app/the-css-justify-self-property/</link>
		
		<dc:creator><![CDATA[Appcode]]></dc:creator>
		<pubDate>Wed, 02 Feb 2022 23:56:43 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">https://appcode.app/?p=8324</guid>

					<description><![CDATA[<p>This reference demonstrates the CSS justify-self property and its ability to justify content within an alignment container along an axis. Examples using the different values of the justify-self property are included, such as start, end, and center. center The CSS justify-self property with the center value packs the item in the middle of the alignment container. start The CSS justify-self property with the start value packs the element at the alignment container&#8217;s start. end The CSS justify-self property with an end value packs the element at the alignment container&#8217;s end. The design above has one column and three rows, but…</p>
<p>The post <a rel="nofollow" href="https://appcode.app/the-css-justify-self-property/">The CSS justify-self Property</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This reference demonstrates the CSS justify-self property and its ability to justify content within an alignment container along an axis. Examples using the different values of the <strong>justify-self</strong> property are included, such as start, end, and center.</p>



<figure class="wp-block-table"><table><tbody><tr><td>center</td><td>The CSS justify-self property with the center value packs the item in the middle of the alignment container. </td></tr><tr><td>start</td><td>The CSS justify-self property with the start value packs the element at the alignment container&#8217;s start.</td></tr><tr><td>end</td><td>The CSS justify-self property with an end value packs the element at the alignment container&#8217;s end.</td></tr></tbody></table></figure>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/How-to-Use-CSS-Justify-Self-Center-Property.png?resize=1024%2C576&#038;ssl=1" alt="How to Use CSS Justify-Self Center Property" class="wp-image-8400" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/How-to-Use-CSS-Justify-Self-Center-Property.png?resize=1024%2C576&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/How-to-Use-CSS-Justify-Self-Center-Property.png?resize=300%2C169&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/How-to-Use-CSS-Justify-Self-Center-Property.png?resize=768%2C432&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/How-to-Use-CSS-Justify-Self-Center-Property.png?resize=1536%2C864&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/How-to-Use-CSS-Justify-Self-Center-Property.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>How to Use CSS Justify-Self Center Property</figcaption></figure>



<p>The design above has one column and three rows, but the CSS properties indicate a nine-by-nine grid template. You can see the three columns being defined with the <strong>grid-template-columns</strong> property.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.grid-container {
  display: grid;
  grid-template-columns: auto auto auto;
  width: auto;
  grid-gap: 5px;
}</code></pre>



<p></p>



<p>Then when you look at the HTML, you can see three rows. </p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;div class="grid-container">
  &lt;div class="header">Header&lt;/div>
  &lt;div class="form">Form&lt;/div>
  &lt;div class="footer">Footer&lt;/div>
&lt;/div></code></pre>



<p></p>



<p>The grid-column property below tells the grid to position the form row at column one and to span three columns because the value of <strong>grid-column</strong> is 1 / span 3. </p>



<pre class="wp-block-code"><code lang="css" class="language-css">grid-column: 1 / span 3;</code></pre>



<pre class="wp-block-code"><code lang="css" class="language-css">.form {
  grid-row: 2;
  grid-column: 1 / span 3;
  background-color: #14906a;
  padding: 20px;
  font-size: 30px;
  width: 50%;
  height: 505px;
  justify-self: center;
  border-radius: 5px;
}</code></pre>



<p></p>



<p>So how are we centering the form row? That&#8217;s where the <strong>justify-self</strong> property comes in! We first set a width on the row, which is set to a width of 50%. Next, we then use <strong>justify-self</strong> to center the row within the columns.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">width: 50%;
justify-self: center;</code></pre>



<p></p>



<p>This code is pretty simple; it makes the row 50% of its full width and then instructs the browser to center the row within the three-column span.</p>



<p>Not only can we center the row within the three-column span, but we can make it start at the beginning by using the start value.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">justify-self: start;</code></pre>



<p></p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-Start-Property.png?resize=1024%2C576&#038;ssl=1" alt="How To Use CSS Justify-Self Start Property" class="wp-image-8402" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-Start-Property.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-Start-Property.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-Start-Property.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-Start-Property.png?resize=1536%2C864&amp;ssl=1 1536w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-Start-Property.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>How To Use CSS Justify-Self Start Property</figcaption></figure>



<p>Addionally, we can also change the value to end like <code>justify-self: end;</code> which places the row at the end of the span. </p>



<pre class="wp-block-code"><code lang="css" class="language-css">justify-self: end;</code></pre>



<p></p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-End-Property.png?resize=1024%2C576&#038;ssl=1" alt="How To Use CSS Justify-Self End Property" class="wp-image-8401" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-End-Property.png?resize=1024%2C576&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-End-Property.png?resize=300%2C169&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-End-Property.png?resize=768%2C432&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-End-Property.png?resize=1536%2C864&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/02/How-To-Use-CSS-Justify-Self-End-Property.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>How To Use CSS Justify-Self End Property</figcaption></figure>



<h2>Wrapping up</h2>



<p>The property <strong>justify-self</strong> is used to align or position items along the horizontal axis within a grid, ideally along a row. It accepts four values; start, center, end, and stretch.</p>



<p>If you wish to test the code for this grid layout, <a href="https://codepen.io/tyler-chipman/pen/NWwxeJr">check it out here on codepen.io</a></p>



<p></p>



<h2>Recommended Articles</h2>



<ul><li><a href="https://appcode.app/a-guide-on-how-to-use-css-grids-for-layouts/">A Guide on How To Use CSS Grids for Layouts</a></li><li><a href="https://appcode.app/how-to-create-a-responsive-flexbox-grid/">How to Create a Responsive Flexbox Grid</a></li></ul>



<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "What is the center value of the CSS justify-self property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The CSS justify-self property with the center value packs the item in the middle of the alignment container."
    }
  },{
    "@type": "Question",
    "name": "What is the start value of the CSS justify-self property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The CSS justify-self property with the start value packs the element at the alignment container's start."
    }
  },{
    "@type": "Question",
    "name": "What is the end value of the CSS justify-self property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The CSS justify-self property with an end value packs the element at the alignment container's end."
    }
  }]
}
</script>
<p>The post <a rel="nofollow" href="https://appcode.app/the-css-justify-self-property/">The CSS justify-self Property</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">8324</post-id>	</item>
		<item>
		<title>A Guide on How To Use CSS Grids for Layouts</title>
		<link>https://appcode.app/a-guide-on-how-to-use-css-grids-for-layouts/</link>
		
		<dc:creator><![CDATA[Juma Ciry]]></dc:creator>
		<pubDate>Tue, 25 Jan 2022 02:35:03 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">https://appcode.app/?p=8122</guid>

					<description><![CDATA[<p>This article demonstrates how to use CSS grids to improve the layout of your web pages. It includes well-elaborated examples of implementing a grid using the different grid properties, and it also includes code snippets that you can try. When displaying content on a web page, it’s crucial to think about how the different items like the icons, images, headers, footers, sidebars, search bars, and text will be positioned. The layout can get messy when displayed on different browsers or devices without a proper blueprint. CSS grid provides you with the flexibility to tell all platforms (browsers and devices) how…</p>
<p>The post <a rel="nofollow" href="https://appcode.app/a-guide-on-how-to-use-css-grids-for-layouts/">A Guide on How To Use CSS Grids for Layouts</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This article demonstrates how to use CSS grids to improve the layout of your web pages. It includes well-elaborated examples of implementing a grid using the different grid properties, and it also includes code snippets that you can try.</p>



<p>When displaying content on a web page, it’s crucial to think about how the different items like the icons, images, headers, footers, sidebars, search bars, and text will be positioned. The layout can get messy when displayed on different browsers or devices without a proper blueprint. CSS grid provides you with the flexibility to tell all platforms (browsers and devices) how the content will organize and arrange itself.</p>



<h2>Why You Should be Using CSS Grid Layout</h2>



<p>CSS grid provides a way for web developers to easily map how the space on a web page will hold content. You can create rows and columns because the grid uses a two-dimensional positioning algorithm, and a grid can make it easy to organize complex web pages. Addionally with mapping and structure, the CSS grid can create a responsive web page layout that automatically adjusts to device screen size and orientation. It can adapt to PCs, tablets, mobile phones, and other devices. With this said, you may wonder about compatibility. The good news is that the grid layout is compatible with all your favorite browsers such as Chrome, Mozilla Firefox, Safari, Brave, Edge, Opera, and more.</p>



<h2>Important CSS Classes </h2>



<figure class="wp-block-table"><table><tbody><tr><td>.<em>grid-container</em></td><td>The grid-container class is the parent element that holds the grid within its boundaries. In this tutorial, we use the CSS properties grid-template-cols and grid-template-rows.</td></tr><tr><td>.<em>grid-item</em></td><td>The grid-item class is the immediate child element of a grid-container. We use the grid-columns property here to set the column origin and span. </td></tr></tbody></table></figure>



<h2>Key CSS Grid Properties</h2>



<figure class="wp-block-table"><table><tbody><tr><td><em>display: <em>grid</em></em>;</td><td>The display property combined with the grid value activates the grid model layout. The grid value makes the element behave like a block element and is applied to the parent container that holds the grid items. The property is used as display: grid;</td></tr><tr><td><em><em>grid-template-cols</em></em></td><td>The grid-template-cols property defines the column size, the sizing track functions, and the name of the lines of the columns in the grid template.</td></tr><tr><td><em>grid-template-rows</em></td><td>The grid-template-rows property defines the row size, the sizing track functions, and the name of the row lines in the grid template.</td></tr><tr><td><em>grid-row</em></td><td>The grid-row property defines the row placement of an item and how it spans (where it starts and ends). The value of the grid-row can be nothing (automatic), a row number for placement, or the span, which indicates how many rows to span.</td></tr><tr><td><em>grid-column</em></td><td>The grid-column property defines the column placement of an item and how it spans (where it starts and ends). The value of the grid-column can be nothing (automatic), a column number for placement, or the span, which indicates how many columns to span.</td></tr><tr><td><em>grid-gap</em></td><td>The grid-gap property specifies the size of the gap between columns or rows for the grid layout and is a shorthand for the grid-row-gap property and grid-column-gap property.</td></tr><tr><td><em>position</em></td><td>The position property is used to define the position type that will be used for an element such as static, relative, absolute, fixed, or sticky. </td></tr></tbody></table></figure>



<h2>Examples of Web Page Layout Using CSS Grid</h2>



<p>Now that we have been introduced to the CSS grid, let&#8217;s see the different ways how you can build beautiful design layouts using the grid layout. We&#8217;ve included seven various examples below.</p>



<ol><li><a href="#one">CSS Grid Layout With Three Columns</a></li><li><a href="#two">CSS Grid Layout With Profile</a></li><li><a href="#three">CSS Grid Layout for a Basic Messenger</a></li><li><a href="#four">CSS Grid Layout for Accordion Sections</a></li><li><a href="#five">CSS Grid Layout for an Image Grid</a></li><li><a href="#six">CSS Grid Layout for a Web Form With Sidebars</a></li><li><a href="#seven">CSS Grid Layout With Footnotes</a></li></ol>



<h3 id="one">Layout 1: CSS Grid Layout With Three Columns</h3>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Three-Columns.png?resize=1024%2C576&#038;ssl=1" alt="CSS Grid Layout With Three Columns" class="wp-image-8154" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Three-Columns.png?resize=1024%2C576&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Three-Columns.png?resize=300%2C169&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Three-Columns.png?resize=768%2C432&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Three-Columns.png?resize=1536%2C864&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Three-Columns.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>CSS Grid Layout With Three Columns</figcaption></figure>



<p>Looking a the image above, the layout has three significant areas, the header section, the search section, and the columns. To create these sections, we need to define some HTML elements.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!-- GRID MESH --&gt;
&lt;div class="grid-container"&gt;
  &lt;div class="grid-item item-1"&gt;Header&lt;/div&gt;
  &lt;div class="grid-item item-2"&gt;Search&lt;/div&gt;
  &lt;div class="grid-item item-3"&gt;Right Sidebar&lt;/div&gt;
  &lt;div class="grid-item item-4"&gt;Left Sidebar&lt;/div&gt;
  &lt;div class="grid-item item-5"&gt;Middle Column&lt;/div&gt;
&lt;/div&gt;</code></pre>



<p>We define the grid container, which contains the grid mesh, and the grid item, which holds the items. Once the mesh has been described with HTML elements, the next step is to position the five sections onto the grid by specifying their positions (rows and columns) with CSS.</p>



<p>All five sections above are contained within a <code>.grid-container</code> class. Included in the <code>.grid-container</code> is a CSS property called <b>display</b>. </p>



<p class="note">Whenever the display property has a value of <b>grid</b>, the property turns the element and its children into a grid.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.grid-container {
  display: grid;
  grid-template-columns: auto auto auto;
  padding: 10px;
}</code></pre>



<p></p>



<p>Addionally you see another property called the <b>grid-template-columns</b>. This property defines the names of lines and the functions used in the grid. </p>



<pre class="wp-block-code"><code lang="css" class="language-css">grid-template-columns: auto auto auto;</code></pre>



<p></p>



<p class="note">In this example, the value of <b>grid-template-columns</b> doesn&#8217;t indicate the name of lines, but it does use <code>auto auto auto</code>. The auto value is defined three times, which tells the grid to use automatic widths to fill the parent element&#8217;s width.</p>



<p>Here is the style for the above CSS grid design. You can combine the code with the HTML above and the CSS to complete the layout.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.grid-container {
  display: grid;
  grid-template-columns: auto auto auto;
  padding: 10px;
}

.grid-item {
  box-shadow: 0 5px 5px rgb(0 0 0 / 49%);
  margin: 10px;
  border: 0;
  border-radius: 10px;
  padding: 20px;
  font-size: 30px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  text-align: center;
  font-family: Arial;
}

.item-1 {
  grid-row: 1;
  grid-column: 1 / span 3;
  border: 3px solid #c87922;
  background: #f89427;
  padding: 20px;
  font-size: 30px;
}

.item-2 {
  grid-row: 2;
  grid-column: 1 / span 2;
  border: 3px solid #5a985b;
  background: #75c576;
  padding: 20px;
  font-size: 30px;
}

.item-3 {
  grid-row: 2 / span 3;
  grid-column: 3;
  border: 3px solid #b85757;
  background: #ec7272;
  padding: 20px;
  font-size: 30px;
}

.item-4 {
  grid-row: 3;
  grid-column: 1;
  border: 3px solid #34a2c2;
  background: #3dc0e6;
  padding: 20px;
  font-size: 30px;
  height: 560px;
}

.item-5 {
  grid-row: 3;
  grid-column: 2;
  border: 3px solid #8774bc;
  background: #9e84e4;
  padding: 20px;
  font-size: 30px;
  height: 560px;
}
</code></pre>



<p></p>



<p>Here is the entire <a href="https://codepen.io/tyler-chipman/pen/oNovOdz">code and example on Codepen.io for layout one</a>.</p>



<h3 id="two">Layout 2: CSS Grid Layout With Profile</h3>



<p>This layout demonstrates creating a web page with a profile and main body. The main body section is where you design a feed or other features the user can see whenever they log in to their profile.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-a-Profile.png?resize=1024%2C576&#038;ssl=1" alt="CSS Grid Layout With a Profile" class="wp-image-8153" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-a-Profile.png?resize=1024%2C576&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-a-Profile.png?resize=300%2C169&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-a-Profile.png?resize=768%2C432&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-a-Profile.png?resize=1536%2C864&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-a-Profile.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>CSS Grid Layout With a Profile</figcaption></figure>



<p>This is the HTML code below which the structure is the same across most of the layout examples in this tutorial.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!-- GRID MESH --&gt;
&lt;div class="grid-container"&gt;
  &lt;div class="grid-item item-1"&gt;Menu Bar&lt;/div&gt;
  &lt;div class="grid-item item-2"&gt;Header&lt;/div&gt;
  &lt;div class="grid-item item-3"&gt;Profile&lt;/div&gt;
  &lt;div class="grid-item item-4"&gt;Main Body&lt;/div&gt;
  &lt;div class="grid-item item-5"&gt;Footer&lt;/div&gt;
&lt;/div&gt;</code></pre>



<pre class="wp-block-code"><code lang="css" class="language-css">/* LAYOUT 2 */
.grid-container {
  display: grid;
  grid-template-columns: auto auto auto;
  padding: 10px;
}

.grid-item {
  box-shadow: 0 5px 5px rgb(0 0 0 / 49%);
  margin: 10px;
  border: 0;
  border-radius: 10px;
  padding: 20px;
  font-size: 30px;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(12, 1fr);
  text-align: center;
  font-family: Arial;
}

.item-1 {
  grid-row: 1;
  grid-column: 1 / span 3;
  border: 3px solid #5a985b;
  background: #75c576;
  padding: 20px;
  font-size: 30px;
}

.item-2 {
  grid-row: 2;
  grid-column: 1 / span 3;
  border: 3px solid #c87922;
  background: #f89427;
  padding: 20px;
  font-size: 30px;
}

.item-3 {
  grid-row: 3;
  grid-column: 1;
  border: 3px solid #b85757;
  background: #ec7272;
  padding: 20px;
  font-size: 30px;
}

.item-4 {
  grid-row: 3;
  grid-column: 2 / span 2;
  border: 3px solid #34a2c2;
  background: #3dc0e6;
  padding: 20px;
  font-size: 30px;
  height: 460px;
}

.item-5 {
  grid-row: 5;
  grid-column: 1 / span 3;
  border: 3px solid #8774bc;
  background: #9e84e4;
  padding: 20px;
  font-size: 30px;
}
</code></pre>



<p>To edit layout two, visit the <a href="https://codepen.io/tyler-chipman/pen/RwjwBQX">layout two CSS and HTML code on Codepen.io</a></p>



<h3 id="three">Layout 3: CSS Grid Layout for a Basic Messenger</h3>



<p>This design shows how you can use the grid mesh to create a basic messenger-style app structure. This example uses eight sections, and we also include icons from font-awesome.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Basic-Messenger.png?resize=1024%2C576&#038;ssl=1" alt="CSS Grid Layout for a Basic Messenger" class="wp-image-8157" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Basic-Messenger.png?resize=1024%2C576&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Basic-Messenger.png?resize=300%2C169&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Basic-Messenger.png?resize=768%2C432&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Basic-Messenger.png?resize=1536%2C864&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Basic-Messenger.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>CSS Grid Layout for a Basic Messenger</figcaption></figure>



<p>Here is the HTML grid mesh below.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!-- GRID MESH --&gt;
&lt;div class="grid-container"&gt;
  &lt;div class="grid-item item-1"&gt;
    &lt;i class="fa fa-home bottomleft" aria-hidden="true"&gt;&lt;/i&gt;
    &lt;center&gt;
      &lt;span&gt;Menu Bar&lt;/span&gt;
      &lt;i class="fa fa-bell" aria-hidden="true"&gt;&lt;/i&gt;
      &lt;i class="fa fa-telegram" aria-hidden="true"&gt;&lt;/i&gt;
      &lt;i class="fa fa-camera" aria-hidden="true"&gt;&lt;/i&gt;
    &lt;/center&gt;
    &lt;i class="fa fa-bars bottomright" aria-hidden="true"&gt;&lt;/i&gt;
  &lt;/div&gt;
  &lt;div class="grid-item item-2"&gt;Messages&lt;/div&gt;
  &lt;div class="grid-item item-3"&gt;Groups&lt;/div&gt;
  &lt;div class="grid-item item-4"&gt;Friends&lt;/div&gt;
  &lt;div class="grid-item item-6"&gt;Search Bar&lt;/div&gt;
  &lt;div class="grid-item item-7"&gt;Avatars&lt;/div&gt;
  &lt;div class="grid-item item-8"&gt;Current Chat Body&lt;/div&gt;
  &lt;div class="grid-item item-9"&gt;New message requests&lt;/div&gt;
&lt;/div&gt;</code></pre>



<pre class="wp-block-code"><code lang="css" class="language-css">.grid-container {
  display: grid;
  grid-template-columns: auto auto auto;
  padding: 10px;
}

.fa {
  color: #3c663d;
}

.grid-item {
  box-shadow: 0 5px 5px rgb(0 0 0 / 49%);
  margin: 10px;
  border: 0;
  border-radius: 10px;
  padding: 20px;
  font-size: 30px;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(12, 1fr);
  text-align: center;
  font-family: Arial;
}

.item-1 {
  grid-row: 1;
  grid-column: 1 / span 3;
  border: 3px solid #5a985b;
  background: #75c576;
  position: relative;
}

.item-2 {
  grid-row: 2;
  grid-column: 1;
  border: 3px solid #c87922;
  background: #f89427;
}

.item-3 {
  grid-row: 2;
  grid-column: 2;
  border: 3px solid #c87922;
  background: #f89427;
}

.item-4 {
  grid-row: 2;
  grid-column: 3;
  border: 3px solid #c87922;
  background: #f89427;
}

.item-8 {
  grid-row: 6;
  grid-column: 1 / span 3;
  border: 3px solid #34a2c2;
  background: #3dc0e6;
  height: 260px;
}

.item-9 {
  grid-row: 7;
  grid-column: 1 / span 3;
  border: 3px solid #5a985b;
  background: #75c576;
}

.bottomleft {
  position: absolute;
  bottom: 20px;
  left: 20px;
}

.bottomright {
  position: absolute;
  bottom: 20px;
  right: 20px;
}

.item-7 {
  grid-row: 4;
  grid-column: 1 / span 3;
  border: 3px solid #8774bc;
  background: #9e84e4;
}

.item-6 {
  grid-row: 3;
  grid-column: 1 / span 3;
  border: 3px solid #b85757;
  background: #ec7272;
}
</code></pre>



<p></p>



<p>Layout three can be created with the code above, or you <a href="https://codepen.io/tyler-chipman/pen/oNoNMJR">may visit codepen.io.</a> </p>



<h3 id="four">Layout 4: CSS Grid Layout for Accordion Sections</h3>



<p>Layout four illustrates a web page broken down into horizontal blocks like an accordion because the sections are stacked.  </p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-Accordion-Sections.png?resize=1024%2C576&#038;ssl=1" alt="CSS Grid Layout for Accordion Sections" class="wp-image-8160" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-Accordion-Sections.png?resize=1024%2C576&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-Accordion-Sections.png?resize=300%2C169&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-Accordion-Sections.png?resize=768%2C432&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-Accordion-Sections.png?resize=1536%2C864&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-Accordion-Sections.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>CSS Grid Layout for Accordion Sections</figcaption></figure>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!-- GRID MESH --&gt;
&lt;div class="grid-container"&gt;
  &lt;div class="grid-item item-1"&gt;
    &lt;center&gt;Menu Bar&lt;/center&gt;
    &lt;a href="#"&gt;
      &lt;i class="fa fa-bars topleft" aria-hidden="true"&gt;&lt;/i&gt;
    &lt;/a&gt;
    &lt;a href="GRID_1.html"&gt;
      &lt;i class="fa fa-home topright" aria-hidden="true"&gt;&lt;/i&gt;
    &lt;/a&gt;
    &lt;a href="#"&gt;
      &lt;i class="fa fa-search bottomright" aria-hidden="true"&gt;&lt;/i&gt;
    &lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="grid-item item-2"&gt;My Proposals&lt;/div&gt;
  &lt;div class="grid-item item-3"&gt;My Profile&lt;/div&gt;
  &lt;div class="grid-item item-4"&gt;My Project Dashboard&lt;/div&gt;
&lt;/div&gt;

&lt;div class="grid-container"&gt;
  &lt;div class="grid-item item-1"&gt;Sub header&lt;/div&gt;
  &lt;div class="grid-item item-2"&gt;Sub menu&lt;/div&gt;
  &lt;div class="grid-item item-6"&gt;Main Body&lt;/div&gt;
&lt;/div&gt;</code></pre>



<p></p>



<p>Addionally we position content like the icons within a grid item using CSS classes like the <code>topleft</code> corner, <code>bottomleft</code> corner, <code>topright</code> corner, or <code>bottomright</code> corner.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">/* POSITIONING */
.topleft {
  position: absolute;
  top: 20px;
  left: 20px;
}

.topright {
  position: absolute;
  top: 20px;
  right: 20px;
}

.bottomright {
  position: absolute;
  bottom: 23px;
  right: 60px;
}

.bottomright {
  position: absolute;
  bottom: 20px;
  left: 20px;
}</code></pre>



<p></p>



<p>To view the entire code for <a href="https://codepen.io/tyler-chipman/pen/wvPvEze?editors=1100">this example, look it up&nbsp;here</a>.</p>



<h3 id="five">Layout 5: CSS Grid Layout for an Image Grid</h3>



<p>This layout design is for websites that deal with images or videos on their platform. CSS Grid Layout provides an easy-to-use framework to organize the graphics more presentably.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-an-Image-Grid.png?resize=1024%2C576&#038;ssl=1" alt="CSS Grid Layout for an Image Grid" class="wp-image-8162" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-an-Image-Grid.png?resize=1024%2C576&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-an-Image-Grid.png?resize=300%2C169&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-an-Image-Grid.png?resize=768%2C432&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-an-Image-Grid.png?resize=1536%2C864&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-an-Image-Grid.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>CSS Grid Layout for an Image Grid</figcaption></figure>



<p>The images are placed in a grid format using the <b>display</b>, <b>grid-gap</b>, and the <b>grid-template-columns</b> properties.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.img-container {
  display: grid; /* Set the grid */
  grid-template-columns: repeat(
    auto-fit,
    minmax(300px, 1fr)
  ); This function sets the grid item column behavior */
  grid-gap: 40px;
  padding: 20px;
  width: 100%;
}</code></pre>



<p></p>



<p>This example uses the repeat function for the <b>grid-template-columns</b>. </p>



<pre class="wp-block-code"><code lang="css" class="language-css">  grid-template-columns: repeat(
    auto-fit,
    minmax(300px, 1fr)
  ); /* This function sets the grid item column behavior */</code></pre>



<p></p>



<p>The line <code>grid-template-columns: repeat(auto-fit, minmax(300px,1fr));</code>: subdivides the grid into columns 300 pixels wide in which the images will be contained. It automatically fits them depending on the size of the display device. The <a href="https://codepen.io/tyler-chipman/pen/ExbxepY?editors=1100">entire code is available on Codepen.</a></p>



<h3 id="six">Layout 6: CSS Grid Layout for a Web Form With Sidebars</h3>



<p>This layout demonstrates creating a web page with a form and two sidebars. </p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Web-Form-With-Sidebars.png?resize=1024%2C576&#038;ssl=1" alt="CSS Grid Layout for a Web Form With Sidebars" class="wp-image-8165" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Web-Form-With-Sidebars.png?resize=1024%2C576&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Web-Form-With-Sidebars.png?resize=300%2C169&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Web-Form-With-Sidebars.png?resize=768%2C432&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Web-Form-With-Sidebars.png?resize=1536%2C864&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-for-a-Web-Form-With-Sidebars.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>CSS Grid Layout for a Web Form With Sidebars</figcaption></figure>



<p></p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;div class="grid-container"&gt;
  &lt;div class="grid-item item-1"&gt;Header&lt;/div&gt;
  &lt;div class="grid-item item-4"&gt;Left Sidebar&lt;/div&gt;
  &lt;div class="grid-item item-2"&gt;Form&lt;/div&gt;
  &lt;div class="grid-item item-5"&gt;Right Sidebar&lt;/div&gt;
  &lt;div class="grid-item item-3"&gt;Footer&lt;/div&gt;
&lt;/div&gt;</code></pre>



<pre class="wp-block-code"><code lang="css" class="language-css">html,
body {
  margin: 0;
}

.grid-container {
  display: grid;
  grid-template-columns: auto auto;
  padding: 10px;
  width: auto;
}

.grid-item {
  box-shadow: 0 5px 5px rgb(0 0 0 / 49%);
  margin: 10px;
  border: 0;
  border-radius: 10px;
  padding: 20px;
  font-size: 30px;
  text-align: center;
  font-family: Arial;
}

.item-1 {
  grid-row: 1;
  grid-column: 1 / span 8;
  border: 3px solid #34a2c2;
  background: #3dc0e6;
}

.item-3 {
  grid-row: 3;
  grid-column: 1 / span 8;
  border: 3px solid #34a2c2;
  background: #3dc0e6;
}

.item-2 {
  grid-row: 2;
  grid-column: 2 / span 6;
  height: 570px;
  border: 3px solid #c87922;
  background: #f89427;
}

.item-4 {
  grid-row: 2;
  grid-column: 1 / span 1;
  height: 570px;
  border: 3px solid #b85757;
  background: #ec7272;
}

.item-5 {
  grid-row: 2;
  grid-column: 8 / span 1;
  height: 570px;
  border: 3px solid #b85757;
  background: #ec7272;
}</code></pre>



<p></p>



<p>You can <a href="https://codepen.io/tyler-chipman/pen/gOXOdEX">check out this layout on codepen.io</a></p>



<h2 id="seven">Layout 7: CSS Grid Layout With Footnotes</h2>



<p>Layout seven illustrates how to set the exact width for grid rows and columns using pixels. Addionally we add footers underneath the bottom of the columns. </p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Footnotes-Sections.png?resize=1024%2C576&#038;ssl=1" alt="CSS Grid Layout With Footnotes Sections" class="wp-image-8205" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Footnotes-Sections.png?resize=1024%2C576&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Footnotes-Sections.png?resize=300%2C169&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Footnotes-Sections.png?resize=768%2C432&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Footnotes-Sections.png?resize=1536%2C864&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/CSS-Grid-Layout-With-Footnotes-Sections.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>CSS Grid Layout With Footnotes Sections</figcaption></figure>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;div class="grid-container"&gt;
  &lt;div class="grid-item item-1"&gt;Dashboard&lt;/div&gt;
  &lt;div class="grid-item item-2"&gt;Main Content&lt;/div&gt;
  &lt;div class="grid-item item-5"&gt;Sidebar&lt;/div&gt;
  &lt;div class="grid-item item-3"&gt;Footnote&lt;/div&gt;
  &lt;div class="grid-item item-4"&gt;Footnote&lt;/div&gt;
&lt;/div&gt;</code></pre>



<p></p>



<pre class="wp-block-code"><code lang="css" class="language-css">html,
body {
  margin: 0;
}

.grid-container {
  display: grid;
  padding: 10px;
  width: auto;
  grid-template-columns: 1fr 800px 1fr;
  grid-template-rows: 2fr 540px 1fr;
}

.grid-item {
  box-shadow: 0 5px 5px rgb(0 0 0 / 49%);
  margin: 10px;
  border: 0;
  border-radius: 10px;
  padding: 20px;
  font-size: 30px;
  text-align: center;
  font-family: Arial;
}

.item-1 {
  grid-row: 1;
  grid-column: 1 / span 3;
  border: 3px solid #34a2c2;
  background: #3dc0e6;
}

.item-3 {
  grid-row: 3;
  grid-column: 2 / span 2;
  border: 3px solid #34a2c2;
  background: #3dc0e6;
}

.item-2 {
  grid-row: 2;
  grid-column: 1 / span 2;
  border: 3px solid #c87922;
  background: #f89427;
}

.item-4 {
  grid-row: 3;
  grid-column: 1 / span 1;
  border: 3px solid #b85757;
  background: #ec7272;
}

.item-5 {
  grid-row: 2;
  grid-column: 3;
  border: 3px solid #b85757;
  background: #ec7272;
}
</code></pre>



<p></p>



<p>This design has a header, two columns, and two footers, respectively. The trick here is these two lines of code in the grid container that constructs a nine-by-nine grid template. Then we use some CSS properties to make the visible rows and columns fit within this structure the way we want.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.grid-container {
  grid-template-columns: 1fr 800px 1fr;
  grid-template-rows: 2fr 540px 1fr;
}</code></pre>



<p></p>



<p class="note">The two properties above accept uniform measurements for each row or column.</p>



<p>We see that <code>grid-template-columns: 1fr 800px 1fr;</code> sets the width of three invisible columns; this is the column template. The first and third column is set to 1fr, and the second column is set to 800px. </p>



<pre class="wp-block-code"><code lang="css" class="language-css">grid-template-columns: 1fr 800px 1fr;</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="329" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Horizontal-Invisible-Grid-Lines.png?resize=1024%2C329&#038;ssl=1" alt="A CSS Grid With Horizontal Invisible Grid Lines" class="wp-image-8387" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Horizontal-Invisible-Grid-Lines.png?resize=1024%2C329&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Horizontal-Invisible-Grid-Lines.png?resize=300%2C96&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Horizontal-Invisible-Grid-Lines.png?resize=768%2C246&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Horizontal-Invisible-Grid-Lines.png?resize=1536%2C493&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Horizontal-Invisible-Grid-Lines.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>A CSS Grid With Horizontal Invisible Grid Lines</figcaption></figure>



<p>Addionally above, you see the visible footnote rows. The rows also use a template, which is the row grid template. To create the row template, we used the&nbsp;<strong>grid-template-rows</strong>&nbsp;property.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">grid-template-rows: 2fr 540px 1fr;</code></pre>



<p></p>



<p>The&nbsp;<strong>grid-template-rows</strong>&nbsp;effectively sets the first row&#8217;s height to 2 fractions, the second row to 540px, and the last row to 1 fraction. This template can be seen in the image below.&nbsp;</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="835" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Vertical-Invisible-Grid-Lines.png?resize=1024%2C835&#038;ssl=1" alt="A CSS Grid With Vertical Invisible Grid Lines" class="wp-image-8359" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Vertical-Invisible-Grid-Lines.png?resize=1024%2C835&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Vertical-Invisible-Grid-Lines.png?resize=300%2C245&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Vertical-Invisible-Grid-Lines.png?resize=768%2C626&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-With-Vertical-Invisible-Grid-Lines.png?w=1325&amp;ssl=1 1325w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>A CSS Grid With Vertical Invisible Grid Lines</figcaption></figure>



<p>Now moving on to constructing the visible grid.</p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:66.66%">
<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="320" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-Footnotes-Fraction-Measurements.png?resize=1024%2C320&#038;ssl=1" alt="A CSS Grid Footnotes Fraction Measurements" class="wp-image-8337" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-Footnotes-Fraction-Measurements.png?resize=1024%2C320&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-Footnotes-Fraction-Measurements.png?resize=300%2C94&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-Footnotes-Fraction-Measurements.png?resize=768%2C240&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-Footnotes-Fraction-Measurements.png?resize=1536%2C480&amp;ssl=1 1536w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-Footnotes-Fraction-Measurements.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>A CSS Grid Footnotes Fraction Measurements</figcaption></figure>
</div>



<div class="wp-block-column" style="flex-basis:33.33%">
<figure class="wp-block-image size-large"><img loading="lazy" width="850" height="900" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-Sidebar-Fraction-Measurements.png?resize=850%2C900&#038;ssl=1" alt="A CSS Grid Sidebar Fraction Measurements" class="wp-image-8338" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-Sidebar-Fraction-Measurements.png?w=850&amp;ssl=1 850w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-Sidebar-Fraction-Measurements.png?resize=283%2C300&amp;ssl=1 283w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/02/A-CSS-Grid-Sidebar-Fraction-Measurements.png?resize=768%2C813&amp;ssl=1 768w" sizes="(max-width: 850px) 100vw, 850px" data-recalc-dims="1" /><figcaption>A CSS Grid Sidebar Fraction Measurements</figcaption></figure>
</div>
</div>



<p>In the first image above, you see there are two footer columns. In the CSS code, there is a property called <b>grid-column</b>. We use the <strong>grid-column</strong> property to set the first column&#8217;s width to take up the first template column. The grid column declares the column should start in the first template column and span only one column. </p>



<pre class="wp-block-code"><code lang="css" class="language-css"> grid-column: 1 / span 1;</code></pre>



<p> </p>



<p class="note">Since we used the value of 1fr as the first value in <strong>grid-template-columns</strong>, the first column&#8217;s width is 1fr.</p>



<p>On the other hand, the 2nd column starts in the second template column and spans two columns. The column width equals 800 pixels + 1fr (the last two template columns). Spanning the column is done with CSS grid-column property as follows. </p>



<pre class="wp-block-code"><code lang="css" class="language-css">grid-column: 2 / span 2;</code></pre>



<p></p>



<p>The total width of these two columns equals 1fr + 800px + 1fr, the same as the value of <b>grid-template-columns</b>. You can check the CSS code for the Dashboard, Main Content, and the Sidebar values for <strong>grid-column</strong> property values.</p>



<p>In the second image above, we don&#8217;t use the grid-column property; the row heights are set to the values of&nbsp;<strong>grid-template-row</strong>&nbsp;property. The grid-template-rows: 2fr 540px 1fr; sets the first row to two fractions, sets the size of the 2nd row to 540 pixels, and then the remaining row is a single fraction.</p>



<p>You may <a href="https://codepen.io/tyler-chipman/pen/vYWYVGW">view and test the entire code for Layout 7 here</a>.</p>



<h2>Let&#8217;s end here</h2>



<p>Thanks for going through this article. I hope you found it helpful and that it helped you better understand how to use CSS Grid Layout in your projects to make them more responsive and appealing.</p>



<h2>Recommended Articles</h2>



<ul><li><a href="https://appcode.app/the-awesome-css-transform-property-and-scale-function/">The Awesome CSS Transform Property and Scale Function</a></li><li><a href="https://appcode.app/explaining-the-scale-property-in-css/">Explaining the Scale Property in CSS</a></li><li><a href="https://appcode.app/how-to-center-div-elements-or-nested-elements/">How to Center DIV Elements or Nested Elements</a></li><li><a href="https://appcode.app/what-are-more-examples-of-html-elements-and-structure/">What Are More Examples of HTML Elements and Structure</a></li><li><a href="https://appcode.app/how-to-use-css-cascading-style-sheets-to-style-html/">How To Use CSS (Cascading Style Sheets) To Style HTML</a></li></ul>



<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "What is the display grid CSS property? (display: grid;)",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The display property combined with the grid value activates the grid model layout. The grid value makes the element behave like a block element and is applied to the parent container that holds the grid items. The property is used as display: grid;"
    }
  },{
    "@type": "Question",
    "name": "What is the grid-template-cols CSS property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The grid-template-cols property defines the column size, the sizing track functions, and the name of the lines of the columns in the grid template."
    }
  },{
    "@type": "Question",
    "name": "What is the grid-template-rows CSS property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The grid-template-rows property defines the row size, the sizing track functions, and the name of the row lines in the grid template."
    }
  },{
    "@type": "Question",
    "name": "What is the grid-row CSS property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The grid-row property defines the row placement of an item and how it spans (where it starts and ends). The value of the grid-row can be nothing (automatic), a row number for placement, or the span, which indicates how many rows to span."
    }
  },{
    "@type": "Question",
    "name": "What is the grid-column CSS property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The grid-column property defines the column placement of an item and how it spans (where it starts and ends). The value of the grid-column can be nothing (automatic), a column number for placement, or the span, which indicates how many columns to span."
    }
  },{
    "@type": "Question",
    "name": "What is the grid-gap CSS property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The grid-gap property specifies the size of the gap between columns or rows for the grid layout and is a shorthand for the grid-row-gap property and grid-column-gap property."
    }
  },{
    "@type": "Question",
    "name": "What is the CSS position property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The position property is used to define the position type that will be used for an element such as static, relative, absolute, fixed, or sticky."
    }
  }]
}
</script>
<p>The post <a rel="nofollow" href="https://appcode.app/a-guide-on-how-to-use-css-grids-for-layouts/">A Guide on How To Use CSS Grids for Layouts</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">8122</post-id>	</item>
		<item>
		<title>The Awesome CSS Transform Property and Scale Function</title>
		<link>https://appcode.app/the-awesome-css-transform-property-and-scale-function/</link>
		
		<dc:creator><![CDATA[Oluwatosin Saibu]]></dc:creator>
		<pubDate>Thu, 20 Jan 2022 02:48:52 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">https://appcode.app/?p=7905</guid>

					<description><![CDATA[<p>This tutorial is a CSS reference on the transform property and the scale function. These examples demonstrate how to use the scale function. From grid layouts, carousels, and down to colors, CSS defines the aesthetics of your website. It shapes the look and feels, acting as a car chassis&#8217;s body kit. In short, it determines your site&#8217;s user experience. So, learning this language is essential to exceeding the threshold of mediocrity in the web development field. Once you dive in and dig deep into the CSS language, you&#8217;ll understand its capabilities go beyond just adding layouts, fonts, and colors to…</p>
<p>The post <a rel="nofollow" href="https://appcode.app/the-awesome-css-transform-property-and-scale-function/">The Awesome CSS Transform Property and Scale Function</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This tutorial is a CSS reference on the transform property and the scale function. These examples demonstrate how to use the scale function.</p>



<p>From grid layouts, carousels, and down to colors, CSS defines the aesthetics of your website. It shapes the look and feels, acting as a car chassis&#8217;s body kit. In short, it determines your site&#8217;s user experience. So, learning this language is essential to exceeding the threshold of mediocrity in the web development field.</p>



<p>Once you dive in and dig deep into the CSS language, you&#8217;ll understand its capabilities go beyond just adding layouts, fonts, and colors to web structure. Interestingly, one of such unique properties of CSS is that it includes dynamic transformation properties. Those dynamic properties allow you to change the shapes and the positions of elements on a web page.</p>



<p>Though the goal of publishing this article is to shed more light on the transform: scale property, we&#8217;d like to, first, share with you what the CSS transform property is all about.</p>



<h2>An Overview</h2>



<p>The CSS transform property lets you visually manipulate elements by scaling, skewing, rotating, or translating.</p>



<figure class="wp-block-table"><table><tbody><tr><td><em>The default value</em></td><td><em>None&nbsp;</em></td></tr><tr><td><em>Inherited&nbsp;</em></td><td><em>No</em></td></tr><tr><td><em>Animatable</em></td><td><em>Yes</em></td></tr><tr><td><em>Version</em></td><td><em>CSS3</em></td></tr><tr><td><em>JavaScript syntax</em></td><td><em>object</em>.style.transform=&#8221;scale(1.5)&#8221;</td></tr></tbody></table></figure>



<h2>Scale CSS Styles</h2>



<pre class="wp-block-code"><code lang="css" class="language-css">.element {
  width: 50px;
  height: 50px;
  transform: scale(10);
}</code></pre>



<p></p>



<p>This example shows that the element highlighted above will now be scaled to ten times its original size, even with a defined height and width. However, in the example below, the element will be greatly the width but twice the height of the original element.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.element {
  transform: scale(3, 2);
}</code></pre>



<h2>Syntax</h2>



<pre class="wp-block-code"><code lang="css" class="language-css">transform: none|transform-functions|initial|inherit;</code></pre>



<h2>Property Values</h2>



<figure class="wp-block-table"><table><tbody><tr><td><strong><em>Value</em></strong></td><td><strong>Description</strong></td></tr><tr><td><em>None</em></td><td>The none value means there should be no transformation.</td></tr><tr><td><em>matrix</em>(<em>n,n,n,n,n,n</em>)</td><td>The matrix value is a function that defines a 2D transformation, and it uses a matrix of six values.</td></tr><tr><td><em>matrix3d</em><br>(<em>n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n</em>)</td><td>The matrix3d value is a function that defines a 3D transformation of an element using a 4&#215;4 matrix of 16 different values. </td></tr><tr><td><em>translate(x,y)</em></td><td>The translate value is a function that defines a 2D translation.</td></tr><tr><td><em>translate3d(x,y,z)</em></td><td>The translate3d value is a function that defines a 3D translation.</td></tr><tr><td><em>translateX(x)</em></td><td>The translateX value is a function that defines an element&#8217;s translation, and it uses the value for the X-axis.</td></tr><tr><td><em>translateY(y)</em></td><td>The translateY value is a function that defines a translation of an element, and it uses only the value for the Y-axis.</td></tr><tr><td><em>translateZ(z</em>)</td><td>The translateX value is a function that defines a 3D translation of an element but only uses the value for the Z-axis.</td></tr><tr><td><em>scale(x,y)</em></td><td>The scale value is a function that defines a 2D scale transformation.</td></tr><tr><td><em>scale3d(x,y,z)</em></td><td>The scale3d value is a function that defines a 3D scale transformation.</td></tr><tr><td><em>scaleX(x)</em></td><td>The scaleX value is a function that defines a scale transformation whose values are for the X-axis.</td></tr><tr><td><em>scaleY(y)</em></td><td>The scaleY value is a function that defines a scale transformation whose values are for the Y-axis.</td></tr><tr><td><em>scaleZ(z)</em></td><td>The scaleX value is a function that defines a 3D scale transformation by giving a value for the Z-axis.</td></tr><tr><td><em>rotate(angle)</em></td><td>The rotate value is a function that defines a 2D rotation. The angle is stated in the parameter.</td></tr><tr><td><em>rotate3d(x,y,z,angle)</em></td><td>The rotate3d value is a function that defines a 3D rotation.</td></tr><tr><td><em>rotateX(angle)</em></td><td>The rotateX value is a function that defines a 3D rotation along the element’s X-axis.</td></tr><tr><td><em>rotateY(angle)</em></td><td>The rotateY value is a function that defines a 3D rotation along the element’s Y-axis.</td></tr><tr><td><em>rotateZ(angle)</em></td><td>The rotateX value is a function that defines a 3D rotation along the Y-axis.</td></tr><tr><td><em>skew(x-angle, y-angle)</em></td><td>The skew value is a function that defines a 2D skew transformation along the X-axis and Y-axis.</td></tr><tr><td><em>skewX(angle)</em></td><td>The skewX value is a function that defines a 2D skew transformation along the X-axis.</td></tr><tr><td><em>skewY(angle)</em></td><td>The skewY value is a function that defines a 2D skew transformation along the Y-axis.</td></tr><tr><td><em>perspective(n)</em></td><td>The perspective value is a function that defines a perspective view for a 3D transformation.</td></tr><tr><td><em>initial</em></td><td>The initial value sets the property to its default value.</td></tr><tr><td><em>inherit</em></td><td>The inherit value inherits the property from its parent element.</td></tr></tbody></table></figure>



<h2>What is the transform scaleX value?</h2>



<p><strong>scaleX()</strong></p>



<p>The scaleX function defines a transformation that changes the size of an HTML element along the X-axis. The scaleX() function modifies the abscissa of each element point. It does this by a constant factor, though that’s not the case if the scale factor equals 1. Unlike some of the other CSS functions highlighted below, this one isn’t isotropic, and the angles are also not conserved. But note that scaleX (-1) defines an axial symmetry.</p>



<p class="note">The CSS transform scaleX is expressed as <code>transform: scaleX(number);</code> with the number being replaced with an actual number like <code>scaleX(0.2)</code>.</p>



<p>Below, we show an example where we use scaleX to scale an element on the x-axis.</p>



<p><strong>HTML</strong></p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;div&gt;
  &lt;p&gt;Normal Element&lt;/p&gt;
&lt;/div&gt;
&lt;div class="scaled"&gt;
  &lt;p&gt;Scaled Element&lt;/p&gt;
&lt;/div&gt;</code></pre>



<p></p>



<p><strong>CSS</strong></p>



<pre class="wp-block-code"><code lang="css" class="language-css">body {
  background: gray;
  color: white;
}

div {
  width: 120px;
  height: 120px;
  background-color: black;
  display: inline-block;
}

.scaled {
  transform: scaleX(0.6);
  background-color: red;
}

p  {
  font-family: cambria;
}</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="343" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleX-function.png?resize=1024%2C343&#038;ssl=1" alt="What is the transform scaleX function" class="wp-image-8108" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleX-function.png?resize=1024%2C343&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleX-function.png?resize=300%2C101&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleX-function.png?resize=768%2C258&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleX-function.png?resize=1536%2C515&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleX-function.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>What is the transform scaleX function</figcaption></figure>



<p>Click on me to <a href="https://codepen.io/tyler-chipman/details/wvrVaJB">edit the code on codepen.io.</a></p>



<h2>What is the transform scaleY value?</h2>



<p><strong>scaleY()</strong></p>



<p>The scaleY function helps define a transformation that resizes an HTML element along the y-axis. In the real sense, it alters the lines of each HTML element by a fixed factor. But the exception, however, is when the scale factor is 1. The function is the identity transform. Note that the scaling isn&#8217;t isotropic, and the angles of each HTML element aren&#8217;t conserved. The syntax for this is scaleY(s).</p>



<p class="note">The CSS transform scaleY is expressed as <code>transform: scaleY(number);</code> with the number being replaced with an actual number like <code>scaleY(1.9)</code>.</p>



<p>Below, we show an example where we use scaleY to scale an element on the y-axis.</p>



<p><strong>HTML</strong></p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;div&gt;
  &lt;p&gt;Normal&lt;/p&gt;
&lt;/div&gt;
&lt;div class="scaled"&gt;
  &lt;p&gt;Scaled HTML Element&lt;/p&gt;
&lt;/div&gt;</code></pre>



<p></p>



<p><strong>CSS</strong></p>



<pre class="wp-block-code"><code lang="css" class="language-css">body {
  background: gray;
}

div {
  width: 80px;
  height: 80px;
  background-color: red;
  color: white;
}

.scaled {
  transform: scaleY(0.6);
  background-color: blue;
  padding-bottom: 40px;
}

p{
  padding-top: 30px;
  margin-left: 10px;
}</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="344" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleY-function.png?resize=1024%2C344&#038;ssl=1" alt="What is the transform scaleY function" class="wp-image-8109" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleY-function.png?resize=1024%2C344&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleY-function.png?resize=300%2C101&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleY-function.png?resize=768%2C258&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleY-function.png?resize=1536%2C516&amp;ssl=1 1536w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleY-function.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>What is the transform scaleY function</figcaption></figure>



<p></p>



<p>Click on me to <a href="https://codepen.io/tyler-chipman/pen/MWENwQo">edit the code on codepen.io.</a></p>



<h2>What is the transform scaleZ value?</h2>



<p><strong>scaleZ()</strong></p>



<p>The scaleZ function defines a transformation that resizes any element on the Z-axis. It modifies the z-coordinate of each HTML element point by a fixed factor. But the exception is when the scale factor is 1; in this case, the function is the identity transform. But here&#8217;s the catch – the scale isn&#8217;t isotropic. Also, the angles of each element aren&#8217;t conserved. But note, scaleZ(sz) is same as scale3d(1, 1, sz).</p>



<p class="note">The CSS transform scaleZ is expressed as <code>transform: scaleZ(number);</code> with the number being replaced with an actual number like <code>scaleZ(0.75)</code>.</p>



<p>Below, we show an example where we use scaleZ to scale an element on the z-axis.</p>



<p><strong>HTML</strong></p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;div&gt;
  &lt;p&gt;Normal&lt;/p&gt;
&lt;/div&gt;
&lt;div class="perspective"&gt;
  &lt;p&gt;Translated Element&lt;/p&gt;
&lt;/div&gt;
&lt;div class="scaled-translated"&gt;
  &lt;p&gt;Scaled Element&lt;/p&gt;
&lt;/div&gt;</code></pre>



<p></p>



<p><strong>CSS</strong></p>



<pre class="wp-block-code"><code lang="css" class="language-css">div {
  width: 120px;
  height: 120px;
  background-color: blue;
  border: 1px solid black; 
  display: inline-block;
  margin-left: 70px;
}

.perspective {
  /* The line includes a perspective to create a 3D space effect*/
  transform: perspective(200px) translateZ(-150px);
  background-color: black;
}

.scaled-translated {
  /* The code includes a perspective to create a 3D space effec*/
  transform: perspective(300px) scaleZ(3) translateZ(-150px);
  background-color: red;
}

p {
  color: white;
  border-radius: 50%;
  text-align: center;
  padding-top: 50px; 
  margin: auto;
}</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="342" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleZ-function.png?resize=1024%2C342&#038;ssl=1" alt="What is the transform scaleZ function" class="wp-image-8111" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleZ-function.png?resize=1024%2C342&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleZ-function.png?resize=300%2C100&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleZ-function.png?resize=768%2C257&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleZ-function.png?resize=1536%2C514&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scaleZ-function.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>What is the transform scaleZ function</figcaption></figure>



<p>Click on me to <a href="https://codepen.io/tyler-chipman/details/MWENwVo">edit the code on codepen.io.</a></p>



<h2>What is the transform scale3d value?</h2>



<p><strong>scale3d()</strong></p>



<p>The scale3d function defines a transformation that resizes an HTML element in 3D space (just as the name suggests). Thanks to the amount of scaling defined by a vector, it can be resized into different dimensions at different scales. Hence, this CSS function’s result is a <code>&lt;transform-function&gt;</code> datatype.</p>



<p class="note">The CSS transform scale3d is expressed as: <code>transform: scale3d(number, number, number);</code> with the numbers being replaced with actual numbers like <code>scale3d(0.2, 2, 0.5)</code>.</p>



<p>Below, we show an example where we use scale3d to scale an element on the x-axis, y-axis, and z-axis.</p>



<p><strong>HTML</strong></p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;div&gt;
  &lt;p&gt;Unaltered Div&lt;/p&gt;
&lt;/div&gt;
&lt;div class="scaled"&gt;
  &lt;p&gt;A Scaled Div&lt;/p&gt;
&lt;/div&gt;</code></pre>



<p></p>



<p><strong>CSS</strong></p>



<pre class="wp-block-code"><code lang="css" class="language-css">body {
  background: gray;
  color: white;
}

div {
  width: 120px;
  height: 120px;
  background-color: red;
  font-family: Cambria;
  display: inline-block;
}

.scaled {
  transform: perspective(500px) scale3d(2, 0.7, 0.2) translateZ(100px);
  transform-origin: left;
  background-color: black;
}</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="342" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scale3d-function.png?resize=1024%2C342&#038;ssl=1" alt="What is the transform scale3d function" class="wp-image-8114" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scale3d-function.png?resize=1024%2C342&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scale3d-function.png?resize=300%2C100&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scale3d-function.png?resize=768%2C257&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scale3d-function.png?resize=1536%2C514&amp;ssl=1 1536w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/What-is-the-transform-scale3d-function.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>What is the transform scale3d function</figcaption></figure>



<p>Click on me to <a href="https://codepen.io/tyler-chipman/details/xxXvGzJ">edit the code on codepen.io.</a></p>



<h2>Conclusion</h2>



<p>The previous scale tutorial only highlighted the&nbsp;<a target="_blank" href="https://appcode.app/explaining-the-scale-property-in-css" rel="noreferrer noopener">CSS scale property and its values and functionalities</a>. Keep in mind that the scale property is not the same as the transform property. This tutorial highlights the functions and values of the transform scale property. Don&#8217;t forget; you can always tweak the codes provided in this article. Let&#8217;s see what you come up with at the end.</p>



<p></p>



<h2>Recommended Articles</h2>



<ul><li><a href="https://appcode.app/explaining-the-scale-property-in-css/">Explaining the Scale Property in CSS</a></li><li><a href="https://appcode.app/how-to-use-css-cascading-style-sheets-to-style-html/">How To Use CSS (Cascading Style Sheets) To Style HTML</a></li><li><a href="https://appcode.app/how-to-create-css-gradient-buttons/">How To Create CSS Gradient Buttons</a></li><li><a href="https://appcode.app/awesome-keyframe-css-animation-examples-and-code/">15 Awesome Keyframe CSS Animation Examples and Code</a></li><li><a href="https://appcode.app/15-text-outline-css-examples-and-code/">15 Text Outline CSS Examples and Code</a></li><li><a href="https://appcode.app/15-css-image-slider-examples-and-code/">15 CSS Image Slider Examples and Code</a></li></ul>



<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "What is the None value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The none value means there should be no transformation."
    }
  },{
    "@type": "Question",
    "name": "What is the matrix value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The matrix value is a function that defines a 2D transformation, and it uses a matrix of six values."
    }
  },{
    "@type": "Question",
    "name": "What is the matrix3d value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The matrix3d value is a function that defines a 3D transformation of an element using a 4x4 matrix of 16 different values."
    }
  },{
    "@type": "Question",
    "name": "What is the translate value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The translate value is a function that defines a 2D translation."
    }
  },{
    "@type": "Question",
    "name": "What is the translate3d value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The translate3d value is a function that defines a 3D translation."
    }
  },{
    "@type": "Question",
    "name": "What is the translateX value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The translateX value is a function that defines an element's translation, and it uses the value for the X-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the translateY value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The translateY value is a function that defines a translation of an element, and it uses only the value for the Y-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the translateZ value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The translateX value is a function that defines a 3D translation of an element but only uses the value for the Z-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the scale value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The scale value is a function that defines a 2D scale transformation."
    }
  },{
    "@type": "Question",
    "name": "What is the scale3d value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The scale3d value is a function that defines a 3D scale transformation."
    }
  },{
    "@type": "Question",
    "name": "What is the scaleX value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The scaleX value is a function that defines a scale transformation whose values are for the X-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the scaleY value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The scaleY value is a function that defines a scale transformation whose values are for the Y-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the scaleZ value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The scaleX value is a function that defines a 3D scale transformation by giving a value for the Z-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the rotate value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The rotate value is a function that defines a 2D rotation. The angle is stated in the parameter."
    }
  },{
    "@type": "Question",
    "name": "What is the rotate3d value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The rotate3d value is a function that defines a 3D rotation."
    }
  },{
    "@type": "Question",
    "name": "What is the rotateX value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The rotateX value is a function that defines a 3D rotation along the element’s X-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the rotateY value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The rotateY value is a function that defines a 3D rotation along the element’s Y-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the rotateZ value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The rotateX value is a function that defines a 3D rotation along the Y-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the skew value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The skew value is a function that defines a 2D skew transformation along the X-axis and Y-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the skewX value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The skewX value is a function that defines a 2D skew transformation along the X-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the skewY value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The skewY value is a function that defines a 2D skew transformation along the Y-axis."
    }
  },{
    "@type": "Question",
    "name": "What is the perspective value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The perspective value is a function that defines a perspective view for a 3D transformation."
    }
  },{
    "@type": "Question",
    "name": "What is the initial value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The initial value sets the property to its default value."
    }
  },{
    "@type": "Question",
    "name": "What is the inherit value for the CSS transform property?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The inherit value inherits the property from its parent element."
    }
  }]
}
</script>
<p>The post <a rel="nofollow" href="https://appcode.app/the-awesome-css-transform-property-and-scale-function/">The Awesome CSS Transform Property and Scale Function</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7905</post-id>	</item>
		<item>
		<title>How To Code a Fun Basic Web Page</title>
		<link>https://appcode.app/how-to-code-a-fun-basic-web-page/</link>
		
		<dc:creator><![CDATA[Our Own Tribe]]></dc:creator>
		<pubDate>Wed, 19 Jan 2022 22:49:08 +0000</pubDate>
				<category><![CDATA[HTML]]></category>
		<guid isPermaLink="false">https://appcode.app/?p=7908</guid>

					<description><![CDATA[<p>This tutorial guides you through the steps to create a basic webpage. We include examples of images, links, HTML elements, validation, and more. What is HTML? HTML, or HyperText Markup Language, is the standard markup language for texts intended to be viewed on a web browser. When working with HTML, we make web pages, and we use a web browser to read and process the HTML content. To develop a well-organized website, we’ll need to ensure that all HTML files we produce are saved in the same folder. It may appear to be a challenge. Perhaps you believe it is…</p>
<p>The post <a rel="nofollow" href="https://appcode.app/how-to-code-a-fun-basic-web-page/">How To Code a Fun Basic Web Page</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This tutorial guides you through the steps to create a basic webpage. We include examples of images, links, HTML elements, validation, and more.</p>



<h2>What is HTML?</h2>



<p>HTML, or HyperText Markup Language, is the standard markup language for texts intended to be viewed on a web browser. When working with HTML, we make web pages, and we use a web browser to read and process the HTML content. To develop a well-organized website, we’ll need to ensure that all HTML files we produce are saved in the same folder.</p>



<p>It may appear to be a challenge. Perhaps you believe it is too difficult for you to learn. But the focus of the article is to demonstrate how simple HTML may be. Let&#8217;s get started! This guide will teach you everything you need to know about basic HTML.</p>



<h2>How easy is HTML?</h2>



<p>HTML is quite simple to learn; believe it or not, you can be operational in less than a day. Simply put, there&#8217;s not much to it. Realistically, it is a simple language to learn, and it isn&#8217;t going away anytime soon. If you&#8217;re not used to working with computers or the internet, you can find it difficult. However, if you&#8217;re comfortable with basic word processing, copying and pasting, and other similar tasks, you&#8217;ll see HTML to be reasonably simple.</p>



<h2>Getting the required code editor</h2>



<p>You need a text editor, code editor, or an IDE (<strong>integrated development environment</strong>) installed on your operating system to create your HTML web page. The editor is where you write the code. Here are several examples of programs you can start writing code below:</p>



<h5>Codeanywhere Cloud IDE</h5>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Write-Code-With-Codeanywhere-Cloud-IDE.png?resize=1024%2C506&#038;ssl=1" alt="Write Code With Codeanywhere Cloud IDE" class="wp-image-7921" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Write-Code-With-Codeanywhere-Cloud-IDE.png?resize=1024%2C506&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Write-Code-With-Codeanywhere-Cloud-IDE.png?resize=300%2C148&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Write-Code-With-Codeanywhere-Cloud-IDE.png?resize=768%2C379&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Write-Code-With-Codeanywhere-Cloud-IDE.png?resize=1536%2C759&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Write-Code-With-Codeanywhere-Cloud-IDE.png?w=1899&amp;ssl=1 1899w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Write Code With Codeanywhere Cloud IDE</figcaption></figure>



<h5>Notepad++ Code Editor</h5>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/You-Can-Write-Code-With-Notepad.png?resize=1024%2C506&#038;ssl=1" alt="You Can Write Code With Notepad++" class="wp-image-7922" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/You-Can-Write-Code-With-Notepad.png?resize=1024%2C506&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/You-Can-Write-Code-With-Notepad.png?resize=300%2C148&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/You-Can-Write-Code-With-Notepad.png?resize=768%2C379&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/You-Can-Write-Code-With-Notepad.png?resize=1536%2C759&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/You-Can-Write-Code-With-Notepad.png?w=1899&amp;ssl=1 1899w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>You Can Write Code With Notepad++</figcaption></figure>



<h5>Brackets Code Editor</h5>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Brackets-Is-a-Modern-Code-Editor-1024x506.png?resize=1024%2C506&#038;ssl=1" alt="Brackets Is a Modern Code Editor" class="wp-image-7923" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Brackets-Is-a-Modern-Code-Editor.png?resize=1024%2C506&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Brackets-Is-a-Modern-Code-Editor.png?resize=300%2C148&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Brackets-Is-a-Modern-Code-Editor.png?resize=768%2C380&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Brackets-Is-a-Modern-Code-Editor.png?resize=1536%2C759&amp;ssl=1 1536w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Brackets-Is-a-Modern-Code-Editor.png?w=1898&amp;ssl=1 1898w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Brackets Is a Modern Code Editor</figcaption></figure>



<h2>What are HTML tags?</h2>



<p>An HTML tag is a group of characters that constitute the beginning and end of an HTML element. Tags, which are at the heart of HTML, give instructions or blueprints to create pieces that make up the structure of all web pages on the internet.</p>



<p>All HTML documents consist of elements that are built up from contents and tags, and to create the most basic HTML document, we first need an HTML tag at the start of the document which looks something like this <code>&lt;html&gt;</code> and another tag at the end of the document which looks something like this <code>&lt;/html&gt;</code>.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;html&gt;
&lt;/html&gt;</code></pre>



<p></p>



<p>As you can see, the tags all start and end with an angle bracket <code>&lt;</code>, and usually but not always, tags work in pairs, and it’s often the case that the opening tag is the same as the closing tag but with a forward slash sign <code>/</code> after the opening angle bracket.</p>



<p>That being said, let’s put some content in between the <code>&lt;HTML&gt;</code> tags.</p>



<h2>How to start coding?</h2>



<p>On the following line, after the opening tag <code>&lt;HTML&gt;</code>, type a simple sentence like: &#8220;Welcome, this is a basic web page.&#8221;.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;html&gt;
Welcome, this is a basic web page.
&lt;/html&gt;</code></pre>



<p></p>



<p>Save the file name as &#8220;index.html&#8221;. Make sure you put the HTML at the end; if not, your file will save as a text document by default.</p>



<p>After saving the file as HTML, double click the folder in the location you saved, and you’ll see that it’ll open up your browser. It should say, “Welcome, this is a basic webpage.”, in your browser.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="541" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Welcome-this-is-a-basic-webpage-tutorial-1.png?resize=1024%2C541&#038;ssl=1" alt="Welcome, this is a basic webpage tutorial" class="wp-image-7936" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Welcome-this-is-a-basic-webpage-tutorial-1.png?resize=1024%2C541&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Welcome-this-is-a-basic-webpage-tutorial-1.png?resize=300%2C159&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Welcome-this-is-a-basic-webpage-tutorial-1.png?resize=768%2C406&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Welcome-this-is-a-basic-webpage-tutorial-1.png?resize=1536%2C812&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Welcome-this-is-a-basic-webpage-tutorial-1.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Welcome, this is a basic webpage tutorial</figcaption></figure>



<p class="note"><strong>Note:</strong>&nbsp;You can scale the webpage by holding down the CTRL key with a + sign to make it bigger. On the other hand, to make the browser page smaller, use CTRL with the &#8211; symbol.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="541" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Using-CTRL-and-To-Enlarge-a-Web-Page.png?resize=1024%2C541&#038;ssl=1" alt="Using CTRL and + To Enlarge a Web Page" class="wp-image-7938" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Using-CTRL-and-To-Enlarge-a-Web-Page.png?resize=1024%2C541&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Using-CTRL-and-To-Enlarge-a-Web-Page.png?resize=300%2C158&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Using-CTRL-and-To-Enlarge-a-Web-Page.png?resize=768%2C406&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Using-CTRL-and-To-Enlarge-a-Web-Page.png?resize=1536%2C811&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Using-CTRL-and-To-Enlarge-a-Web-Page.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Using CTRL and + To Enlarge a Web Page</figcaption></figure>



<p>Add some text after “Welcome. this is a basic web page” like “This is a second paragraph” then save the HTML file and refresh the browser.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="505" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Page-With-Two-Sentences.png?resize=1024%2C505&#038;ssl=1" alt="Creating a Page With Two Sentences" class="wp-image-7940" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Page-With-Two-Sentences.png?resize=1024%2C505&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Page-With-Two-Sentences.png?resize=300%2C148&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Page-With-Two-Sentences.png?resize=768%2C378&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Page-With-Two-Sentences.png?resize=1536%2C757&amp;ssl=1 1536w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Page-With-Two-Sentences.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Creating a Page With Two Sentences</figcaption></figure>



<p>When you go back to your browser, you&#8217;ll notice that your second paragraph isn&#8217;t a pretty second paragraph. The first and second sentences will appear to be together. The reason for them appearing together is, with HTML, you won&#8217;t get a line break unless you indicate that the two sentences are different paragraphs.</p>



<p>So go back to the editor and put a break tag or paragraph tag there. The code for a break tag is <code>&lt;br></code> is placed at the end of the sentence.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">Sentence One&lt;br&gt;
Sentence Two
</code></pre>



<p></p>



<p>On the other hand, the code for a paragraph tag starts with <code>&lt;p></code>. Then you use a <code>&lt;\p></code> at the end of the paragraph.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;p&gt;Sentence One&lt;/p&gt;
&lt;p&gt;Sentence Two&lt;/p&gt;</code></pre>



<p></p>



<p>The break tag takes the following sentence to the next line, while a paragraph tag gives the following sentence a whole paragraph. For the sake of this tutorial, we’ll use the paragraph tag.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;html&gt;
  &lt;p&gt;Welcome, this is a basic webpage.&lt;/p&gt;
  &lt;p&gt;This is a second paragraph&lt;/p&gt;
&lt;/html&gt;</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="408" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Two-Paragraphs.png?resize=1024%2C408&#038;ssl=1" alt="Creating a Web Page With Two Paragraphs" class="wp-image-7943" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Two-Paragraphs.png?resize=1024%2C408&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Two-Paragraphs.png?resize=300%2C120&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Two-Paragraphs.png?resize=768%2C306&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Two-Paragraphs.png?resize=1536%2C612&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Two-Paragraphs.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Creating a Web Page With Two Paragraphs</figcaption></figure>



<h2>How to add other HTML elements?</h2>



<p>Moving on, you can add more HTML elements to your web page. The next thing you will be learning is how to make bold, italics, or underlined texts using HTML elements.</p>



<p>The tag for bold is <code>&lt;b&gt;</code> to open it and <code>&lt;\b&gt;</code> to close it, the tag for italics is <code>&lt;i&gt;</code> to open it and <code>&lt;\i&gt;</code> to close it, and the tag for underline is <code>&lt;u&gt;</code> to open it and <code>&lt;\u&gt;</code> to close it.</p>



<p>To use all of these elements we create write &#8220;We are including various text formats with <code>&lt;b&gt;bold&lt;/b&gt;</code>, <code>&lt;I&gt;italics&lt;/i&gt;</code> and <code>&lt;u&gt;underlined&lt;/u&gt;</code> elements.&#8221;. Save and refresh.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;p&gt;We are including various text formats with &lt;b&gt;bold&lt;/b&gt;, &lt;I&gt;italics&lt;/i&gt; and &lt;u&gt;underlined&lt;/u&gt; elements.&lt;/p&gt;</code></pre>



<p></p>



<p>What the code above looks like on a web page.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="471" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Bold-Underline-and-Italic-Elements-1024x471.png?resize=1024%2C471&#038;ssl=1" alt="Creating a Web Page With Bold, Underline, and Italic Elements" class="wp-image-7953" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Bold-Underline-and-Italic-Elements.png?resize=1024%2C471&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Bold-Underline-and-Italic-Elements.png?resize=300%2C138&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Bold-Underline-and-Italic-Elements.png?resize=768%2C353&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Bold-Underline-and-Italic-Elements.png?resize=1536%2C706&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Bold-Underline-and-Italic-Elements.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Creating a Web Page With Bold, Underline, and Italic Elements</figcaption></figure>



<p>Next, we’re going to add a heading. You can add your heading where ever you want to. Although Ideally, headings are usually on the top of a document, there are no structure rules, especially when it comes to coding.</p>



<p>To add a heading to your HTML, you need to understand the six headings types, with H1 being the most significant and H6 being the smallest. Your heading should look something like this &#8220;<code>&lt;h1></code>This is a Heading<code>&lt;/h1></code>”.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;h1&gt;This is a Heading&lt;/h1&gt;</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="470" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-a-Heading-to-a-Web-Page.png?resize=1024%2C470&#038;ssl=1" alt="Adding a Heading to a Web Page" class="wp-image-7960" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-a-Heading-to-a-Web-Page.png?resize=1024%2C470&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-a-Heading-to-a-Web-Page.png?resize=300%2C138&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-a-Heading-to-a-Web-Page.png?resize=768%2C353&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-a-Heading-to-a-Web-Page.png?resize=1536%2C706&amp;ssl=1 1536w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-a-Heading-to-a-Web-Page.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Adding a Heading to a Web Page</figcaption></figure>



<p>At this point, our code should look like this below:</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;html&gt;
  &lt;h1&gt;This is a Heading&lt;/h1&gt;
  &lt;p&gt;Welcome, this is a basic webpage.&lt;/p&gt;
  &lt;p&gt;This is a second paragraph&lt;/p&gt;
  &lt;p&gt;We are including various text formats with &lt;b&gt;bold&lt;/b&gt;, &lt;I&gt;italics&lt;/i&gt; and     &lt;u&gt;underlined&lt;/u&gt; elements.&lt;/p&gt;
&lt;/html&gt;</code></pre>



<h2>List Of 13 Basic HTML Tags</h2>



<p>Here are 13 of the most basic HTML tags and their meanings:</p>



<figure class="wp-block-table"><table><tbody><tr><td>&lt;html&gt;</td><td>The html element contains all other elements. This element is used only once. Addionally, you place it at the beginning and the end of the web page file.</td></tr><tr><td>&lt;a&gt;</td><td>The a element adds a hyperlink to another location.</td></tr><tr><td>&lt;b&gt;</td><td>The b element converts text inside the element to bold. Similar to the strong element.</td></tr><tr><td>&lt;strong&gt;</td><td>The strong element indicates its contents are significant, serious, or time-sensitive. Similar to bold element.</td></tr><tr><td>&lt;body&gt;</td><td>The body element contains most of the structural elements of an HTML page.</td></tr><tr><td>&lt;br&gt;</td><td>The br element is for adding line breaks in text or between elements. </td></tr><tr><td>&lt;div&gt; </td><td>The div element creates a section or division between content in a web page.</td></tr><tr><td>&lt;h1&gt;</td><td>The heading element is for creating headings throughout your webpage. There are a total of six heading elements starting with h1, h2, h3, h4, h5, and ending with h6. The heading element is different from the header element. </td></tr><tr><td>&lt;i&gt;</td><td>The i element makes the text inside the element italic. </td></tr><tr><td>&lt;img&gt;</td><td>The img element adds images to a webpage. You can specify the image location using the src attribute. </td></tr><tr><td>&lt;ol&gt;</td><td>The ol element is for creating ordered lists. The ordered lists are usually defined with a number one. &#8220;1.&#8221;</td></tr><tr><td>&lt;ul&gt;</td><td>The ul element is for creating unordered lists. The unordered lists are usually defined with a circle or a dot.</td></tr><tr><td>&lt;p&gt;</td><td>The p element is used for creating a paragraph. </td></tr><tr><td>&lt;span&gt;</td><td>The span element is an inline element used for styling chunks of text. It does not change the appearance without adding CSS.</td></tr></tbody></table></figure>



<p>Although these HTML tags may confuse you as a beginner, before the end of this tutorial, you will understand more of the elements better.</p>



<h2>Container Vs Non-Container Tags</h2>



<p>Container tags are the tags that have to start and closing tags like the paragraph tag <code>&lt;p&gt;Content&lt;/p&gt;</code> while non-container tags are tags that don’t have any closing tag but have start tags like <code>&lt;/br&gt;</code> and <code>&lt;img&gt;</code>.</p>



<h2>How to make HTML compliant?</h2>



<p>A compliant web page indicates that a web site&#8217;s HTML and CSS code complies with the World Wide Web Consortium&#8217;s standards (W3C for short). Compliance is substantial because it will help you design a website that can be read and accessed in a broader range of browsers, platforms, and devices. Addionally compliant web pages render correctly in most browsers and devices.</p>



<p>As we’ve seen, the HTML code we’ve written works perfectly well, but for compliance with widely accepted HTML standards, it should contain a bit more structure, such as the document type, head, title, and body tag, and we’ll show you exactly how to do this.</p>



<p>Firstly, all HTML documents should begin by declaring their document type to be HTML, so the browser knows the kind of content it contains.</p>



<p>To do this, we have to add a declaration tag at the very start of our document before our HTML code begins.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;h1&gt;This is a Heading&lt;/h1&gt;
  &lt;p&gt;Welcome, this is a basic webpage.&lt;/p&gt;
  &lt;p&gt;This is a second paragraph&lt;/p&gt;
  &lt;p&gt;We are including various text formats with &lt;b&gt;bold&lt;/b&gt;, &lt;I&gt;italics&lt;/i&gt; and     &lt;u&gt;underlined&lt;/u&gt; elements.&lt;/p&gt;
&lt;/html&gt;</code></pre>



<h2>How to add the head element?</h2>



<p>The <code>&lt;head&gt;</code> element represents a container for metadata, scripts, and other resources for the browser to download. To place the <code>&lt;head&gt;</code> element, we need to put it on the following line, after the document&#8217;s opening <code>&lt;html&gt;</code> tag.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;h1&gt;This is a Heading&lt;/h1&gt;
  &lt;p&gt;Welcome, this is a basic webpage.&lt;/p&gt;
  &lt;p&gt;This is a second paragraph&lt;/p&gt;
  &lt;p&gt;We are including various text formats with &lt;b&gt;bold&lt;/b&gt;, &lt;I&gt;italics&lt;/i&gt; and     &lt;u&gt;underlined&lt;/u&gt; elements.&lt;/p&gt;
&lt;/html&gt;</code></pre>



<h2>How to add the title element?</h2>



<p>Add a title element inside the head element by inputting <code>&lt;title&gt;</code> with the contents of &#8220;A basic webpage&#8221; (or whatever title you want to give it) and close the title with <code>&lt;\title&gt;</code>; after this, don&#8217;t forget to close the header on the line by inputting <code>&lt;\head&gt;</code>.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;A basic webpage&lt;/title&gt;
  &lt;/head&gt;
  &lt;h1&gt;This is a Heading&lt;/h1&gt;
  &lt;p&gt;Welcome, this is a basic webpage.&lt;/p&gt;
  &lt;p&gt;This is a second paragraph&lt;/p&gt;
  &lt;p&gt;We are including various text formats with &lt;b&gt;bold&lt;/b&gt;, &lt;I&gt;italics&lt;/i&gt; and     &lt;u&gt;underlined&lt;/u&gt; elements.&lt;/p&gt;
&lt;/html&gt;</code></pre>



<h2>How to add the body element?</h2>



<p>The next thing to do for compliance indicates that there’s a body. So after the header, add a tag for the body with <code>&lt;body&gt;</code> and right before the end of the document’s closing tag <code>&lt;\html&gt;</code> to close off the body with <code>&lt;\body&gt;</code>.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;A basic webpage&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;This is a Heading&lt;/h1&gt;
    &lt;p&gt;Welcome, this is a basic webpage.&lt;/p&gt;
    &lt;p&gt;This is a second paragraph&lt;/p&gt;
    &lt;p&gt;We are including various text formats with &lt;b&gt;bold&lt;/b&gt;, &lt;I&gt;italics&lt;/i&gt; and     &lt;u&gt;underlined&lt;/u&gt; elements.&lt;/p&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>



<h2>How to check web page compliance?</h2>



<p>If you notice, you will see that we haven&#8217;t done anything to the content of this document; we have just structured it better with additional elements. It&#8217;s straightforward to check the validation and compliance for HTML. The W3C provides an HTML markup validation <a target="_blank" href="https://validator.w3.org/" rel="noreferrer noopener">service to validate your web pages</a>. You can copy the code to validate by direct input or use a URL. </p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="503" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Validate-a-Web-Page.png?resize=1024%2C503&#038;ssl=1" alt="How To Validate a Web Page" class="wp-image-7986" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Validate-a-Web-Page.png?resize=1024%2C503&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Validate-a-Web-Page.png?resize=300%2C147&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Validate-a-Web-Page.png?resize=768%2C377&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Validate-a-Web-Page.png?resize=1536%2C754&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Validate-a-Web-Page.png?w=1900&amp;ssl=1 1900w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>How To Validate a Web Page</figcaption></figure>



<h2>What are links and hyperlinks?</h2>



<p>A link or hyperlink is just an address that defines the location of an internet resource, the same as a URL that directs you to a web page. Furthermore, hyperlinks are text URL links that may be activated with a pointing device to take you to the desired website using a hidden URL.</p>



<p>So far, our HTML is coming together pretty well. Our page lacks any form of interaction, so how do we place a link?</p>



<h2>How to add links and hyperlinks?</h2>



<p>Somewhere around the body start a new paragraph and add a <code>&lt;a&gt;</code> tag. Below is the code for the <code>&lt;a&gt;</code> tag:</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;a href="link address"&gt;the text you want to link&lt;/a&gt;</code></pre>



<p></p>



<p>For the sake of this tutorial, I am going to be using digitalocean.com as my link. When it is clicked, this link will change the current web page to the Digital Ocean Marketplace. My code for that will look something like this:</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;a href="https://marketplace.digitalocean.com/"&gt;Digital Ocean: Get a a cloud server today!&lt;/a&gt;</code></pre>



<p></p>



<p>Now we will make another paragraph and place the link within it. Down below, your web page code should look like this.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;A basic webpage&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;This is a Heading&lt;/h1&gt;
    &lt;p&gt;Welcome, this is a basic webpage.&lt;/p&gt;
    &lt;p&gt;This is a second paragraph&lt;/p&gt;
    &lt;p&gt;We are including various text formats with &lt;b&gt;bold&lt;/b&gt;, &lt;I&gt;italics&lt;/i&gt; and     &lt;u&gt;underlined&lt;/u&gt; elements.&lt;/p&gt;
    &lt;p&gt;&lt;a href="https://marketplace.digitalocean.com/"&gt;Digital Ocean: Get a a cloud server today!&lt;/a&gt;&lt;/p&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>



<p></p>



<p>If you refresh your browser after saving, you will see the new link in the third paragraph.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="450" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Hyperlinks.png?resize=1024%2C450&#038;ssl=1" alt="Creating a Web Page With Hyperlinks" class="wp-image-8002" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Hyperlinks.png?resize=1024%2C450&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Hyperlinks.png?resize=300%2C132&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Hyperlinks.png?resize=768%2C338&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Hyperlinks.png?resize=1536%2C675&amp;ssl=1 1536w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Web-Page-With-Hyperlinks.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Creating a Web Page With Hyperlinks</figcaption></figure>



<p>The browser will change the current page to the Digital Ocean Marketplace whenever the link is clicked. You should see the marketplace after the browser navigates.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="504" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Digital-Ocean-Marketplace-1-Click-Deployable-Applications.png?resize=1024%2C504&#038;ssl=1" alt="Digital Ocean Marketplace - 1 Click Deployable Applications" class="wp-image-8009" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Digital-Ocean-Marketplace-1-Click-Deployable-Applications.png?resize=1024%2C504&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Digital-Ocean-Marketplace-1-Click-Deployable-Applications.png?resize=300%2C148&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Digital-Ocean-Marketplace-1-Click-Deployable-Applications.png?resize=768%2C378&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Digital-Ocean-Marketplace-1-Click-Deployable-Applications.png?resize=1536%2C757&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Digital-Ocean-Marketplace-1-Click-Deployable-Applications.png?w=1896&amp;ssl=1 1896w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Digital Ocean Marketplace &#8211; 1 Click Deployable Applications</figcaption></figure>



<p>However, if you want to open your link in another tab, your coding will be slightly different. For links opening in another tab, we need to add the <code>target="_blank"</code> link attribute. </p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;a href="https://marketplace.digitalocean.com/" target="_blank"&gt;Digital Ocean: Get a a cloud server today!&lt;/a&gt;</code></pre>



<p></p>



<p>This attribute forces the text link to open the resource in another tab.</p>



<p></p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="564" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Hyperlink-That-Opens-a-Link-in-New-Tab.png?resize=1024%2C564&#038;ssl=1" alt="Creating a Hyperlink That Opens a Link in New Tab" class="wp-image-8011" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Hyperlink-That-Opens-a-Link-in-New-Tab.png?resize=1024%2C564&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Hyperlink-That-Opens-a-Link-in-New-Tab.png?resize=300%2C165&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Hyperlink-That-Opens-a-Link-in-New-Tab.png?resize=768%2C423&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Hyperlink-That-Opens-a-Link-in-New-Tab.png?w=1224&amp;ssl=1 1224w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Creating a Hyperlink That Opens a Link in New Tab</figcaption></figure>



<h2>How to add images to HTML?</h2>



<p>Images are usually linked to web pages rather than being physically put into them, but sometimes images can be embedded using a <em>base64</em>&nbsp;string. We will only be using the link in this tutorial. The <code>&lt;img&gt;</code> element produces a placeholder for the picture that will be loaded during page render in a browser window.</p>



<p>To add an image to your HTML, place an image tag <code>&lt;img></code> in your desired location plus an src attribute <code>src="The URL of image"</code>. We will also add a width attribute, or the image will render at its max dimensions. For a clearer picture, it should look something like this:</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;img width="number" src="https://example.com/images/untitled_design.jpg"></code></pre>



<p>Unsplash is a website that provides free images. For example, we can use a <a href="https://unsplash.com/photos/JtVyK2Sej2I">free jellyfish photo</a> with this link.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">https://images.unsplash.com/photo-1532191343016-47bf741b8b3c?ixlib=rb-1.2.1&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1074&amp;q=80</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="768" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-an-Image-to-a-Web-Page.jpg?resize=1024%2C768&#038;ssl=1" alt="Adding an Image to a Web Page" class="wp-image-8019" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-an-Image-to-a-Web-Page.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-an-Image-to-a-Web-Page.jpg?resize=300%2C225&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-an-Image-to-a-Web-Page.jpg?resize=768%2C576&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Adding-an-Image-to-a-Web-Page.jpg?w=1074&amp;ssl=1 1074w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Adding an Image to a Web Page</figcaption></figure>



<p>Below, we place the jellyfish image into our own <code>&lt;img></code> element. </p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;img width="400" src="https://images.unsplash.com/photo-1532191343016-47bf741b8b3c?ixlib=rb-1.2.1&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1074&amp;q=80"&gt;</code></pre>



<p></p>



<p>Now we need to add the image to our webpage. We need to add the <code>&lt;img></code> tag in a new paragraph to do this.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!DOCTYPE html>
&lt;html>
  &lt;head>
    &lt;title>A basic webpage&lt;/title>
  &lt;/head>
  &lt;body>
    &lt;h1>This is a Heading&lt;/h1>
    &lt;p>Welcome, this is a basic webpage.&lt;/p>
    &lt;p>This is a second paragraph&lt;/p>
    &lt;p>We are including various text formats with &lt;b>bold&lt;/b>, &lt;I>italics&lt;/i> and     &lt;u>underlined&lt;/u> elements.&lt;/p>
    &lt;p>&lt;a href="https://marketplace.digitalocean.com/">Digital Ocean: Get a a cloud server today!&lt;/a>&lt;/p>
    &lt;p>&lt;img width="400" src="https://images.unsplash.com/photo-1532191343016-47bf741b8b3c?ixlib=rb-1.2.1&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1074&amp;q=80">&lt;/p>
  &lt;/body>
&lt;/html></code></pre>



<p></p>



<p>Our new web page should look like this after updating the code.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="645" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Add-an-Image-to-a-Web-Page.png?resize=1024%2C645&#038;ssl=1" alt="How To Add an Image to a Web Page" class="wp-image-8029" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Add-an-Image-to-a-Web-Page.png?resize=1024%2C645&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Add-an-Image-to-a-Web-Page.png?resize=300%2C189&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Add-an-Image-to-a-Web-Page.png?resize=768%2C484&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Add-an-Image-to-a-Web-Page.png?w=1330&amp;ssl=1 1330w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>How To Add an Image to a Web Page</figcaption></figure>



<h2>Conclusion</h2>



<p>If you&#8217;ve followed all of the steps in this post, you should end up with a basic webpage.</p>



<h2>Recommended Articles</h2>



<ul><li><a href="https://appcode.app/javascript-fundamentals-a-dinosaurs-cheat-sheet/">JavaScript Fundamentals – A Dinosaurs Cheat Sheet</a></li><li><a href="https://appcode.app/what-are-more-examples-of-html-elements-and-structure/">What Are More Examples of HTML Elements and Structure</a></li><li><a href="https://appcode.app/how-to-create-a-valid-html-web-page-with-elements/">How To Create a Valid HTML Web Page With Elements</a></li><li><a href="https://appcode.app/how-to-create-your-first-html-elements-with-examples/">How To Create Your First HTML Elements With Examples</a></li><li><a href="https://appcode.app/how-to-use-css-cascading-style-sheets-to-style-html/">How To Use CSS (Cascading Style Sheets) To Style HTML</a></li></ul>
<p>The post <a rel="nofollow" href="https://appcode.app/how-to-code-a-fun-basic-web-page/">How To Code a Fun Basic Web Page</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7908</post-id>	</item>
		<item>
		<title>Introduction to the Fancy JavaScript Request</title>
		<link>https://appcode.app/introduction-to-the-fancy-javascript-request/</link>
		
		<dc:creator><![CDATA[Oluwatosin Saibu]]></dc:creator>
		<pubDate>Mon, 17 Jan 2022 00:55:39 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">https://appcode.app/?p=7822</guid>

					<description><![CDATA[<p>An introduction to making requests with JavaScript using different methods, includes references about HTTP methods, requests, headers, and more. The JavaScript request functions allow clients to exchange data from all server-side and client-side resources. The request works by transferring data (sends and receives) from the client-side to the server-side by making what&#8217;s known as HTTP requests. These HyperText Transfer Protocol (HTTP) requests work with the fetch and other functions to communicate with the server. Interestingly, the internet consists of different servers. These servers are a network of interconnected computers, where the browser fetches most website files from. Surfing the internet…</p>
<p>The post <a rel="nofollow" href="https://appcode.app/introduction-to-the-fancy-javascript-request/">Introduction to the Fancy JavaScript Request</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>An introduction to making requests with JavaScript using different methods, includes references about HTTP methods, requests, headers, and more.</p>



<p>The JavaScript request functions allow clients to exchange data from all server-side and client-side resources. The request works by transferring data (sends and receives) from the client-side to the server-side by making what&#8217;s known as HTTP requests. These HyperText Transfer Protocol (HTTP) requests work with the fetch and other functions to communicate with the server.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="550" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Introduction-to-the-Fancy-JavaScript-Request.png?resize=1024%2C550&#038;ssl=1" alt="Introduction to the Fancy JavaScript Request" class="wp-image-7866" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Introduction-to-the-Fancy-JavaScript-Request.png?resize=1024%2C550&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Introduction-to-the-Fancy-JavaScript-Request.png?resize=300%2C161&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Introduction-to-the-Fancy-JavaScript-Request.png?resize=768%2C413&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Introduction-to-the-Fancy-JavaScript-Request.png?w=1165&amp;ssl=1 1165w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Introduction to the Fancy JavaScript Request</figcaption></figure>



<p>Interestingly, the internet consists of different servers. These servers are a network of interconnected computers, where the browser fetches most website files from. Surfing the internet and navigating through the various pages is the same as users requesting the web browser to fetch the information from the servers. In this short but detailed reference, however, we shall take a closer look at everything you need to instruct web pages to fetch files using different JavaScript request functions.</p>



<ol><li><a href="#two">Fetching&nbsp;With&nbsp;the&nbsp;Fetch&nbsp;Function</a></li><li><a href="#three">Using&nbsp;the&nbsp;XMLHttpRequest&nbsp;Function</a></li></ol>



<h2>HTTP Request</h2>



<p>Clients make HTTP Requests to specific hosts. These named hosts are located on servers, and the goal is to communicate with those hosts to access the resources stored on the servers. It is important to note that for a user to make the request, they have to use the components of a request. These components include a request line, URL (also referred to as Uniform Resource Locator), a method, a series of HTTP header fields, and a message body.</p>



<p>An HTTP request may also contain an entity. The entity consists of entity-headers and an optional entity-body, which an entity-body is only present if there is a message-body. The entity-body comes from the format and encoding of the message-body and is represented in the entity-headers. On the other hand, entity-headers describe the message-body or the resource if no body is present. Depending on the request, some of the entity-headers below are required or are optional.</p>



<p>Here are example of enity-headers fields:</p>



<ul><li>Allow</li><li>Content-Encoding</li><li>Content-Language</li><li>Content-Length</li><li>Content-Location</li><li>Content-MD5</li><li>Content-Range</li><li>Content-Type</li><li>Expires</li><li>Last-Modified</li></ul>



<p></p>



<h2>What is a Request-Line?</h2>



<p>The request line, just as we&#8217;ve highlighted below, starts with a method token and is followed by the Request-URL, coupled with the protocol version. It ends with CRLF. All of these elements are separated by space SP characters.</p>



<p>What does a request line look like?</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">Request-Line = Method SP Request-URI SP HTTP-Version CRLF</code></pre>



<p>The request line looks something like this with real data below. This example fetches the contents of example.com&#8217;s home page.</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">GET https://example.com HTTP/1.1</code></pre>



<p></p>



<h2>Request-URI</h2>



<p>The (the Request-URI) is a Uniform Resource Identifier, and it identifies the current resource on which to apply the selected request. Highlighted below are the most commonly used forms developers use to specify a URI.</p>



<ul><li>“*”</li><li>Abs_path</li><li>absoluteURI</li><li>authority</li></ul>



<p>The Request-URI structure is illustrated below:</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">Request-URI = "*" | absoluteURI | abs_path | authority</code></pre>



<p></p>



<p>Using real data again we can construct a simple Request-URI below which contains a scheme name, authority, path, query, and fragment:</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">https://example.com:80/search?s=ufo#real</code></pre>



<p></p>



<h2>The HTTP Methods</h2>



<p>The method token indicates which of the HTTP methods will be performed on the resource highlighted by the Request-URI. But remember, they are case-sensitive. Thus, we believe it would be best always to mention methods in uppercase. In the table below, we&#8217;ve highlighted the supported methods in HTTP/1.1.</p>



<figure class="wp-block-table"><table><tbody><tr><td>METHOD</td><td>DESCRIPTION</td></tr><tr><td>HEAD</td><td>The Head method transfers the status line and the header section, and it does nothing else aside from these two purposes stated earlier.</td></tr><tr><td>GET</td><td>Same as Head, though it is used to retrieve information from the specific server. It uses a given URL (Uniform Resource Locator). Requests with this method (Get) should and will only retrieve data; it has no other effect on the data sourced.</td></tr><tr><td>PUT</td><td>The PUT method replaces all the representations of the fetched resource, coupled with the uploaded content.</td></tr><tr><td>POST</td><td>This request is used to transfer data to the server. A perfect example of this is file upload or customer order information. These are done using HTML forms.</td></tr><tr><td>TRACE</td><td>The trace method helps to perform a message loop back test coupled with the path to the target data resource.</td></tr><tr><td>CONNECT</td><td>Connect establishes a tunnel to the specific server, which a given URI will identify.</td></tr><tr><td>DELETE</td><td>Delete removes the representations of the target resource, which URI gives.</td></tr><tr><td>OPTIONS</td><td>The Option is a method that describes the current communication options for the target resource.</td></tr></tbody></table></figure>



<h2>Building a Simple Page</h2>



<p>First, before we attempt to create a JavaScript request, we will need to create a simple web page to load the results of the request we will be making. The examples below will walk you through creating a simple web page that retrieves the user&#8217;s IP address. We will be demonstrating two JavaScript functions that can achieve a request.</p>



<p><strong>HTML Code</strong></p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;div class="box"&gt;
  &lt;title&gt;Display IP Address&lt;/title&gt;
  &lt;h2 id="center"&gt;Appcode JavaScript Tutorial&lt;/h2&gt;
  &lt;h3 id="center" class="down"&gt; Getting the JavaScript request with the fetch method&lt;/h3&gt;
  &lt;p class="top"&gt;( Here's the IP Address of your machine: )&lt;/p&gt;
  &lt;h1 id=ipAddress&gt;&lt;/h1&gt;
&lt;/div&gt;</code></pre>



<p><strong>CSS Code</strong></p>



<pre class="wp-block-code"><code lang="css" class="language-css">body, html {
  background-color:#add8e6;
  font-family: Arial;
  margin: 0;
  height: 100%;
}

h1 {
  font-family: sans-serif;
  text-align: center;
  padding-top: 40px;
  font-size: 40px;
}

p {
  font-family: sans-serif;
  color: #000000;
  text-align: center;
}

.center {
  align: center;
}

#center {
  text-align: center;
}

.down {
  margin-bottom: 50px;
}

.top {
  margin-bottom: -30px;
}</code></pre>



<h2 id="two">Fetching&nbsp;With&nbsp;the&nbsp;Fetch&nbsp;Function</h2>



<p>The syntax of the JavaScript request function will look something like this:</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">var request = new Request(sample_url: String, [init: Object]);</code></pre>



<p></p>



<p><strong>JavaScript Code</strong></p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">// You can use the var request variable above or provide a url in the fetch function 
// fetch(request) or fetch("url")
fetch("https://ipinfo.io/json")
  .then(function (response) {
    return response.json();
  })
  .then(function (ipJson) {
    document.querySelector("#ipAddress").innerHTML = ipJson.ip;
  })
  .catch(function (error) {
    console.log("Error: " + error);
  });</code></pre>



<p></p>



<p>Here’s what the result would look like using the fetch() function:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="301" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/JavaScript-Request-Using-The-Fetch-Function.png?resize=1024%2C301&#038;ssl=1" alt="JavaScript Request Using The Fetch Function" class="wp-image-7900" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/JavaScript-Request-Using-The-Fetch-Function.png?resize=1024%2C301&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/JavaScript-Request-Using-The-Fetch-Function.png?resize=300%2C88&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/JavaScript-Request-Using-The-Fetch-Function.png?resize=768%2C226&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/JavaScript-Request-Using-The-Fetch-Function.png?resize=1536%2C452&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/JavaScript-Request-Using-The-Fetch-Function.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>JavaScript Request Using The Fetch Function</figcaption></figure>



<p>You can play around with the <a href="https://codepen.io/prodigy1010/pen/eYGPayd">code which is found on codepen.io</a></p>



<h2 id="three">Using&nbsp;the&nbsp;XMLHttpRequest&nbsp;Function</h2>



<p>Alternatively, you may use the XMLHttpRequest function instead of the fetch function. The XMLHttpRequest function will achieve the same results.</p>



<p><strong>JavaScript Code</strong></p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">let IPxhr = new XMLHttpRequest();
IPxhr.open("GET", "https://ipinfo.io/json", true);
IPxhr.send();
IPxhr.onreadystatechange = processRequest;
function processRequest(e) {
  if (IPxhr.readyState == 4 &amp;&amp; IPxhr.status == 200) {
    let response = JSON.parse(IPxhr.responseText);
    document.querySelector("#ipAddress").innerHTML = response.ip;
  }
}</code></pre>



<h2>Conclusion</h2>



<p>Hopefully, with what you&#8217;ve learned so far, handling different JavaScript Requests types won&#8217;t be a hassle for you. First, we&#8217;ve described what some HTTP methods are. Secondly, we highlighted the commonly used JavaScript request types, including XMLHTTPRequest and the fetch functions. Finally, we&#8217;ve provided you with some code examples to play around with and use.</p>



<p>Remember, incorporating HTTP Request methods and returning data remains one of the simplest tasks to do, especially when you are still new to the JavaScript language. But with time, not only will you understand the functionality, but you&#8217;ll also know the right one to use in any given scenario.</p>



<h2>Recommended Articles</h2>



<ul><li><a href="https://appcode.app/javascript-fundamentals-a-dinosaurs-cheat-sheet/">JavaScript Fundamentals – A Dinosaurs Cheat Sheet</a></li><li><a href="https://appcode.app/how-to-use-css-cascading-style-sheets-to-style-html/">How To Use CSS (Cascading Style Sheets) To Style HTML</a></li><li><a href="https://appcode.app/what-are-more-examples-of-html-elements-and-structure/">What Are More Examples of HTML Elements and Structure</a></li><li><a href="https://appcode.app/how-to-create-a-valid-html-web-page-with-elements/">How To Create a Valid HTML Web Page With Elements</a></li><li><a href="https://appcode.app/how-to-create-your-first-html-elements-with-examples/">How To Create Your First HTML Elements With Examples</a></li></ul>



<p></p>



<p></p>
<p>The post <a rel="nofollow" href="https://appcode.app/introduction-to-the-fancy-javascript-request/">Introduction to the Fancy JavaScript Request</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7822</post-id>	</item>
		<item>
		<title>8 Useful Methods To Minimize Code and Reduce Page Load</title>
		<link>https://appcode.app/8-useful-methods-to-minimize-code-and-reduce-page-load/</link>
		
		<dc:creator><![CDATA[Hamza Latif]]></dc:creator>
		<pubDate>Sat, 15 Jan 2022 02:56:38 +0000</pubDate>
				<category><![CDATA[Client-side]]></category>
		<guid isPermaLink="false">https://appcode.app/?p=7772</guid>

					<description><![CDATA[<p>This article demonstrates tips, optimizations, and examples on how to speed up your website, which is critical to the user&#8217;s experience. If your website is without helpful optimizations, you may be missing out. Users will begin to leave your site before it is entirely loaded if the pages take a long time to load. Minification of the CSS code Compressing your files Minimize server calls Performing image optimization Clean up your HTML code Make use of lazy loading Enhance the speed with caching Use lightweight CSS frameworks Every day, millions of different websites are seen, and the majority of them…</p>
<p>The post <a rel="nofollow" href="https://appcode.app/8-useful-methods-to-minimize-code-and-reduce-page-load/">8 Useful Methods To Minimize Code and Reduce Page Load</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This article demonstrates tips, optimizations, and examples on how to speed up your website, which is critical to the user&#8217;s experience.</p>



<p>If your website is without helpful optimizations, you may be missing out. Users will begin to leave your site before it is entirely loaded if the pages take a long time to load.</p>



<ol><li><a href="#one">Minification of the CSS code</a></li><li><a href="#two">Compressing your files</a></li><li><a href="#three">Minimize server calls</a></li><li><a href="#four">Performing image optimization</a></li><li><a href="#five">Clean up your HTML code</a></li><li><a href="#six">Make use of lazy loading</a></li><li><a href="#seven">Enhance the speed with caching</a></li><li><a href="#eight">Use lightweight CSS frameworks</a></li></ol>



<p>Every day, millions of different websites are seen, and the majority of them are closed before they have a chance to influence, share their material, or sell the things they promote. So, what causes this? Most of the time it&#8217;s because of poor optimization. Many websites are slow, unfriendly to users, and incompatible with browsers. That means something must be done to prevent the loss.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="974" height="511" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Methods-To-Minimize-Code-and-Reduce-Page-Load-1.png?resize=974%2C511&#038;ssl=1" alt="Methods To Minimize Code and Reduce Page Load" class="wp-image-7790" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Methods-To-Minimize-Code-and-Reduce-Page-Load-1.png?w=974&amp;ssl=1 974w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Methods-To-Minimize-Code-and-Reduce-Page-Load-1.png?resize=300%2C157&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Methods-To-Minimize-Code-and-Reduce-Page-Load-1.png?resize=768%2C403&amp;ssl=1 768w" sizes="(max-width: 974px) 100vw, 974px" data-recalc-dims="1" /><figcaption>Methods To Minimize Code and Reduce Page Load</figcaption></figure>



<p>This article presents eight front-end performance optimization methods and tips. These methods will certainly be effective in enhancing front-end performance and increasing website speed so that users do not leave your website.</p>



<h2 id="one">#1 Minification of the CSS code</h2>



<p>A CSS file&#8217;s minification involves removing unnecessary characters from the source code in order to reduce the file&#8217;s size. The primary goal of minification is to boost the website&#8217;s speed. When a user requests information from a website, the minified version is given rather than the full version. As a result, bandwidth costs are reduced, and response time decreases. It helps in the accessibility of the site as well as the search engine&#8217;s rating.</p>



<p><strong>Before CSS minification</strong></p>



<pre class="wp-block-code"><code lang="css" class="language-css">header {
  width: 90%;
  height: 100vh;
  background-color: white;
  background-repeat: no-repeat;
  background-size: cover;
}
nav {
  width: 80%;
  height: 15vh;
  background-color: black;
  display: flex;
  justify-content: space-between;
  align-items: center;
}</code></pre>



<p></p>



<p><strong>After CSS minification</strong></p>



<pre class="wp-block-code"><code lang="css" class="language-css">header{width:90%;height:100vh;background-color:#fff;background-repeat:no-repeat;background-size:cover}nav{width:80%;height:15vh;background-color:#000;display:flex;justify-content:space-between;align-items:center}</code></pre>



<p></p>



<h2 id="two">#2 Compressing your files</h2>



<figure class="wp-block-image size-large"><img loading="lazy" width="971" height="364" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Reducing-Page-Size-By-Compressing-Files.png?resize=971%2C364&#038;ssl=1" alt="Reducing Page Size By Compressing Files" class="wp-image-7795" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Reducing-Page-Size-By-Compressing-Files.png?w=971&amp;ssl=1 971w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Reducing-Page-Size-By-Compressing-Files.png?resize=300%2C112&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Reducing-Page-Size-By-Compressing-Files.png?resize=768%2C288&amp;ssl=1 768w" sizes="(max-width: 971px) 100vw, 971px" data-recalc-dims="1" /><figcaption>Reducing Page Size By Compressing Files</figcaption></figure>



<p>HTML and CSS code files make up any website. The more complicated the page is, the longer it will take to load. These huge code files should be reduced to their original size to enhance site responsiveness. These are some decent file compression options:</p>



<ul><li><strong>Brotli</strong> was <a href="https://github.com/google/brotli">introduced by Google in 2015</a>, offers a compression ratio that is equivalent to the greatest general-purpose compression methods currently available.</li><li><strong>Gzip</strong>, which is another widely used <a href="https://www.gnu.org/software/gzip/">data compression and decompression tool</a>, is known as Gzip. You can also use this tool for compressing the files.</li></ul>



<h2 id="three">#3 Minimize server calls</h2>



<p>A site&#8217;s overall loading speed is heavily influenced by the total number of HTTP requests it must handle. You may dramatically enhance the speed of your site&#8217;s loading by reducing HTTP requests.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="970" height="479" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Minimize-Server-Calls-Increases-Speed.png?resize=970%2C479&#038;ssl=1" alt="Minimize Server Calls Increases Speed" class="wp-image-7798" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Minimize-Server-Calls-Increases-Speed.png?w=970&amp;ssl=1 970w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Minimize-Server-Calls-Increases-Speed.png?resize=300%2C148&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Minimize-Server-Calls-Increases-Speed.png?resize=768%2C379&amp;ssl=1 768w" sizes="(max-width: 970px) 100vw, 970px" data-recalc-dims="1" /><figcaption>Minimize Server Calls Increases Speed</figcaption></figure>



<p>The following are elements that do not improve your visitors&#8217; experience:</p>



<ul><li>Unnecessary images</li><li>Unnecessary JavaScript</li><li>Excessive CSS</li><li>Unnecessary plugins</li></ul>



<p>The fewer resources you have, the fewer requests a server must make to render a webpage. </p>



<h2 id="four">#4 Performing image optimization</h2>



<p>Images might be a website-killer for people who aren&#8217;t familiar with frontend optimization techniques. Large photo albums and high-resolution photographs on your site can cause the rendering process to become choked. Non-optimized high-definition photographs can be several gigabytes in size. As a result, appropriately optimizing these will help you to increase the frontend performance of your site.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="973" height="537" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Performing-Image-Optimization.png?resize=973%2C537&#038;ssl=1" alt="Performing Image Optimization" class="wp-image-7792" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Performing-Image-Optimization.png?w=973&amp;ssl=1 973w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Performing-Image-Optimization.png?resize=300%2C166&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Performing-Image-Optimization.png?resize=768%2C424&amp;ssl=1 768w" sizes="(max-width: 973px) 100vw, 973px" data-recalc-dims="1" /><figcaption>Performing Image Optimization</figcaption></figure>



<p>Every image file contains a lot of information unrelated to the photograph or image itself. Dates, locations, camera specs, and other unnecessary information are included in JPEG images.</p>



<p>Using optimization tools like Optimus, you may shorten the time it takes for a picture to load by removing the excess image data. Optimus uses <a href="https://optimus.io/">smart compression, which optimizes PNG pictures losslessly</a>.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="973" height="377" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Image-Optimization-Reduces-Page-Load.png?resize=973%2C377&#038;ssl=1" alt="Image Optimization Reduces Page Load" class="wp-image-7796" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Image-Optimization-Reduces-Page-Load.png?w=973&amp;ssl=1 973w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Image-Optimization-Reduces-Page-Load.png?resize=300%2C116&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Image-Optimization-Reduces-Page-Load.png?resize=768%2C298&amp;ssl=1 768w" sizes="(max-width: 973px) 100vw, 973px" data-recalc-dims="1" /><figcaption>Image Optimization Reduces Page Load</figcaption></figure>



<h2 id="five">#5 Clean up your HTML code</h2>



<p>The core of almost every website is HTML or hypertext markup language. HTML allows you to add headings, subheadings, lists, and other text-organizing elements to your web pages.</p>



<p>Whether you are new to HTML or a seasoned pro, You must follow a set of guidelines to make HTML writings consistent and well-organized. One of the main concerns should be writing clean code.</p>



<p>Here are a few best practices for keeping HTML code clean and appealing.</p>



<ul><li>Use Proper Document structure.</li><li>Use Standard Compliant Coding.</li><li>Ident your Code.</li><li>Keep your syntax organized.</li></ul>



<h2 id="six">#6 Make use of lazy loading</h2>



<figure class="wp-block-image size-large"><img loading="lazy" width="972" height="543" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Lazy-Loading-Only-Loads-Necessary-Content-First.png?resize=972%2C543&#038;ssl=1" alt="Lazy Loading Only Loads Necessary Content First" class="wp-image-7797" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Lazy-Loading-Only-Loads-Necessary-Content-First.png?w=972&amp;ssl=1 972w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Lazy-Loading-Only-Loads-Necessary-Content-First.png?resize=300%2C168&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Lazy-Loading-Only-Loads-Necessary-Content-First.png?resize=768%2C429&amp;ssl=1 768w" sizes="(max-width: 972px) 100vw, 972px" data-recalc-dims="1" /><figcaption>Lazy Loading Only Loads Necessary Content First</figcaption></figure>



<p>Frontend loading times can be sped up much more with lazy loading. With lazy loading, the web page loads only the content that is required first, and the remaining content is loaded only when the user requests it.</p>



<p class="note"><strong>For example</strong>,&nbsp; Google Image Search results initially load only a small set of images. It loads placeholder images of hidden content rather than the actual content, which reduces loading time. The actual content is rendered as the user scrolls down the page.</p>



<h2 id="seven">#7 Enhance the speed with caching</h2>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="676" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Enhance-Page-Speed-With-Caching.png?resize=1024%2C676&#038;ssl=1" alt="Enhance Page Speed With Caching" class="wp-image-7787" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Enhance-Page-Speed-With-Caching.png?resize=1024%2C676&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Enhance-Page-Speed-With-Caching.png?resize=300%2C198&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Enhance-Page-Speed-With-Caching.png?resize=768%2C507&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Enhance-Page-Speed-With-Caching.png?w=1053&amp;ssl=1 1053w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Enhance Page Speed With Caching</figcaption></figure>



<p>Caching content in a visitor&#8217;s browser means storing images, CSS files, etc., on each visitor&#8217;s computer. Therefore, if a user visits your website or the same page multiple times, the page may be partially loaded from already saved elements.</p>



<p>This is especially useful for websites that have a lot of images, such as an e-commerce website that visitors visit many times before making a purchase. Using the browser cache improves both the visitor user experience and the load on the server because the webserver does not have to regenerate the cached files.</p>



<h2 id="eight">#8 Use lightweight CSS frameworks</h2>



<p>Unless you&#8217;re designing your website entirely from scratch, a good frontend framework will help you avoid a lot of amateur frontend optimization blunders.</p>



<p>Although some bigger, more well-known frameworks offer many extra features and options, you may not need them all for your web project.</p>



<p>As a result, it&#8217;s critical to figure out what features your project needs and then start with a framework that can provide those features while being lightweight. Concise HTML, CSS, and JavaScript code are used in some of the most modern frameworks.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="600" height="300" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Use-Lightweight-Frameworks-Like-Pure.png?resize=600%2C300&#038;ssl=1" alt="Use Lightweight Frameworks Like Pure" class="wp-image-7799" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Use-Lightweight-Frameworks-Like-Pure.png?w=600&amp;ssl=1 600w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Use-Lightweight-Frameworks-Like-Pure.png?resize=300%2C150&amp;ssl=1 300w" sizes="(max-width: 600px) 100vw, 600px" data-recalc-dims="1" /><figcaption>Use Lightweight Frameworks Like Pure</figcaption></figure>



<p>Here are a few examples of minimalist CSS frameworks that give fast loading times:</p>



<ul><li><a href="https://github.com/yahoo/pure">Pure</a></li><li><a href="http://getskeleton.com/">Skeleton</a></li><li><a href="https://milligram.github.io/">Milligram</a></li></ul>



<h2><strong>Wrapping up</strong></h2>



<p>Making the first step is always challenging. Whatever the case may be, the future belongs to those who are not afraid to innovate and redefine previously existing approaches. The execution of these methods assures that your site loads quickly and provides a fantastic customer experience. Simply make sure everything is small, clever, and smooth.</p>



<h2>Recommended Articles</h2>



<ul><li><a href="https://appcode.app/what-are-more-examples-of-html-elements-and-structure/">What Are More Examples of HTML Elements and Structure</a></li><li><a href="https://appcode.app/how-to-create-a-valid-html-web-page-with-elements/">How To Create a Valid HTML Web Page With Elements</a></li><li><a href="https://appcode.app/how-to-create-your-first-html-elements-with-examples/">How To Create Your First HTML Elements With Examples</a></li><li><a href="https://appcode.app/how-to-use-css-cascading-style-sheets-to-style-html/">How To Use CSS (Cascading Style Sheets) To Style HTML</a></li><li><a href="https://appcode.app/javascript-fundamentals-a-dinosaurs-cheat-sheet/">JavaScript Fundamentals – A Dinosaurs Cheat Sheet</a></li></ul>



<p></p>
<p>The post <a rel="nofollow" href="https://appcode.app/8-useful-methods-to-minimize-code-and-reduce-page-load/">8 Useful Methods To Minimize Code and Reduce Page Load</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7772</post-id>	</item>
		<item>
		<title>Creating Fun Charts With Chart.js</title>
		<link>https://appcode.app/creating-fun-charts-with-chart-js/</link>
		
		<dc:creator><![CDATA[Murat Kilinc]]></dc:creator>
		<pubDate>Sat, 15 Jan 2022 00:06:22 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">https://appcode.app/?p=7682</guid>

					<description><![CDATA[<p>This article demonstrates how to create fun JavaScript graphs with the chart.js library. We include examples and code to implement a graph. We also explain what data visualization is. For this example, we will use the Chart.js library, which you can find in many dashboards and graphs. What is data visualization? Data visualization is expressed as the application converts data into a visual context, such as a graph. A graph makes it easier for the human brain to understand and gain insight into the data. It refers to techniques to make data understandable by encoding them as visual objects (dots,…</p>
<p>The post <a rel="nofollow" href="https://appcode.app/creating-fun-charts-with-chart-js/">Creating Fun Charts With Chart.js</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This article demonstrates how to create fun JavaScript graphs with the chart.js library. We include examples and code to implement a graph. We also explain what data visualization is. For this example, we will use the Chart.js library, which you can find in many dashboards and graphs.</p>



<h2>What is data visualization?</h2>



<p>Data visualization is expressed as the application converts data into a visual context, such as a graph. A graph makes it easier for the human brain to understand and gain insight into the data. It refers to techniques to make data understandable by encoding them as visual objects (dots, lines, or bars). With those techniques, the interpretation of data can be beneficial in many ways.</p>



<p class="note">High-quality rendered graphics are 30 times more likely to be read than average. In addition, the human brain processes visual data approximately 50,000 times faster. Likewise, data presented to the users with a graph is 97% more convincing.</p>



<p>With the short explanation of data visualization, we can now start learning how to create a graph with the chart.js library.</p>



<h2>What is Chart.js?</h2>



<p>There are many data visualization libraries for web developers to use. However, in this article, we will prefer Chart.js. We chose Chart.js because it&#8217;s highly customizable with many options, and is used frequently on the web.</p>



<p>In short, the Chart.js library can be thought of as a web tool that offers interactive charts while having advanced features yet being easy to use. You can create many graphs such as bar, line, area, and scales from this open-source data visualization library.</p>



<h2>How to create a chart with Chart.js?</h2>



<ul><li><a href="#one">How to install Chart.js</a></li><li><a href="#two">Creating a canvas</a></li><li><a href="#three">Preparing the data</a></li><li><a href="#four">Creating the canvas and chart variables</a></li><li><a href="#five">Customizing the chart options</a></li><li><a href="#six">Using HTML to deploy the graph</a></li><li><a href="#seven">Rendering the graph</a></li></ul>



<h3 id="one">How to install Chart.js</h3>



<p>To install Chart.js, it requires simply placing a script tag between the <code>&lt;head&gt;</code> element in the HTML. We will be using version 3.7.0, as seen in the script source below.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.min.js" &gt;&lt;/script&gt;</code></pre>



<p></p>



<p>Once you include the script, we can create a simple pie chart with the steps below.</p>



<h3 id="two">Creating a canvas</h3>



<p>The <code>&lt;canvas&gt;</code> element allows graphics drawn by JavaScript to display on HTML. It creates a drawing board for items that need to be visually present on the web page. </p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;canvas id="chartName" width="500" height="500"&gt;&lt;/canvas&gt;</code></pre>



<p></p>



<p>For example, we created a canvas (drawing area) with a height and width of 500px and an id of <code>id="chartName"</code> in the above structure.</p>



<h3 id="three">Preparing the data</h3>



<p>We&#8217;ve turned a small data set into the table below to illustrate a data set example. The table includes cryptocurrencies and the market sizes of these coins.</p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>Coin Name</strong></td><td><strong>Market Cap</strong></td></tr><tr><td>Bitcoin</td><td>$957 B </td></tr><tr><td>Ethereum</td><td>$480 B </td></tr><tr><td>Cardano</td><td>$51 B </td></tr><tr><td>Ripple</td><td>$43 B </td></tr></tbody></table></figure>



<p>To visualize a Chart.js graph with the data set we created, we need to prepare it with JavaScript. For this, let&#8217;s create two arrays named coins and market sizes:</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">// Data sizes are provided by creating an array with let
let coins = ['Bitcoin', 'Ethereum', 'Cardano', 'Ripple'];
let marketCap = [957, 480, 51, 43];</code></pre>



<h3 id="four">Creating the canvas and chart variables</h3>



<p>To bring all the components together, we first need to define a variable called canvas with the value being the canvas element. We use let again for this (the <code>getElementById</code> must be the same as the canvas id in the HTML element above).</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">let canvas = document.getElementById(‘chartName’);</code></pre>



<p></p>



<p>Now it&#8217;s time to combine the pieces by creating a new chart that uses the canvas variable. We will also define the chart type.</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">// In the type section, options such as line, bar, radar,
// donut and pie, polar area, bubble and scatter can be used.
let firstChart = new Chart(canvas, {
    type: 'pie',
    data: {}
});</code></pre>



<p></p>



<p>At this point, you should choose a chart type that you think will be appropriate for the data used. For example, we used a pie chart to see the distribution of coins among themselves in the data set we created. We set type to pie like below:</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">type: 'pie',</code></pre>



<p> </p>



<p>There are additional chart types such as:</p>



<ul><li>line</li><li>bar</li><li>radar</li><li>doughnut and pie</li><li>polar area</li><li>bubble</li><li>scatter</li></ul>



<h3 id="five">Customizing the chart options</h3>



<p>After the chart structure is created, the Chart.js library allows many customizations. For example, you can change the colors of the graph, titles, legends, and more. This is shown in the code snippets below:</p>



<p><strong>Data color:</strong></p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">//you can choose colors as hex code or rgb
backgroundColor: [
  "#26b99a", 
  "#9b59b6", 
  "#8abb6f", 
  "#bfd3b7"
],</code></pre>



<p></p>



<p><strong>Legend options:</strong></p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">  options: {
    plugins: {
      legend: {
        title: {
          display: true,
          text: "Percentage distributions of the most known coins"
        }
      }
    }
  }</code></pre>



<p></p>



<p><strong>Border options:</strong></p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">borderColor: [
  "#26b99a", 
  "#9b59b6", 
  "#8abb6f", 
  "#bfd3b7"
]</code></pre>



<p></p>



<p class="note">With so many changes you can make, each chart can be unique. </p>



<h3 id="six">Using HTML to deploy the graph</h3>



<p>When deploying the chart we created to the web environment, it should be noted that the <code>&lt;canvas&gt;</code> element is placed inside the <code>&lt;body&gt;</code> element. In addition, after the Chart.js library script is placed in the head, the following structure is formed.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;My First Chart&lt;/title&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.min.js" &gt;   &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div style="width:400px; height:400px;"&gt;
        &lt;canvas id="chartName"&gt;&lt;/canvas&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>



<p></p>



<p>Similarly, the following code structure is formed when you bring together the components of the chart structure created with JavaScript.</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">let coins = ["Bitcoin", "Ethereum", "Cardano", "Ripple"];
let marketCap = [957, 480, 51, 43];

let canvas = document.getElementById("chartName");

let firstChart = new Chart(canvas, {
  type: "pie",
  data: {
    labels: coins,
    datasets: [
      {
        label: "Coin",
        data: marketCap,
        backgroundColor: ["#26b99a", "#9b59b6", "#8abb6f", "#bfd3b7"],
        borderColor: ["#26b99a", "#9b59b6", "#8abb6f", "#bfd3b7"]
      }
    ]
  },
  options: {
    plugins: {
      legend: {
        title: {
          display: true,
          text: "Percentage distributions of the most known coins"
        }
      }
    }
  }
});</code></pre>



<h3 id="seven">Rendering the graph</h3>



<p>To render the graph now that the HTML and JavaScript are finished, combine the two. As you see below, the JavaScript is placed into a new script element in the body below the canvas. This code is now ready to be used on a webpage. Check below for a rendered image of the pie chart.</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">&lt;!DOCTYPE html&gt;
&lt;html&gt;
   &lt;head&gt;
      &lt;title&gt;My First Chart&lt;/title&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.min.js"&gt; &lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;div style="width:400px; height:400px;"&gt;
         &lt;canvas id="chartName"&gt;&lt;/canvas&gt;
      &lt;/div&gt;
      &lt;script&gt;
         let coins = ["Bitcoin", "Ethereum", "Cardano", "Ripple"];
         let marketCap = [957, 480, 51, 43];
         let canvas = document.getElementById("chartName");
         let firstChart = new Chart(canvas, {
           type: "pie",
           data: {
             labels: coins,
             datasets: [{
               label: "Coin",
               data: marketCap,
               backgroundColor: ["#26b99a", "#9b59b6", "#8abb6f", "#bfd3b7"],
               borderColor: ["#26b99a", "#9b59b6", "#8abb6f", "#bfd3b7"]
             }]
           },
           options: {
             plugins: {
               legend: {
                 title: {
                   display: true,
                   text: "Percentage distributions of the most known coins"
                 }
               }
             }
           }
         });
      &lt;/script&gt;
   &lt;/body&gt;
&lt;/html&gt;</code></pre>



<p></p>



<p>The code renders the following graph:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="288" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Graph-in-Chart-JS.png?resize=1024%2C288&#038;ssl=1" alt="Creating a Graph in Chart JS" class="wp-image-7735" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Graph-in-Chart-JS.png?resize=1024%2C288&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Graph-in-Chart-JS.png?resize=300%2C84&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Graph-in-Chart-JS.png?resize=768%2C216&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Graph-in-Chart-JS.png?resize=1536%2C432&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Creating-a-Graph-in-Chart-JS.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Creating a Graph in Chart JS</figcaption></figure>



<p>You can edit <a href="https://codepen.io/murattkilinc/pen/gOGoMGN">this graph example on codepen.io</a></p>



<h2>Final Words</h2>



<p>There are also libraries such as <a href="https://gionkunz.github.io/chartist-js/">Chartist.js</a> and <a href="https://echarts.apache.org/en/index.html">Apache Echart</a> developed for data visualization. These libraries are also JavaScript, just like Chart.js, and they are created with similar structures. But if you find other graphs for your web page that you think will increase user interaction more, the different libraries may be suitable for you.</p>



<h2>Recommended Articles</h2>



<ul><li><a href="https://appcode.app/explaining-the-scale-property-in-css/">Explaining the Scale Property in CSS</a></li><li><a href="https://appcode.app/how-to-create-a-stacked-card-hover-effect-using-css/">How To Create a Stacked Card Hover Effect Using CSS</a></li><li><a href="https://appcode.app/how-to-center-div-elements-or-nested-elements/">How to Center DIV Elements or Nested Elements</a></li><li><a href="https://appcode.app/how-to-create-an-html-carousel/">How To Create an HTML Carousel</a></li></ul>



<p></p>
<p>The post <a rel="nofollow" href="https://appcode.app/creating-fun-charts-with-chart-js/">Creating Fun Charts With Chart.js</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7682</post-id>	</item>
		<item>
		<title>Explaining the Scale Property in CSS</title>
		<link>https://appcode.app/explaining-the-scale-property-in-css/</link>
		
		<dc:creator><![CDATA[Oluwatosin Saibu]]></dc:creator>
		<pubDate>Thu, 13 Jan 2022 02:46:22 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">https://appcode.app/?p=7617</guid>

					<description><![CDATA[<p>This article demonstrates the CSS scale property with examples and code samples, which can be used to scale an element on the x, y, and z-axis. The scale property in CSS is a CSS transformation property. It makes it possible for a developer to resize an element in a three-dimensional plane across the x, y, and z-axis. The property can also help decrease or increase the size of an element. Hence, the scale property can zoom in and out a selected element. When applying the scale transformation, it is essential to instruct the web browser, the user is surfing on,…</p>
<p>The post <a rel="nofollow" href="https://appcode.app/explaining-the-scale-property-in-css/">Explaining the Scale Property in CSS</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This article demonstrates the CSS scale property with examples and code samples, which can be used to scale an element on the x, y, and z-axis.</p>



<p>The scale property in CSS is a CSS transformation property. It makes it possible for a developer to resize an element in a three-dimensional plane across the x, y, and z-axis. The property can also help decrease or increase the size of an element. Hence, the scale property can zoom in and out a selected element. When applying the scale transformation, it is essential to instruct the web browser, the user is surfing on, about the number to resize. A vector or a single number defines the scaling value. By using the scale property you can scale elements vertically and horizontally. </p>



<p>You can specify scale transforms independently and individually. But, of course, it maps better to specific user interface usage and tends to help in remembering the exact order of transform functions if you have to specify it in the transform value.</p>



<p>What scale looks like in a line of CSS code:</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.element {
  width: 50px;
  height: 50px;
  scale: 2; /* Results in 100 pixels square */
}
</code></pre>



<p>If we have an element that’s 20 pixels square, scaling it up by a value of 2 will automatically double the dimensions to 40 pixels square. As seen in the line of codes above, the CSS scale property does “its job” independently of the <strong><em>transform property</em></strong>, thus, giving users more flexibility to help scale elements without linking the effect with other transforms. </p>



<p>Reiteratively, the transform property happens to be another way to scale your HTML elements since the scale is a function of transform, and this is what it looks like:</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.element {
  width: 50px;
  height: 50px;
  transform: scale(2); /* Results in 100 pixels square */
}
</code></pre>



<h5>Syntax</h5>



<pre class="wp-block-code"><code lang="css" class="language-css">scale: none | &lt;number&gt; {1,2};</code></pre>



<p></p>



<p>When working with scale property, you can input the &#8220;none&#8221; keyword or one to three numeric values. On the other hand, providing numeric values scales the selected element along the X and Y-axis. For example, if you provide two values, the first will scale the X-axis while the second will scale the Y-axis. Meanwhile, if you provide three values, the third one will correspond to the Z-Axis, thus scaling the element&#8217;s depth in a 3D context, the same as <strong><em>transform: scale3d().</em></strong></p>



<h2>What are the parameters of scale?</h2>



<p>The parameters of scale look like this: </p>



<pre class="wp-block-code"><code lang="css" class="language-css">scale: { sx };
scale: { sx, sy };
scale: { sx, sy, sz };</code></pre>



<p></p>



<ul><li><strong>sx</strong> in this context resizes the element in the horizontal plane, x-axis.</li><li><strong>sy</strong> resizes the elements in the vertical plane, y-axis.</li><li><strong>sz</strong> resizes the elements on the z axis. </li></ul>



<p>But here’s the catch, if no values are defined after the <code>sx</code>, then the element is resized using only the <code>sx</code> in a horizontal and vertical direction.</p>



<h2>What are the values of scale?</h2>



<pre class="wp-block-code"><code lang="css" class="language-css">/* Keyword values */
scale: none;

/* Single values */
scale: 2;
scale: 0.5;

/* Two values */
scale: 2 0.25;

/* Three values */
scale: 2 0.5 1;

/* Global values */
scale: inherit;
scale: initial;
scale: revert;
scale: unset;
</code></pre>



<p></p>



<ul><li><strong>(Single Values) scale: 2</strong> &#8211; The <strong><em>&lt;number&gt; </em></strong>specifies a scale factor that makes the selected element scale by the same factor along the X- and Y-axis. This is equivalent to <strong><em>(2D scaling) function </em></strong><em>but with a single specified value.</em></li></ul>



<ul><li><strong>(Two Values) scale: 1 0.25</strong> &#8211; It represents two &lt;number&gt; &#8216;s&#8217; that specifies the X- and Y-axis values of the 2D scale. It is the same as the transform: scale(x, y) (2D scaling) CSS property with two values specified.</li></ul>



<ul><li><strong>(Three Values) scale: 2 0.5 1</strong> &#8211; Three values, on the other hand, represent three &lt;number) &#8216;s&#8217; that specify X-, Y-, Z-axis scaling values of a 3D scale. Similar to transform: scale3d(x, y, z).</li></ul>



<ul><li><strong>None: </strong>It means no scaling is applied to the element, which is the same as <strong><em>scale: 1</em></strong>.</li></ul>



<h2>Fallbacks</h2>



<p>In this case, though web browser support is currently building for the scale property, we recommend checking for support when using the scale. Here’s what the CSS scale fallback looks like:</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.box:hover {
  transform: scale(3); /* Fallback to this */
}

@supports (scale: 0.5) {
  .box:hover {
    scale: 3; /* Used if support for `scale` is detected */
  }
}
</code></pre>



<p></p>



<h3>Accessibility issues</h3>



<p>Scaling and zooming animations can be quite taxing and complex for accessibility. This is mostly because these animations are a common trigger for some types of migraines. If there&#8217;s ever a need to include such animations on your website or application, ensure to provide control to enable users to turn it off. We recommend doing this site-wide.</p>



<p>It would help if you considered using prefers-reduced motion to write media queries, which will ultimately turn off animations whenever the user has reduced the animation specified in the user&#8217;s web system preference.</p>



<h2>Notables</h2>



<ul><li>Scaling doesn&#8217;t distort the natural layout flow.</li></ul>



<p>It is crucial to note that the scale property doesn&#8217;t affect other elements or make them flow to wrap around it as the transform scale function does. In simple terms, that means an element&#8217;s scale doesn&#8217;t alter the other elements&#8217; motion to make an extra room available due to that specific element.</p>



<ul><li>Scaling affects the child as well as the descendants&#8217; elements</li></ul>



<p>Another thing to note is that the CSS scale property scales all the element&#8217;s descendants. For instance, if you have an image inside the element. Altering the elements scale will automatically scale both the element and the image within it.</p>



<h2>Example of CSS scale with hover</h2>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="256" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-CSS-Scale-Property-With-Hover.png?resize=1024%2C256&#038;ssl=1" alt="Using the CSS Scale Property With Hover" class="wp-image-7671" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-CSS-Scale-Property-With-Hover.png?resize=1024%2C256&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-CSS-Scale-Property-With-Hover.png?resize=300%2C75&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-CSS-Scale-Property-With-Hover.png?resize=768%2C192&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-CSS-Scale-Property-With-Hover.png?resize=1536%2C384&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-CSS-Scale-Property-With-Hover.png?w=1899&amp;ssl=1 1899w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Using the CSS Scale Property With Hover</figcaption></figure>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!-- HTML -->
&lt;style>
  html,
  body {
    height: 100vh;
    width: 100%;
    background: #cccccc;
    font-family: system-ui;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
  }

  .box {
    background: #2872fa;
    height: 100px;
    margin: 50px auto;
    width: 100px;
    transition: 300ms;
    border-radius: 50%;
  }

  .box:hover {
    scale: 1.5;
  }
&lt;/style>

&lt;!-- HTML -->
&lt;div class="box">&lt;/div></code></pre>



<p></p>



<p>You can edit this <a href="https://codepen.io/prodigy1010/pen/OJxoPqd">example of scale on codepen.io</a></p>



<h2>Compatible Browsers</h2>



<p>Browsers currently compatible with the CSS Scale property include:</p>



<p><strong>Desktop:</strong></p>



<ul><li>Chrome (no)</li><li>Edge (no)</li><li>Firefox (72)</li><li>Internet Explorer (no)</li><li>Opera (no)</li><li>Safari (14.1)</li></ul>



<p><strong>Mobile: </strong></p>



<ul><li>Chrome Android (no)</li><li>Firefox for Android (79)</li><li>Opera Android (no)</li><li>Safari for iOS (14.5)</li><li>Samsung Internet (no)</li><li>WebView Android (no)</li></ul>



<h2>Recommended Articles</h2>



<ul><li><a href="https://appcode.app/how-to-use-css-cascading-style-sheets-to-style-html/">How To Use CSS (Cascading Style Sheets) To Style HTML</a></li><li><a href="https://appcode.app/how-to-create-a-valid-html-web-page-with-elements/">How To Create a Valid HTML Web Page With Elements</a></li><li><a href="https://appcode.app/what-are-more-examples-of-html-elements-and-structure/">What Are More Examples of HTML Elements and Structure</a></li><li><a href="https://appcode.app/how-to-create-your-first-html-elements-with-examples/">How To Create Your First HTML Elements With Examples</a></li><li><a href="https://appcode.app/javascript-fundamentals-a-dinosaurs-cheat-sheet/">JavaScript Fundamentals – A Dinosaurs Cheat Sheet</a></li></ul>
<p>The post <a rel="nofollow" href="https://appcode.app/explaining-the-scale-property-in-css/">Explaining the Scale Property in CSS</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7617</post-id>	</item>
		<item>
		<title>How To Create a Stacked Card Hover Effect Using CSS</title>
		<link>https://appcode.app/how-to-create-a-stacked-card-hover-effect-using-css/</link>
		
		<dc:creator><![CDATA[Piyush Tyagi]]></dc:creator>
		<pubDate>Mon, 10 Jan 2022 02:07:12 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">https://appcode.app/?p=7521</guid>

					<description><![CDATA[<p>This article demonstrates how to create a hover stack effect using HTML and CSS. We use HTML cards with pseudo-elements to create the effect. We will learn to create and add a stacked hover effect to an HTML card using CSS. Don’t worry whether you’re new to CSS, or if you want to use this effect to attract more visitors to your website, or if you want to experiment with new CSS capabilities. I’ll walk you through the process of making your first stacked card. What is a card in HTML? Cards are an essential component of websites. As they…</p>
<p>The post <a rel="nofollow" href="https://appcode.app/how-to-create-a-stacked-card-hover-effect-using-css/">How To Create a Stacked Card Hover Effect Using CSS</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This article demonstrates how to create a hover stack effect using HTML and CSS. We use HTML cards with pseudo-elements to create the effect.</p>



<p>We will learn to create and add a stacked hover effect to an HTML card using CSS. Don’t worry whether you’re new to CSS, or if you want to use this effect to attract more visitors to your website, or if you want to experiment with new CSS capabilities. I’ll walk you through the process of making your first stacked card.</p>



<h2>What is a card in HTML?</h2>



<p>Cards are an essential component of websites. As they can be used to provide highlights of certain data or crucial information to visitors in a concise manner.</p>



<h2>How to create a card using HTML?</h2>



<p>In HTML, you can create a class name <code>.card</code>, <code>.card-header</code>, and <code>.card-body</code> which will contain properties to make the card components. First, you use the .card class is to create the card body. Then you can use a class called <code>.card-header</code> to give a heading to the card. Addionally, to write the card&#8217;s contents, the <code>.card-body</code> class is available.</p>



<p>When creating a card, it&#8217;s almost like when we learn to write a paper. First, the header comes, then the body, which will have the content.</p>



<p>An additional point here is that the content represented by the card class will contain a <code>.card-inner</code> element. All the information like the title of the card, its body (in other words, <code>.card-title</code>, <code>.card-body</code>, etc.) will be stored in this element.&nbsp;</p>



<p>Here is a practical representation of what I mean below:</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;style&gt;
  body {
    background: red;
  }
&lt;/style&gt;
&lt;center&gt;
  &lt;div class="card"&gt;
    &lt;div class="card-inner"&gt;
      &lt;h3 class="card-title"&gt;
        Merry X-MAS
      &lt;/h3&gt;
      &lt;div class="card-body"&gt;
        Wishing you a merry christmas &amp; sending lots of love.
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/center&gt;</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="347" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/HTML-Page-Red-Background-With-CSS.png?resize=1024%2C347&#038;ssl=1" alt="HTML Page Red Background With CSS" class="wp-image-7525" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/HTML-Page-Red-Background-With-CSS.png?resize=1024%2C347&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/HTML-Page-Red-Background-With-CSS.png?resize=300%2C102&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/HTML-Page-Red-Background-With-CSS.png?resize=768%2C260&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/HTML-Page-Red-Background-With-CSS.png?w=1217&amp;ssl=1 1217w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>HTML Page Red Background With CSS</figcaption></figure>



<p class="note"><strong>Note</strong>: In the <code>&lt;style&gt;</code> element above, I have used the red background just to give you an idea of what the card will look like on the webpage.</p>



<p>As you can see, the card contents are center-aligned and contain a title called &#8220;Merry X-Mas&#8221; using the <code>.card-title</code> class. For the content of the card, a class called <code>.card-body</code> wraps around &#8220;Wishing you a merry Christmas &amp; sending lots of love&#8221;. The <code>.card-inner</code> element wraps around all of the information and contains it.</p>



<p>Even though we have the CSS classes and content in the correct locations, the webpage does not look like a card but a wall of red.</p>



<p>So, what’s missing here?</p>



<p>If you have guessed right, it needs some designing using CSS properties in each class. For example, <code>.card-title</code> has no properties associated with it. The class isn&#8217;t even defined in the style element above. A class with properties would look like this below:</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.card-title {
   color: white;
   /* Property two */
   /* Property three */
   /* You get the idea! */
}</code></pre>



<h2>How to create a stack effect using CSS?</h2>



<p>In order to create the stack effect, we will use the CSS pseudo-elements <code>::before</code> and <code>::after</code>. The <code>::before</code> is used to add new content before the content an element. Similarly, <code>::after</code> is used to add new content after the content of an element.</p>



<p class="note"><strong>Note</strong>: You can use <code>:before</code> and <code>::before</code> (same with after) optionally but, IE8 supports only the single “:” notation.</p>



<p>This next HTML code example remains the same as above, except we need to edit the CSS in the style element to add missing classes below to it:</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;style&gt;
  .card {
    position: relative;
    width: 400px;
    margin: 60px auto;
  }

  .card::before,
  .card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
  }

  .card::before,
  .card::after,
  .card .card-inner {
    background-color: green;
    border: 1px solid #01937C;
    transition: transform 0.5s;
  }

  .card::before,
  .card-inner {
    z-index: 1;
  }

  .card-inner {
    position: relative;
    padding: 4rem;
  }
&lt;/style&gt;</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="230" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Card-Using-CSS.png?resize=1024%2C230&#038;ssl=1" alt="Green HTML Card Using CSS" class="wp-image-7528" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Card-Using-CSS.png?resize=1024%2C230&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Card-Using-CSS.png?resize=300%2C67&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Card-Using-CSS.png?resize=768%2C172&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Card-Using-CSS.png?resize=1536%2C345&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Card-Using-CSS.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Green HTML Card Using CSS</figcaption></figure>



<p>Above, you can now see how the card will look. I used a few basic CSS properties to give its structure and style. As you can see, the <code>.card</code> class positions the card&#8217;s inner elements by using the CSS position and setting the card&#8217;s width.</p>



<p class="note"><strong>Note</strong>: We add a <code>z-index: 1</code> to all <code>.card-inner</code> classes so that the elements always sit on top of their pseudo-elements.</p>



<p>Additionally, the margin in the card class has the left and right set to auto to center the card horizontally.</p>



<p class="note"><strong>Note</strong>: You can use <code>margin: 0 auto</code> and the <code>width</code> property to center most block type elements.</p>



<p>Don’t worry if you don’t completely understand everything above. In the next step, some confusion will clear up. Addionally, you can look at this <a href="https://cssreference.io/">CSS reference to know how the properties used above work</a>.</p>



<h2>How to add a hover effect to a card using CSS?</h2>



<p>The CSS hover property is used to add effects on elements and activates by hovering over them. Using the hover property on cards, we may accomplish movement or effects whenever a user hovers over a card with a cursor.</p>



<p>The transform property creates a 2D/3D transformation of an element. In simple words, you can use it to move, rotate, or scale your elements along the X, Y &amp; Z- axis respectively.</p>



<p>You can also move elements by giving angles, numbers, or offset variables.</p>



<h2>What are the types of card hover effects?</h2>



<ul><li>card-top-left</li><li>card-top-right</li><li>card-bottom-left</li><li>card-bottom-right</li><li>card-diagonal-from-right</li><li>card-diagonal-from-left</li><li>card-rotate</li><li>card-perspective</li><li>card-origin</li></ul>



<h2>How to create the top-left stack effect?</h2>



<pre class="wp-block-code"><code lang="css" class="language-css">  .card:hover::before {
    transform: translate(-5px, -5px);
  }

  .card:hover::after {
    transform: translate(-10px, -10px);
  }</code></pre>



<p>The above code implements a transform property that applies a transformation to the before &amp; after pseudo-elements. When the user hovers over the card, the card&#8217;s before and after pseudo-elements will translate on the X &amp; Y axis respectively. Here the card will translate on the&nbsp;-X (negative X-axis) and -Y(negative Y-axis) hence, creating multiple stacked card effects by utilizing the before and after pseudo-elements. </p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="230" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Cards-With-Hover-and-Stack-Effect-1024x230.png?resize=1024%2C230&#038;ssl=1" alt="Green HTML Cards With Hover and Stack Effect" class="wp-image-7530" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Cards-With-Hover-and-Stack-Effect.png?resize=1024%2C230&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Cards-With-Hover-and-Stack-Effect.png?resize=300%2C68&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Cards-With-Hover-and-Stack-Effect.png?resize=768%2C173&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Cards-With-Hover-and-Stack-Effect.png?resize=1536%2C346&amp;ssl=1 1536w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Green-HTML-Cards-With-Hover-and-Stack-Effect.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Green HTML Cards With Hover and Stack Effect</figcaption></figure>



<p>The picture above shows the resulting top-left stacked effect when the CSS classes are added to the style element.</p>



<h2>A complete example of what we have learned</h2>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt; Top-left stacked effect&lt;/title&gt;
      &lt;style&gt;
      .card {
        position: relative;
        width: 400px;
        margin: 60px auto;
      }

      .card::before,
      .card::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
      }

      .card::before,
      .card::after,
      .card .card-inner {
        background-color: green;
        border: 1px solid #01937C;
        transition: transform 0.5s;
      }

      .card::before,
      .card-inner {
        z-index: 1;
      }

      .card-inner {
        position: relative;
        padding: 4rem;
      }

      .card:hover::before {
        transform: translate(-5px, -5px);
      }

      .card:hover::after {
        transform: translate(-10px, -10px);
      }
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;center&gt;
      &lt;div class="card"&gt;
        &lt;div class="card-inner"&gt;
          &lt;h3 class="card-title"&gt;
            Merry X-MAS
          &lt;/h3&gt;
          &lt;div class="card-body"&gt;
            Wishing you a merry christmas &amp; sending lots of love.
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/center&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>



<p class="note">For those people who want to create more than one card and have the hover effect, you can use the <code>.card</code> element which will include all of the contents of the card. You can then paste the <code>.card</code> element on the page somewhere else and the card will be duplicated.</p>



<h2>An advanced example of stacked cards</h2>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="287" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Create-a-Hover-Effect-With-Cards-Using-CSS.png?resize=1024%2C287&#038;ssl=1" alt="How To Create a Hover Effect With Cards Using CSS" class="wp-image-7544" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Create-a-Hover-Effect-With-Cards-Using-CSS.png?resize=1024%2C287&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Create-a-Hover-Effect-With-Cards-Using-CSS.png?resize=300%2C84&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Create-a-Hover-Effect-With-Cards-Using-CSS.png?resize=768%2C215&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Create-a-Hover-Effect-With-Cards-Using-CSS.png?resize=1536%2C430&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/How-To-Create-a-Hover-Effect-With-Cards-Using-CSS.png?w=1919&amp;ssl=1 1919w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>How To Create a Hover Effect With Cards Using CSS</figcaption></figure>



<p>In the above photo, we have created a styled stacked card that includes vertically and horizontally centering. There is more CSS included in creating this card effect. To view or <a href="https://codepen.io/tyler-chipman/pen/YzrRyQb">edit this example, you may visit codepen.io</a>.</p>



<h2>Conclusion</h2>



<p>I hope this article will assist you in creating your personalized cards. Here we have demonstrated how easily we added the stacked effect to a card using the CSS hover property.</p>



<h2>Recommended Articles</h2>



<ul><li><a href="https://appcode.app/how-to-center-div-elements-or-nested-elements/">How to Center DIV Elements or Nested Elements</a></li><li><a href="https://appcode.app/how-to-create-an-html-carousel/">How To Create an HTML Carousel</a></li><li><a href="https://appcode.app/using-jquery-to-manipulate-classes-and-ids/">Using jQuery To Manipulate Classes and IDs</a></li><li><a href="https://appcode.app/how-to-make-an-html-loader-spinner-appear-and-disappear/">How to make an HTML Loader / Spinner Appear and Disappear</a></li><li><a href="https://appcode.app/how-to-create-an-icon-bar-with-css/">How To Create An Icon Bar With CSS</a></li></ul>
<p>The post <a rel="nofollow" href="https://appcode.app/how-to-create-a-stacked-card-hover-effect-using-css/">How To Create a Stacked Card Hover Effect Using CSS</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7521</post-id>	</item>
		<item>
		<title>How to Center DIV Elements or Nested Elements</title>
		<link>https://appcode.app/how-to-center-div-elements-or-nested-elements/</link>
		
		<dc:creator><![CDATA[Navraj Kaler]]></dc:creator>
		<pubDate>Fri, 07 Jan 2022 06:47:12 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">https://appcode.app/?p=7479</guid>

					<description><![CDATA[<p>CSS is one of the three core technologies of the World Wide Web, along with HTML and JavaScript. No modern website is complete without CSS because CSS defines the presentation of the user interface. Though it seems easy, CSS is quite tough to implement in real-time. The reason is that CSS is huge and has many concepts. Moreover, every challenge has more than one solution, sometimes several. Even experienced developers sometimes struggle while implementing CSS.&#160; One of the common challenges in CSS is to center an element. If you have ever worked with CSS, you likely faced a situation where…</p>
<p>The post <a rel="nofollow" href="https://appcode.app/how-to-center-div-elements-or-nested-elements/">How to Center DIV Elements or Nested Elements</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>CSS is one of the three core technologies of the World Wide Web, along with HTML and JavaScript. No modern website is complete without CSS because CSS defines the presentation of the user interface.</p>



<p>Though it seems easy, <a href="https://medium.com/@Cryptacular/why-is-css-so-hard-for-programmers-a10d7e282620">CSS is quite tough to implement in real-time</a>. The reason is that CSS is huge and has many concepts. Moreover, every challenge has more than one solution, sometimes several. Even experienced developers sometimes struggle while implementing CSS.&nbsp;</p>



<p>One of the common challenges in CSS is to center an element. If you have ever worked with CSS, you likely faced a situation where a div element or a heading needs to be centered. And many developers struggle in doing this simple task. One of the primary reasons for this is that developers do not give enough time to learn the tricks for centering elements using CSS. So in this article, we will provide different ways of centering a div or centering other elements inside a div using CSS.</p>



<h1>Different ways to center a div or center elements inside a div</h1>



<p>There are several different ways to center a div on the screen or center elements such as paragraphs, headings, or images inside a div. We can do it horizontally, vertically, or both horizontally or vertically. So let’s discuss each of these ways one by one.</p>



<h2>Using margin property</h2>



<p>One of the easiest ways to center a div horizontally is by <a href="https://www.w3schools.com/css/css_margin.asp">using the margin property</a>. Observe the following div element.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="226" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/A-simple-green-circle-DIV-element-1024x226.png?resize=1024%2C226&#038;ssl=1" alt="A simple green circle DIV element" class="wp-image-7484" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-simple-green-circle-DIV-element.png?resize=1024%2C226&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-simple-green-circle-DIV-element.png?resize=300%2C66&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-simple-green-circle-DIV-element.png?resize=768%2C170&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-simple-green-circle-DIV-element.png?resize=1536%2C339&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-simple-green-circle-DIV-element.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>A simple green circle DIV element</figcaption></figure>



<p><a href="https://www.freecodecamp.org/news/css-shapes-explained-how-to-draw-a-circle-triangle-and-more-using-pure-css/">The green circle is the div element</a> and currently, it is not centered. Following is the HTML for the above.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;html&gt;
  &lt;body class="body-css"&gt;
    &lt;div class="div-css"&gt;
&lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>



<p>And following is the CSS.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.body-css {
  border: 2px solid black;
  padding: 60px;
}

.div-css {
  width: 200px;
  height: 200px;
  background-color: green;
  border-radius: 50%;
}</code></pre>



<p></p>



<p>To center this div horizontally, we can use the margin property and set “auto” as its value.&nbsp;</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.body-css {
  border: 2px solid black;
  padding: 60px;
}

.div-css {
  width: 200px;
  height: 200px;
  background-color: green;
  border-radius: 50%;

  margin: auto;
}</code></pre>



<p></p>



<p>With margin as “auto”, the div will be centered with respect to its parent element, i.e. body.&nbsp;</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="226" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-margin-auto.png?resize=1024%2C226&#038;ssl=1" alt="A centered DIV element using margin auto" class="wp-image-7485" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-margin-auto.png?resize=1024%2C226&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-margin-auto.png?resize=300%2C66&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-margin-auto.png?resize=768%2C170&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-margin-auto.png?resize=1536%2C339&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-margin-auto.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>A centered DIV element using margin auto</figcaption></figure>



<h2>Using flex&nbsp;</h2>



<p><a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/">Using flex</a>, we can align the div horizontally, vertically, or both. We have to apply the “flex” as the value of the display property in the parent element. Then, we have to use the <a href="https://stackoverflow.com/questions/35049262/difference-between-justify-content-vs-align-items">justify-content and align-items property</a> in the parent element as well and both of them should have “center” as their values.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.body-css {
  border: 2px solid black;
  padding: 60px;
 
  display: flex;
  justify-content: center;
  align-items: center;
}
.div-css {
  width: 200px;
  height: 200px;
  background-color: green;
  border-radius: 50%;
}
</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="226" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-CSS-flex.png?resize=1024%2C226&#038;ssl=1" alt="A centered DIV element using CSS flex" class="wp-image-7486" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-CSS-flex.png?resize=1024%2C226&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-CSS-flex.png?resize=300%2C66&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-CSS-flex.png?resize=768%2C169&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-CSS-flex.png?resize=1536%2C338&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-element-using-CSS-flex.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>A centered DIV element using CSS flex</figcaption></figure>



<p>This way is also useful when we want to center any element inside a div. Observe the following HTML.</p>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;html&gt;
  &lt;body class="body-css"&gt;
    &lt;div class="div-css"&gt;
      &lt;h3&gt;Hello World!&lt;/h3&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="227" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-using-CSS-flex-with-uncentered-text.png?resize=1024%2C227&#038;ssl=1" alt="A centered DIV using CSS flex with uncentered text" class="wp-image-7489" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-using-CSS-flex-with-uncentered-text.png?resize=1024%2C227&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-using-CSS-flex-with-uncentered-text.png?resize=300%2C67&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-using-CSS-flex-with-uncentered-text.png?resize=768%2C170&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-using-CSS-flex-with-uncentered-text.png?resize=1536%2C341&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/A-centered-DIV-using-CSS-flex-with-uncentered-text.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>A centered DIV using CSS flex with uncentered text</figcaption></figure>



<p>To center the h3 element, we have to apply the flex to its parent element i.e. div. Yes, we have already applied flex to the body element and there is no problem in applying the flex again.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.body-css {
  border: 2px solid black;
  padding: 60px;

  display: flex;
  justify-content: center;
  align-items: center;
}

.div-css {
  width: 200px;
  height: 200px;
  background-color: green;
  border-radius: 50%;

  display: flex;
  justify-content: center;
  align-items: center;
}</code></pre>



<p></p>



<p>Remember, the justify-content property will center the element horizontally while align-items will center vertically.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="226" src="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-DIV-and-text-using-CSS-Flex.png?resize=1024%2C226&#038;ssl=1" alt="Centered DIV and text using CSS Flex" class="wp-image-7491" srcset="https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-DIV-and-text-using-CSS-Flex.png?resize=1024%2C226&amp;ssl=1 1024w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-DIV-and-text-using-CSS-Flex.png?resize=300%2C66&amp;ssl=1 300w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-DIV-and-text-using-CSS-Flex.png?resize=768%2C169&amp;ssl=1 768w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-DIV-and-text-using-CSS-Flex.png?resize=1536%2C338&amp;ssl=1 1536w, https://i0.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-DIV-and-text-using-CSS-Flex.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Centered DIV and text using CSS Flex</figcaption></figure>



<h2>Using text-align property</h2>



<p><a href="https://www.geeksforgeeks.org/css-text-align-property/">Using text-align property</a> is the most common way to center a text. In the above example, we centered the h3 element inside the div using the flex, which was also used to center the div itself. Instead of using flex to center the h3 element, let’s try the text-align property.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.body-css {
  border: 2px solid black;
  padding: 60px;

  display: flex;
  justify-content: center;
  align-items: center;
}

.div-css {
  width: 200px;
  height: 200px;
  background-color: green;
  border-radius: 50%;

  text-align: center;
}</code></pre>



<p></p>



<p>But there is one problem. The text-align property will only center the element horizontally.&nbsp;</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="225" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-text-using-the-text-align-property.png?resize=1024%2C225&#038;ssl=1" alt="Centered text using the text-align property" class="wp-image-7493" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-text-using-the-text-align-property.png?resize=1024%2C225&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-text-using-the-text-align-property.png?resize=300%2C66&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-text-using-the-text-align-property.png?resize=768%2C169&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-text-using-the-text-align-property.png?resize=1536%2C338&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centered-text-using-the-text-align-property.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Centered text using the text-align property</figcaption></figure>



<p>So, we can use the text-align property, if it is required to center the text horizontally only.</p>



<h2>Using transform property</h2>



<p>Another way to center an element to its nearest parent element is by using the&nbsp;<a target="_blank" href="https://www.w3schools.com/cssref/css3_pr_transform.asp" rel="noreferrer noopener">transform property</a>. In this technique, we give the parent a “relative” position and “absolute” to the child. Then, we provide top, left, and transform properties to the child element with necessary values.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.body-css {
  border: 2px solid black;
  padding: 120px;
  position: relative;
}

.div-css {
  width: 200px;
  height: 200px;
  background-color: green;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}</code></pre>



<p></p>



<p>Remember, the top and left property values should always be “50%” while “translate” should be used for the transform property.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="173" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-transform-property-to-center-a-DIV-element-1024x173.png?resize=1024%2C173&#038;ssl=1" alt="Using the transform property to center a DIV element" class="wp-image-7494" srcset="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-transform-property-to-center-a-DIV-element.png?resize=1024%2C173&amp;ssl=1 1024w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-transform-property-to-center-a-DIV-element.png?resize=300%2C51&amp;ssl=1 300w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-transform-property-to-center-a-DIV-element.png?resize=768%2C130&amp;ssl=1 768w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-transform-property-to-center-a-DIV-element.png?resize=1536%2C259&amp;ssl=1 1536w, https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Using-the-transform-property-to-center-a-DIV-element.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Using the transform property to center a DIV element</figcaption></figure>



<h2>Using grid</h2>



<p><a target="_blank" href="https://learncssgrid.com/" rel="noreferrer noopener">The grid system is relatively new,&nbsp;</a>and you can use it to center elements in CSS. In this technique, we have to set “grid” as the value of display in the parent element and define rows and columns. Then, we can use justify-self and align-self properties in the child element and set their values as “center”.</p>



<pre class="wp-block-code"><code lang="css" class="language-css">.body-css {
  border: 2px solid black;

  display: grid;
  grid-template-rows: 80vh;
  grid-template-columns: 100vw;
}

.div-css {
  width: 200px;
  height: 200px;
  background-color: green;
  border-radius: 50%;

  justify-self: center;
  align-self: center;
}</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="164" src="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-a-DIV-element-using-CSS-Grid.png?resize=1024%2C164&#038;ssl=1" alt="Centering a DIV element using CSS Grid" class="wp-image-7499" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-a-DIV-element-using-CSS-Grid.png?resize=1024%2C164&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-a-DIV-element-using-CSS-Grid.png?resize=300%2C48&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-a-DIV-element-using-CSS-Grid.png?resize=768%2C123&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-a-DIV-element-using-CSS-Grid.png?resize=1536%2C246&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-a-DIV-element-using-CSS-Grid.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Centering a DIV element using CSS Grid</figcaption></figure>



<h1>Wrapping it up</h1>



<p>So centering elements using CSS is not challenging, and you only need to have the correct understanding of specific CSS properties and their values. In this article, we discussed five ways to center a div or center other elements in a div both horizontally and vertically.</p>



<p>Here is a link to a relatively more <a href="https://codepen.io/tyler-chipman/pen/XWeYPVM">advanced example of a centered nested DIV element on codepen.io</a></p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="263" src="https://i1.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-DIV-Elements-or-Nested-Elements-1024x263.png?resize=1024%2C263&#038;ssl=1" alt="Centering DIV Elements or Nested Elements" class="wp-image-7511" srcset="https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-DIV-Elements-or-Nested-Elements.png?resize=1024%2C263&amp;ssl=1 1024w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-DIV-Elements-or-Nested-Elements.png?resize=300%2C77&amp;ssl=1 300w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-DIV-Elements-or-Nested-Elements.png?resize=768%2C197&amp;ssl=1 768w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-DIV-Elements-or-Nested-Elements.png?resize=1536%2C394&amp;ssl=1 1536w, https://i2.wp.com/appcode.app/wp-content/uploads/2022/01/Centering-DIV-Elements-or-Nested-Elements.png?w=1920&amp;ssl=1 1920w" sizes="(max-width: 1024px) 100vw, 1024px" data-recalc-dims="1" /><figcaption>Centering DIV Elements or Nested Elements</figcaption></figure>



<h2>Recommended Articles</h2>



<ul><li><a href="https://appcode.app/how-to-create-an-html-carousel/">How To Create an HTML Carousel</a></li><li><a href="https://appcode.app/how-to-align-an-html-list-side-by-side/">How To Align an HTML List Side by Side</a></li><li><a href="https://appcode.app/javascript-fundamentals-a-dinosaurs-cheat-sheet/">JavaScript Fundamentals – A Dinosaurs Cheat Sheet</a></li><li><a href="https://appcode.app/how-to-create-an-icon-bar-with-css/">How To Create An Icon Bar With CSS</a></li></ul>
<p>The post <a rel="nofollow" href="https://appcode.app/how-to-center-div-elements-or-nested-elements/">How to Center DIV Elements or Nested Elements</a> appeared first on <a rel="nofollow" href="https://appcode.app">AppCode</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7479</post-id>	</item>
	</channel>
</rss>
