<?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 background Archives - Artificial Intelligence</title>
	<atom:link href="https://www.aiuniverse.xyz/tag/css-background/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.aiuniverse.xyz/tag/css-background/</link>
	<description>Exploring the universe of Intelligence</description>
	<lastBuildDate>Fri, 31 Mar 2023 10:21:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>CSS Properties and its types</title>
		<link>https://www.aiuniverse.xyz/css-properties/</link>
					<comments>https://www.aiuniverse.xyz/css-properties/#respond</comments>
		
		<dc:creator><![CDATA[Maruti Kr.]]></dc:creator>
		<pubDate>Fri, 31 Mar 2023 10:13:46 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[background-image]]></category>
		<category><![CDATA[css background]]></category>
		<category><![CDATA[css background-attachment]]></category>
		<category><![CDATA[css background-color]]></category>
		<category><![CDATA[css background-position]]></category>
		<category><![CDATA[css background-repeat]]></category>
		<category><![CDATA[css propreties]]></category>
		<category><![CDATA[how to set background-position]]></category>
		<category><![CDATA[how to use background-attachment]]></category>
		<category><![CDATA[how to use background-color]]></category>
		<category><![CDATA[how to use background-color in css]]></category>
		<category><![CDATA[what is background-color]]></category>
		<category><![CDATA[what is css background]]></category>
		<guid isPermaLink="false">https://www.aiuniverse.xyz/?p=16257</guid>

					<description><![CDATA[<p>What is CSS Background CSS background property is used to set the background color, image, or other properties for an HTML element. Syntax: There are 5 CSS <a class="read-more-link" href="https://www.aiuniverse.xyz/css-properties/">Read More</a></p>
<p>The post <a href="https://www.aiuniverse.xyz/css-properties/">CSS Properties and its types</a> appeared first on <a href="https://www.aiuniverse.xyz">Artificial Intelligence</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">What is CSS Background </h2>



<p class="wp-block-paragraph">CSS background property is used to set the background color, image, or other properties for an HTML element.</p>



<p class="wp-block-paragraph"><strong>Syntax: </strong></p>



<pre class="wp-block-code"><code>selector {
  background: value;
}
</code></pre>



<p class="wp-block-paragraph">There are 5 CSS background properties used in HTML elements:</p>



<ol class="wp-block-list">
<li>background-color</li>



<li>background-image</li>



<li>background-repeat</li>



<li>background-attachment</li>



<li>background-position</li>
</ol>



<h2 class="wp-block-heading">1. CSS Background-color:</h2>



<p class="wp-block-paragraph">Background- color is used to <strong>sets the color of the background</strong> in html document.</p>



<p class="wp-block-paragraph"><strong>For Example:</strong></p>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;  
&lt;html&gt;  
&lt;head&gt;  
&lt;style&gt;  
h2,p{  
    background-color: skyblue;  
}  
&lt;/style&gt;  
&lt;/head&gt;  
&lt;body&gt;  
&lt;h2&gt;This is an example of CSS background-color &lt;/h2&gt;  
&lt;p&gt;Welcome to Cotocus vlogs: Cotocus with the help of technology, trying to resolve the mutilple problems - we are facing in healthcare, tech education, professional services, travel and in digital domain with our products such as MyHospitalnow, DevOpsSchool, Professnow, HolidayLandmark and Wizbrand. &lt;/p&gt;  
&lt;/body&gt;  
&lt;/html&gt;   </code></pre>



<p class="wp-block-paragraph"><strong>Output:</strong></p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="530" src="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture2-1-1024x530.png" alt="" class="wp-image-16258" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture2-1-1024x530.png 1024w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture2-1-300x155.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture2-1-768x398.png 768w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture2-1-1170x606.png 1170w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture2-1.png 1357w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">2. CSS Background-image:</h2>



<p class="wp-block-paragraph">Background-image is used to sets the image to be used as the background.</p>



<p class="wp-block-paragraph">For Example:</p>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;  
&lt;html&gt;  
&lt;head&gt;  
&lt;style&gt;  
body {  
background-image: url("https://imgs.search.brave.com/-TMDeYu36R4sCyI8Rtem8SD0xhw8jW3OBsVGuFCmnyw/rs:fit:1200:1200:1/g:ce/aHR0cHM6Ly9pLnJl/ZGQuaXQvbWNtMndz/aG45aDQyMS5qcGc");  
margin-left:100px;  
}  
&lt;/style&gt;  
&lt;/head&gt;  
&lt;body&gt;  
&lt;h1&gt;Welcome to Cotocus&lt;/h1&gt;  
&lt;/body&gt;  
&lt;/html&gt;       </code></pre>



<p class="wp-block-paragraph"><strong>Output:</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="525" src="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture3-1-1024x525.png" alt="" class="wp-image-16259" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture3-1-1024x525.png 1024w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture3-1-300x154.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture3-1-768x394.png 768w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture3-1.png 1365w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">3. CSS <strong>B</strong>ackground-repeat:</h2>



<p class="wp-block-paragraph">Background-repeat specifies how the background image should repeat, By default, the&nbsp;<code>background-image</code>&nbsp;property repeats an image both horizontally and vertically.</p>



<p class="wp-block-paragraph"><strong>background-repeat: repeat-x;</strong><a href="https://www.javatpoint.com/css-background#"></a><a href="https://www.javatpoint.com/css-background#"></a><a href="https://www.javatpoint.com/css-background#"></a></p>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;  
&lt;html&gt;  
&lt;head&gt;  
&lt;style&gt;  
body {  
    background-image: url("https://imgs.search.brave.com/N4vU7o72Bro0dujs8_FKwSWu9pJ53G9tsQ7JB0uhdqs/rs:fit:844:225:1/g:ce/aHR0cHM6Ly90c2Uz/Lm1tLmJpbmcubmV0/L3RoP2lkPU9JUC5w/bExaZV8teWVaSFVM/QUhlZTRNXzdBSGFF/SyZwaWQ9QXBp");  
    background-repeat: repeat-x;  
}  
&lt;/style&gt;  
&lt;/head&gt;  
&lt;body&gt;  
&lt;h1&gt;Hello World&lt;/h1&gt;  
&lt;/body&gt;  
&lt;/html&gt;   
</code></pre>



<p class="wp-block-paragraph"><strong>Output:</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="531" src="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture4-1-1024x531.png" alt="" class="wp-image-16262" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture4-1-1024x531.png 1024w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture4-1-300x156.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture4-1-768x398.png 768w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture4-1-1170x606.png 1170w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/Capture4-1.png 1365w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"><strong>background-repeat: repeat-y;</strong></p>



<p class="wp-block-paragraph"><a href="https://www.javatpoint.com/css-background#"></a><a href="https://www.javatpoint.com/css-background#"></a><a href="https://www.javatpoint.com/css-background#"></a></p>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;  
&lt;html&gt;  
&lt;head&gt;  
&lt;style&gt;  
body {  
    background-image: url("https://imgs.search.brave.com/N4vU7o72Bro0dujs8_FKwSWu9pJ53G9tsQ7JB0uhdqs/rs:fit:844:225:1/g:ce/aHR0cHM6Ly90c2Uz/Lm1tLmJpbmcubmV0/L3RoP2lkPU9JUC5w/bExaZV8teWVaSFVM/QUhlZTRNXzdBSGFF/SyZwaWQ9QXBp");  
    background-repeat: repeat-y;  
}  
&lt;/style&gt;  
&lt;/head&gt;  
&lt;body&gt;  
&lt;h1&gt;Hello World&lt;/h1&gt;  
&lt;/body&gt;  
&lt;/html&gt;   </code></pre>



<p class="wp-block-paragraph">Output:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="531" src="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/5-1024x531.png" alt="" class="wp-image-16263" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/5-1024x531.png 1024w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/5-300x155.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/5-768x398.png 768w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/5-1170x606.png 1170w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/5.png 1366w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">4. CSS <strong>B</strong>ackground-attachment:</h2>



<p class="wp-block-paragraph">CSS background-attachment property is used to specify if the background image is fixed or scroll with the rest of the page in browser window. If you set fixed the background image then the image will not move during scrolling in the browser.&nbsp;</p>



<p class="wp-block-paragraph"><strong>For Example:</strong></p>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
    &lt;style&gt;
        body {
            background-image: url("https://imgs.search.brave.com/6kg_qF6UH5j7I-Qi5yKYWAXOVzRT1D6SfDbZuPHBxrI/rs:fit:1043:985:1/g:ce/aHR0cHM6Ly93YWxs/cGFwZXJjYXZlLmNv/bS93cC93cDI1ODg3/OTAuanBn");
            background-repeat: no-repeat;
            background-position: right top;
            background-attachment: fixed;


       }
    &lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;h1&gt; Background-attachment Example&lt;/h1&gt;

    &lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
    &lt;style&gt;
        body {
            background-image: url("https://imgs.search.brave.com/6kg_qF6UH5j7I-Qi5yKYWAXOVzRT1D6SfDbZuPHBxrI/rs:fit:1043:985:1/g:ce/aHR0cHM6Ly93YWxs/cGFwZXJjYXZlLmNv/bS93cC93cDI1ODg3/OTAuanBn");
            background-repeat: no-repeat;
            background-position: right top;
            background-attachment: fixed;


        }
    &lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;h2&gt; Background-attachment Example&lt;/h2&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt;
    &lt;p&gt;This is a fixed background-image. Scroll down the page.&lt;/p&gt; 
&lt;/body&gt;
&lt;/html&gt;
&lt;/body&gt;

&lt;/html&gt;</code></pre>



<p class="wp-block-paragraph"><strong>Output:</strong></p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1366" height="742" data-id="16267" src="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/6-1024x556.png" alt="" class="wp-image-16267" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/6-1024x556.png 1024w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/6-300x163.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/6-768x417.png 768w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/6.png 1366w" sizes="auto, (max-width: 1366px) 100vw, 1366px" /></figure>
</figure>



<h2 class="wp-block-heading">5. CSS <strong>B</strong>ackground-position:</h2>



<p class="wp-block-paragraph">CSS Background-position are used to sets the position of the background image. default, the background image is placed on the top-left of the webpage.</p>



<p class="wp-block-paragraph">You can set the following positions:</p>



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



<li>top</li>



<li>bottom</li>



<li>left</li>



<li>right</li>
</ol>



<p class="wp-block-paragraph"><strong>For Example:</strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;style&gt;
body  {
background: white url('https://imgs.search.brave.com/jBL2LMSlM6RfxpNvAiutLBMeFHkzsnzhx-FvPJWX2sg/rs:fit:1200:800:1/g:ce/aHR0cDovLzMuYnAu/YmxvZ3Nwb3QuY29t/Ly1ZSTN3b1lpaFRl/WS9WUlc3endZRG9l/SS9BQUFBQUFBQUFS/QS9DWGtocUhFMW05/TS9zMTYwMC9DdXRl/LUJlYXV0aWZ1bC1H/aXJsLUJhYnktSW1h/Z2VzLmpwZw');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;   
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;
&lt;p&gt;This is background position example, Scroll down the page.&lt;/p&gt;


&lt;/body&gt;
&lt;/html&gt;  
</code></pre>



<p class="wp-block-paragraph"><strong>Output:</strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="558" src="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/7-1024x558.png" alt="" class="wp-image-16269" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2023/03/7-1024x558.png 1024w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/7-300x163.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/7-768x418.png 768w, https://www.aiuniverse.xyz/wp-content/uploads/2023/03/7.png 1366w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.aiuniverse.xyz/css-properties/">CSS Properties and its types</a> appeared first on <a href="https://www.aiuniverse.xyz">Artificial Intelligence</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.aiuniverse.xyz/css-properties/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
