<?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/"
	>

<channel>
	<title>CSS &#8211; Dular Sharma</title>
	<atom:link href="https://www.dularsharma.com/category/technology/css/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dularsharma.com</link>
	<description></description>
	<lastBuildDate>Thu, 09 May 2024 11:11:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>BOX Model In CSS</title>
		<link>https://www.dularsharma.com/box-model-in-css/</link>
					<comments>https://www.dularsharma.com/box-model-in-css/#respond</comments>
		
		<dc:creator><![CDATA[Dular Sharma]]></dc:creator>
		<pubDate>Tue, 12 May 2020 10:17:00 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">https://www.dularsharma.com/?p=5888</guid>

					<description><![CDATA[133 ViewsParameter Details: Understanding the Box Model: The Edges: In HTML documents, the browser creates a rectangle for each element, and the Box Model defines how padding, border, and margin are incorporated to shape this rectangle. Each side of this rectangle is referred to as an edge, defining a box. This CSS configuration applies to [&#8230;]]]></description>
										<content:encoded><![CDATA[<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 133</span><span class='epvc-label'> Views</span></div>
<p class="has-text-align-center has-medium-font-size"><strong><mark style="background-color:rgba(0, 0, 0, 0);color:#0000ff" class="has-inline-color">Parameter Details:</mark></strong></p>



<ul class="wp-block-list">
<li><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-amber-color">content-box:</mark></strong> Width and height of the element only includes the content area.</li>



<li><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-amber-color">padding-box:</mark></strong> Width and height of the element includes content and padding.</li>



<li><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-amber-color">border-box:</mark></strong> Width and height of the element includes content, padding, and border.</li>



<li><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-amber-color">initial:</mark></strong> Sets the box model to its default state.</li>



<li><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-amber-color">inherit:</mark></strong> Inherits the box model of the parent element.</li>
</ul>



<p class="has-text-align-center has-medium-font-size"><strong><mark style="background-color:rgba(0, 0, 0, 0);color:#3606fc" class="has-inline-color">Understanding the Box Model:</mark></strong></p>



<p><strong>The Edges:</strong> In HTML documents, the browser creates a rectangle for each element, and the Box Model defines how padding, border, and margin are incorporated to shape this rectangle. Each side of this rectangle is referred to as an edge, defining a box.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img fetchpriority="high" decoding="async" width="469" height="357" src="https://www.dularsharma.com/wp-content/uploads/2024/05/image-3.png" alt="" class="wp-image-5889" style="width:422px;height:auto" srcset="https://www.dularsharma.com/wp-content/uploads/2024/05/image-3.png 469w, https://www.dularsharma.com/wp-content/uploads/2024/05/image-3-300x228.png 300w" sizes="(max-width: 469px) 100vw, 469px" /></figure>
</div>


<ul class="wp-block-list">
<li>The innermost rectangle is the <strong>content box</strong>, determined by the rendered content of the element.</li>



<li>Next is the<strong> padding box</strong>, defined by the padding property. If no padding width is specified, the padding edge matches the content edge.</li>



<li>Subsequently, the <strong>border box</strong> is established by the border property. Absence of border width aligns the border edge with the padding edge.</li>



<li>The outermost rectangle represents the <strong>margin box</strong>, governed by the margin property. If no margin width is specified, the margin edge aligns with the border edge.</li>
</ul>



<pre class="wp-block-code"><code>div {
    border: 6px solid black;
    margin: 60px;
    padding: 30px;
}</code></pre>



<p>This CSS configuration applies to all div elements: a border with 1px width on all sides, a margin of 1<strong>0px,</strong> and padding of <strong>80px.</strong> </p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" width="211" height="156" src="https://www.dularsharma.com/wp-content/uploads/2024/05/image-5.png" alt="" class="wp-image-5891" style="width:314px;height:auto"/></figure>
</div>


<p>When there is no content, the content region has zero height and width. The padding box defaults to the content box size plus the specified padding width on all sides. The border box aligns with the padding box dimensions plus the specified border width.</p>



<p> Lastly, the margin box matches the border box size plus the specified margin width. Considering two elements styled similarly, their box models dictate their relative positioning, with the content separated by a gap but the boxes touching each other. Adjusting margins alters their positioning accordingly.</p>



<p class="has-text-align-center has-medium-font-size"><strong><mark style="background-color:rgba(0, 0, 0, 0);color:#0e11f4" class="has-inline-color">BOX-Sizing</mark></strong></p>



<p><strong>Understanding Box Model and Box Sizing:</strong></p>



<p>The default box model, known as <strong>content-box</strong>, can lead to unexpected results, particularly when adding padding and border styles to an element. This default behavior causes the width or height of an element to exceed the specified values due to the addition of padding and borders.</p>



<p><strong>Example:</strong></p>



<pre class="wp-block-code"><code>textarea {
    width: 100%;
    padding: 3px;
    box-sizing: content-box; /* default value */
}</code></pre>



<p>In this example, the width of the textarea extends beyond 100% due to the addition of padding, showcasing the limitation of the content-box model.</p>



<p><strong>Box Sizing Property:</strong><br>CSS provides the box-sizing property to modify the box model for an element, offering three options:</p>



<ul class="wp-block-list">
<li><strong>content-box:</strong> The default model where width and height encompass only the content, excluding padding and border.</li>



<li><strong>padding-box:</strong> Width and height include both content and padding, but not the border.</li>



<li><strong>border-box:</strong> Width and height encompass content, padding, and border.</li>
</ul>



<p><strong>Solution:</strong><br>To resolve the textarea width issue, simply change the box-sizing property to padding-box or border-box. Among these, border-box is the most commonly used option.</p>



<pre class="wp-block-code"><code>textarea {
    width: 100%;
    padding: 3px;
    box-sizing: border-box;
}</code></pre>



<p><strong>Applying Box Model Globally:</strong><br>To apply a specific box model to all elements on a page, utilize the following CSS snippet:</p>



<pre class="wp-block-code"><code>html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}</code></pre>



<p>This code ensures that the border-box model applies universally. The asterisk (*) notation selects all elements, allowing easy override of this property on individual elements if necessary.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dularsharma.com/box-model-in-css/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Chapter 3. Comments In CSS</title>
		<link>https://www.dularsharma.com/chapter-3-comments-in-css/</link>
					<comments>https://www.dularsharma.com/chapter-3-comments-in-css/#respond</comments>
		
		<dc:creator><![CDATA[Dular Sharma]]></dc:creator>
		<pubDate>Mon, 11 May 2020 10:59:00 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">https://www.dularsharma.com/?p=5882</guid>

					<description><![CDATA[122 Views There are two ways to add comments in CSS file. 1. Single Line Comment: 2. Multiple Line Comment:]]></description>
										<content:encoded><![CDATA[<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 122</span><span class='epvc-label'> Views</span></div>
<p>There are two ways to add comments in CSS file.</p>



<p><strong><mark style="background-color:rgba(0, 0, 0, 0);color:#0000ff" class="has-inline-color">1. Single Line Comment</mark></strong>:</p>



<ol class="wp-block-list"></ol>



<pre class="wp-block-code"><code>p {
    color: Black; /* This is a Comment*/
}</code></pre>



<p><strong><mark style="background-color:rgba(0, 0, 0, 0);color:#0000ff" class="has-inline-color">2. Multiple Line Comment</mark></strong>:</p>



<pre class="wp-block-code"><code>/* This is 
   how you add
   multiple line 
   comments
*/
P {
  color: Black;
}</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dularsharma.com/chapter-3-comments-in-css/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Chapter 2. Font Properties</title>
		<link>https://www.dularsharma.com/chapter-2-font-properties/</link>
					<comments>https://www.dularsharma.com/chapter-2-font-properties/#respond</comments>
		
		<dc:creator><![CDATA[Dular Sharma]]></dc:creator>
		<pubDate>Sun, 10 May 2020 11:50:00 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">https://www.dularsharma.com/?p=5814</guid>

					<description><![CDATA[135 Views CSS font properties offer developers the ability to customize the appearance and style of text on a webpage. These properties enable adjustments to the size, style, color, and more. For example, developers can emphasize specific text by making it bold. Likewise, changing the font style from normal (straight) to italics (tilted) is also [&#8230;]]]></description>
										<content:encoded><![CDATA[<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 135</span><span class='epvc-label'> Views</span></div>
<p>CSS font properties offer developers the ability to customize the appearance and style of text on a webpage. These properties enable adjustments to the size, style, color, and more. For example, developers can emphasize specific text by making it bold. Likewise, changing the font style from normal (straight) to italics (tilted) is also achievable. By leveraging font properties, various adjustments can be made to the typography on a webpage. Therefore, it&#8217;s essential to understand the different font properties available in CSS in order to effectively manipulate text appearance and achieve desired design outcomes.</p>



<p class="has-text-color has-link-color wp-elements-9c0fa74295f96dc4506fc3e9c785e99b" style="color:#00008b"><strong>Parameter Details for Font Properties:</strong></p>



<ul class="wp-block-list">
<li><mark style="background-color:rgba(0, 0, 0, 0);color:#970c10" class="has-inline-color"><strong>font-style</strong>:</mark> Specifies whether the font should be displayed in italics or oblique.</li>



<li><mark style="background-color:rgba(0, 0, 0, 0);color:#970c10" class="has-inline-color"><strong>font-variant</strong>:</mark> Determines if the font should be displayed in normal or small-caps style.</li>



<li><strong><mark style="background-color:rgba(0, 0, 0, 0);color:#970c10" class="has-inline-color">font-weight</mark></strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">:</mark> Defines the weight of the font, which can be normal, bold, or a numeric value ranging from 100 to 900.</li>



<li><mark style="background-color:rgba(0, 0, 0, 0);color:#970c10" class="has-inline-color"><strong>font-size</strong>:</mark> Specifies the size of the font, which can be represented in %, px, em, or other valid CSS measurements.</li>



<li><mark style="background-color:rgba(0, 0, 0, 0);color:#970c10" class="has-inline-color"><strong>line-height</strong>:</mark> Sets the height of each line of text, expressed in %, px, em, or other valid CSS measurements.</li>



<li><mark style="background-color:rgba(0, 0, 0, 0);color:#970c10" class="has-inline-color"><strong>font-family</strong>:</mark> Specifies the name of the font family to be used.</li>



<li><mark style="background-color:rgba(0, 0, 0, 0);color:#970c10" class="has-inline-color"><strong>color</strong>:</mark> Determines the color of the text using valid CSS color representations such as red, #00FF00, or hsl(240, 100%, 50%).</li>



<li><strong><mark style="background-color:rgba(0, 0, 0, 0);color:#970c10" class="has-inline-color">font-stretch</mark></strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-amber-color">:</mark> Controls whether to use a condensed or expanded font face, with options including normal, ultra condensed, extra-condensed, condensed, semi-condensed, semi-expanded, expanded, extra-expanded, or ultra-expanded.</li>



<li><mark style="background-color:rgba(0, 0, 0, 0);color:#970c10" class="has-inline-color"><strong>text-align</strong>:</mark> Defines the alignment of the text within its container, options include start, end, left, right, center, justify, or match-parent.</li>



<li><mark style="background-color:rgba(0, 0, 0, 0);color:#970c10" class="has-inline-color"><strong>text-decoration</strong>:</mark> Specifies decorations to be applied to the text, such as none, underline, overline, line-through, initial, or inherit.</li>
</ul>



<pre class="wp-block-code"><code>p{
    font-size: 25px;
    font-family: 'Courier New', Courier, monospace;
    font-style: italic;
    font-weight: 200;
    line-height: normal;
    color: aqua;
    font-stretch: normal;
    text-align: center;
    text-decoration: dashed;
}</code></pre>



<p>You can have all your font-related styles in one declaration with the font shorthand. Simply use the font property, and put your values in the correct order.</p>



<pre class="wp-block-code"><code>element {
font: &#91;font-style] &#91;font-variant] &#91;font-weight] &#91;font-size/line-height] &#91;font-family];
}</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dularsharma.com/chapter-2-font-properties/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Chapter 1. External Stylesheet</title>
		<link>https://www.dularsharma.com/chapter-2-external-stylesheet/</link>
					<comments>https://www.dularsharma.com/chapter-2-external-stylesheet/#respond</comments>
		
		<dc:creator><![CDATA[Dular Sharma]]></dc:creator>
		<pubDate>Sat, 09 May 2020 12:23:00 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">https://www.dularsharma.com/?p=5795</guid>

					<description><![CDATA[134 Views You can apply an external CSS stylesheet to multiple HTML documents by using a &#60;link&#62; element in each HTML file. In the &#60;link&#62; tag, set the rel attribute to &#8220;stylesheet&#8221; and the href attribute to the relative or absolute path of the stylesheet. While it&#8217;s generally preferred to use relative URL paths, absolute [&#8230;]]]></description>
										<content:encoded><![CDATA[<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 134</span><span class='epvc-label'> Views</span></div>
<p>You can apply an external CSS stylesheet to multiple HTML documents by using a <strong data-renderer-mark="true">&lt;link&gt;</strong> element in each HTML file. In the <strong data-renderer-mark="true">&lt;link&gt;</strong> tag, set the <strong data-renderer-mark="true">rel </strong>attribute to &#8220;<strong data-renderer-mark="true">stylesheet</strong>&#8221; and the <strong data-renderer-mark="true">href </strong>attribute to the relative or absolute path of the stylesheet. While it&#8217;s generally preferred to use relative URL paths, absolute paths can also be used. In HTML5, the <strong data-renderer-mark="true">type </strong>attribute can be omitted.</p>



<p>It&#8217;s recommended to place the <strong data-renderer-mark="true">&lt;link&gt;</strong> tag in the <strong data-renderer-mark="true">&lt;head&gt;</strong> section of the HTML file so that the styles are loaded before the elements they style. This prevents users from seeing un styled content when the page loads.</p>



<p>For example, in your HTML file (index.html), you would include the following code in the <strong data-renderer-mark="true">&lt;head&gt; </strong>section:</p>



<pre class="wp-block-code"><code>&lt;div class="code-block  cc-ceksvt">
&lt;div class="cc-9n57oc">
&lt;div class="cc-v2tmjh">
&lt;div role="presentation">&amp;nbsp;&lt;/div>
&lt;div role="presentation">
&lt;div>&amp;nbsp;&lt;/div>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;pre>&lt;span class="prismjs cc-49loy0" data-code-lang="xml" data-ds--code--code-block="" data-testid="renderer-code-block">&lt;code class="language-xml">&lt;span class="" data-testid="renderer-code-block-line-1" data-ds--code--row="">&lt;span class="token doctype token punctuation">&amp;lt;!&lt;/span>&lt;span class="token doctype token doctype-tag">DOCTYPE&lt;/span> &lt;span class="token doctype token name">html&lt;/span>&lt;span class="token doctype token punctuation">&amp;gt;&lt;/span>&lt;br>
&lt;/span>&lt;span class="" data-testid="renderer-code-block-line-2" data-ds--code--row="">&lt;span class="token tag token tag token punctuation">&amp;lt;&lt;/span>&lt;span class="token tag token tag">html&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span>&lt;br>
&lt;/span>&lt;span class="" data-testid="renderer-code-block-line-3" data-ds--code--row="">&lt;span class="token tag token tag token punctuation">&amp;lt;&lt;/span>&lt;span class="token tag token tag">head&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span>&lt;br>
&lt;/span>&lt;span class="" data-testid="renderer-code-block-line-4" data-ds--code--row="">&lt;span class="token tag token tag token punctuation">&amp;lt;&lt;/span>&lt;span class="token tag token tag">meta&lt;/span> &lt;span class="token tag token attr-name">charset&lt;/span>&lt;span class="token tag token attr-value token punctuation attr-equals">=&lt;/span>&lt;span class="token tag token attr-value token punctuation">"&lt;/span>&lt;span class="token tag token attr-value">utf-8&lt;/span>&lt;span class="token tag token attr-value token punctuation">"&lt;/span> &lt;span class="token tag token punctuation">/&amp;gt;&lt;/span>&lt;br>
&lt;/span>&lt;span class="" data-testid="renderer-code-block-line-5" data-ds--code--row="">&lt;span class="token tag token tag token punctuation">&amp;lt;&lt;/span>&lt;span class="token tag token tag">link&lt;/span> &lt;span class="token tag token attr-name">rel&lt;/span>&lt;span class="token tag token attr-value token punctuation attr-equals">=&lt;/span>&lt;span class="token tag token attr-value token punctuation">"&lt;/span>&lt;span class="token tag token attr-value">stylesheet&lt;/span>&lt;span class="token tag token attr-value token punctuation">"&lt;/span> &lt;span class="token tag token attr-name">type&lt;/span>&lt;span class="token tag token attr-value token punctuation attr-equals">=&lt;/span>&lt;span class="token tag token attr-value token punctuation">"&lt;/span>&lt;span class="token tag token attr-value">text/css&lt;/span>&lt;span class="token tag token attr-value token punctuation">"&lt;/span> &lt;span class="token tag token attr-name">href&lt;/span>&lt;span class="token tag token attr-value token punctuation attr-equals">=&lt;/span>&lt;span class="token tag token attr-value token punctuation">"&lt;/span>&lt;span class="token tag token attr-value">style.css&lt;/span>&lt;span class="token tag token attr-value token punctuation">"&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span>&lt;br>
&lt;/span>&lt;span class="" data-testid="renderer-code-block-line-6" data-ds--code--row="">&lt;span class="token tag token tag token punctuation">&amp;lt;/&lt;/span>&lt;span class="token tag token tag">head&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span>&lt;br>
&lt;/span>&lt;span class="" data-testid="renderer-code-block-line-7" data-ds--code--row="">  &lt;span class="token tag token tag token punctuation">&amp;lt;&lt;/span>&lt;span class="token tag token tag">body&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span>&lt;br>
&lt;/span>&lt;span class="" data-testid="renderer-code-block-line-8" data-ds--code--row="">    &lt;span class="token tag token tag token punctuation">&amp;lt;&lt;/span>&lt;span class="token tag token tag">h1&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span>This is the HTML Web Page&lt;span class="token tag token tag token punctuation">&amp;lt;/&lt;/span>&lt;span class="token tag token tag">h1&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span>&lt;br>
&lt;/span>&lt;span class="" data-testid="renderer-code-block-line-9" data-ds--code--row="">    &lt;span class="token tag token tag token punctuation">&amp;lt;&lt;/span>&lt;span class="token tag token tag">p&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span> External CSS has been added in this HTML Web Page&lt;span class="token tag token tag token punctuation">&amp;lt;/&lt;/span>&lt;span class="token tag token tag">p&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span>&lt;br>
&lt;/span>&lt;span class="" data-testid="renderer-code-block-line-10" data-ds--code--row="">  &lt;span class="token tag token tag token punctuation">&amp;lt;/&lt;/span>&lt;span class="token tag token tag">body&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span>&lt;br>
&lt;/span>&lt;span class="" data-testid="renderer-code-block-line-11" data-ds--code--row="">&lt;span class="token tag token tag token punctuation">&amp;lt;/&lt;/span>&lt;span class="token tag token tag">html&lt;/span>&lt;span class="token tag token punctuation">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/span>&lt;/pre>
&lt;/div></code></pre>



<p>And in your CSS file (style.css), you can define styles for elements like headings and paragraphs:</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<div class="code-block  cc-ceksvt">
<div class="cc-9n57oc">
<div class="cc-v2tmjh">
<div role="presentation">&nbsp;</div>
<div role="presentation">
<div>&nbsp;</div>
</div>
</div>
</div>
<p><span class="prismjs cc-1j55rvq" data-code-lang="css" data-ds--code--code-block="" data-testid="renderer-code-block"><code class="language-css"><span class="" data-testid="renderer-code-block-line-1" data-ds--code--row=""><span class="token selector">h1</span> <span class="token punctuation">{</span><br>
</span><span class="" data-testid="renderer-code-block-line-2" data-ds--code--row=""><span class="token property">color</span><span class="token punctuation">:</span> <span class="token color">red</span><span class="token punctuation">;</span><br>
</span><span class="" data-testid="renderer-code-block-line-3" data-ds--code--row=""><span class="token property">text-decoration</span><span class="token punctuation">:</span> underline<span class="token punctuation">;</span><br>
</span><span class="" data-testid="renderer-code-block-line-4" data-ds--code--row=""><span class="token punctuation">}</span><br>
</span><span class="" data-testid="renderer-code-block-line-5" data-ds--code--row=""><span class="token selector">p</span> <span class="token punctuation">{</span><br>
</span><span class="" data-testid="renderer-code-block-line-6" data-ds--code--row=""><span class="token property">font-size</span><span class="token punctuation">:</span> <span class="token number">25</span><span class="token unit">px</span><span class="token punctuation">;</span><br>
</span><span class="" data-testid="renderer-code-block-line-7" data-ds--code--row=""><span class="token property">font-family</span><span class="token punctuation">:</span> <span class="token string">'Trebuchet MS'</span><span class="token punctuation">,</span> sans-serif<span class="token punctuation">;</span><br>
</span><span class="" data-testid="renderer-code-block-line-8" data-ds--code--row=""><span class="token punctuation">}</span></span></code></span></p>
</div>
</div>
</div>



<p>Ensure that you provide the correct path to your CSS file in the <strong data-renderer-mark="true">href </strong>attribute. If the CSS file is in the same folder as your HTML file, no path is required. Otherwise, specify the folder name followed by the file name like</p>



<div class="code-block  cc-ceksvt">
<div class="cc-9n57oc">
<div class="cc-v2tmjh">
<div role="presentation">&nbsp;</div>
<div role="presentation">
<div>&nbsp;</div>
</div>
</div>
</div>
<p><span class="prismjs cc-1j55rvq" data-code-lang="" data-ds--code--code-block="" data-testid="renderer-code-block"><code class="language-"><span class="" data-testid="renderer-code-block-line-1" data-ds--code--row="">&lt;link rel="stylesheet" type="text/css" href="folder/style.css"&gt;</span></code></span></p>
</div>



<p>Using external stylesheets is the preferred method for managing CSS. Why? Imagine you have a website with 100 pages, all controlled by one stylesheet. If you need to change the link colors from blue to green, it&#8217;s much simpler to update the CSS file once and have the changes apply across all 1000 pages.</p>



<p>Conversely, modifying each page individually would be tedious and time-consuming. Moreover, if you decide to completely overhaul your website&#8217;s appearance, you only need to modify this one file.</p>



<p>You can link as many CSS files as necessary in your HTML page. For instance:</p>



<div class="code-block  cc-ceksvt">
<div class="cc-9n57oc">
<div class="cc-v2tmjh">
<div role="presentation">&nbsp;</div>
<div role="presentation">
<div>&nbsp;</div>
</div>
</div>
</div>
<p><span class="prismjs cc-1j55rvq" data-code-lang="xml" data-ds--code--code-block="" data-testid="renderer-code-block"><code class="language-xml"><span class="" data-testid="renderer-code-block-line-1" data-ds--code--row=""><span class="token tag token tag token punctuation">&lt;</span><span class="token tag token tag">link</span> <span class="token tag token attr-name">rel</span><span class="token tag token attr-value token punctuation attr-equals">=</span><span class="token tag token attr-value token punctuation">"</span><span class="token tag token attr-value">stylesheet</span><span class="token tag token attr-value token punctuation">"</span> <span class="token tag token attr-name">type</span><span class="token tag token attr-value token punctuation attr-equals">=</span><span class="token tag token attr-value token punctuation">"</span><span class="token tag token attr-value">text/css</span><span class="token tag token attr-value token punctuation">"</span> <span class="token tag token attr-name">href</span><span class="token tag token attr-value token punctuation attr-equals">=</span><span class="token tag token attr-value token punctuation">"</span><span class="token tag token attr-value">style1.css</span><span class="token tag token attr-value token punctuation">"</span><span class="token tag token punctuation">&gt;</span><br>
</span><span class="" data-testid="renderer-code-block-line-2" data-ds--code--row=""><span class="token tag token tag token punctuation">&lt;</span><span class="token tag token tag">link</span> <span class="token tag token attr-name">rel</span><span class="token tag token attr-value token punctuation attr-equals">=</span><span class="token tag token attr-value token punctuation">"</span><span class="token tag token attr-value">stylesheet</span><span class="token tag token attr-value token punctuation">"</span> <span class="token tag token attr-name">type</span><span class="token tag token attr-value token punctuation attr-equals">=</span><span class="token tag token attr-value token punctuation">"</span><span class="token tag token attr-value">text/css</span><span class="token tag token attr-value token punctuation">"</span> <span class="token tag token attr-name">href</span><span class="token tag token attr-value token punctuation attr-equals">=</span><span class="token tag token attr-value token punctuation">"</span><span class="token tag token attr-value">style2.css</span><span class="token tag token attr-value token punctuation">"</span><span class="token tag token punctuation">&gt;</span></span></code></span></p>
</div>



<p>CSS rules follow a specific order, with later rules overriding earlier ones. For example, if you have a <strong data-renderer-mark="true">style1.css</strong> file with styling for paragraphs with the class &#8216;red&#8217;:</p>



<div class="code-block  cc-ceksvt">
<div class="cc-9n57oc">
<div class="cc-v2tmjh">
<div role="presentation">&nbsp;</div>
<div role="presentation">
<div>&nbsp;</div>
</div>
</div>
</div>
<p><span class="prismjs cc-1j55rvq" data-code-lang="css" data-ds--code--code-block="" data-testid="renderer-code-block"><code class="language-css"><span class="" data-testid="renderer-code-block-line-1" data-ds--code--row=""><span class="token selector">p</span><span class="token selector token class">.red</span> <span class="token punctuation">{</span> <span class="token property">color</span><span class="token punctuation">:</span> <span class="token hexcode color">#FF0000</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></span></code></span></p>
</div>



<p>You can override this in another CSS file, such as <strong data-renderer-mark="true">style2.css:</strong></p>



<div class="code-block  cc-ceksvt">
<div class="cc-9n57oc">
<div class="cc-v2tmjh">
<div role="presentation">&nbsp;</div>
<div role="presentation">
<div>&nbsp;</div>
</div>
</div>
</div>
<p><span class="prismjs cc-1j55rvq" data-code-lang="css" data-ds--code--code-block="" data-testid="renderer-code-block"><code class="language-css"><span class="" data-testid="renderer-code-block-line-1" data-ds--code--row=""><span class="token selector">p</span><span class="token selector token class">.yellow</span> <span class="token punctuation">{</span> <span class="token property">color</span><span class="token punctuation">:</span> <span class="token hexcode color">#FFFF00</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></span></code></span></p>
</div>



<p>Now, paragraphs with the &#8216;yellow&#8217; class will be displayed in a yellow color.</p>



<p>Additional concepts like the &#8216;!important&#8217; rule, specificity, and inheritance also play a role in CSS styling.</p>



<p>When a visitor accesses your website, their browser downloads the HTML and linked CSS file. Subsequent page visits only require downloading the HTML, as the CSS file is cached. This caching improves page loading speed, resulting in a smoother user experience.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dularsharma.com/chapter-2-external-stylesheet/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Versions and Releases</title>
		<link>https://www.dularsharma.com/versions-and-releases-2/</link>
					<comments>https://www.dularsharma.com/versions-and-releases-2/#respond</comments>
		
		<dc:creator><![CDATA[Dular Sharma]]></dc:creator>
		<pubDate>Fri, 08 May 2020 11:21:00 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">https://www.dularsharma.com/?p=5782</guid>

					<description><![CDATA[136 Views]]></description>
										<content:encoded><![CDATA[<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 136</span><span class='epvc-label'> Views</span></div>
<ul class="wp-block-list">
<li><span style="color: #0000ff;"><strong>CSS 1.0</strong> </span>&#8211; 
<ul class="wp-block-list">
<li>Basic styling capabilities such as font, color, and background properties.</li>



<li>Support for text formatting like alignment and spacing.</li>



<li>Limited layout control with properties like margin and padding.</li>
</ul>
</li>



<li><span style="color: #0000ff;"><strong>CSS 2.0</strong> </span>&#8211; Release Date: 1995-11-24
<ul class="wp-block-list">
<li>Enhanced layout options including positioning and floating elements.</li>



<li>Introduction of selectors like child, adjacent sibling, and attribute selectors.</li>



<li>Support for media-specific stylesheets using media queries.</li>
</ul>
</li>



<li><span style="color: #0000ff;"><strong>CSS 3.2</strong></span> &#8211; Release Date: 1997-01-14
<ul class="wp-block-list">
<li>Further refinement of selectors including attribute value selectors and pseudo-elements.</li>



<li>Introduction of the <code>@font-face</code> rule for custom font usage.</li>



<li>Expanded support for dynamic effects through transitions and animations.</li>
</ul>
</li>



<li><span style="color: #0000ff;"><strong>CSS 4.0</strong></span> &#8211; Release Date: 1998-04-24
<ul class="wp-block-list">
<li>Continued evolution of selectors with additions like subject selectors and parent selectors.</li>



<li>Introduction of new layout modules like Grid Layout and Flexbox.</li>



<li>Enhanced support for responsive design through viewport-relative units.</li>
</ul>
</li>



<li><span style="color: #0000ff;"><strong>CSS 4.01</strong></span> &#8211; Release Date: 1999-12-24
<ul class="wp-block-list">
<li>Focus on refining existing features and addressing inconsistencies.</li>



<li>Improvements in browser compatibility and standards compliance.</li>



<li>Some minor additions and clarifications to the specification.</li>
</ul>
</li>



<li><span style="color: #0000ff;"><strong>CSS 5</strong></span> &#8211; Release Date: 2014-10-28
<ul class="wp-block-list">
<li>Continued development of layout modules with improvements to Grid Layout and Flexbox.</li>



<li>Introduction of new features such as CSS Variables and Custom Properties.</li>



<li>Further enhancements to animations and transitions.</li>
</ul>
</li>



<li><span style="color: #0000ff;"><strong>CSS 5.1</strong></span> &#8211; Release Date: 2016-11-01
<ul class="wp-block-list">
<li>Refinements and clarifications to existing specifications.</li>



<li>Introduction of new features like <span style="color: #ffcc00;"><code><strong>:has()</strong></code></span> selector for complex querying.</li>



<li>Improved support for internationalization and accessibility features.</li>
</ul>
</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dularsharma.com/versions-and-releases-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
