<?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>Dreamweaver, Flash, Photoshop, CSS, Fireworks and HTML Tips &#38; Tricks &#187; body</title>
	<atom:link href="http://www.livetrainingsession.com/tips/tag/body/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.livetrainingsession.com/tips</link>
	<description>Get Quick Tips &#38; Tricks on Web Applications Development Tools</description>
	<lastBuildDate>Thu, 29 Jul 2010 21:16:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>CSS Body Background Color and Background Image</title>
		<link>http://www.livetrainingsession.com/tips/2010/01/css-body-background-color-and-background-image/</link>
		<comments>http://www.livetrainingsession.com/tips/2010/01/css-body-background-color-and-background-image/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 19:19:01 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips and Tricks]]></category>
		<category><![CDATA[HTML Tips]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[body]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[image]]></category>

		<guid isPermaLink="false">http://www.livetrainingsession.com/tips/?p=47</guid>
		<description><![CDATA[This post shows you how to use the HTML body tag to add a background color that covers the entire browser's viewport and create a contrast between your web page and the remainder of the screen. You will also learn to add a background image to the body tag to create more visual effects.]]></description>
			<content:encoded><![CDATA[<p>You certainly know the HTML &#8221;<em><strong>&lt;body&gt;</strong></em>&#8221; tag is the topmost container box that wraps your web page design elements and content. Of course we can all agree that the <em>&#8220;</em><strong><em>&lt;html&gt;</em></strong><em>&#8221; tag is the topmost parent element of the HTML DOM</em>.  So let me reformulate my previous statement to satisfy the geek within you:<em> the body is the closest parent to HTML elements in  your web page content</em>. You can use the body tag to change your web page background color from the default &#8220;white&#8221;.</p>
<p><span id="more-47"></span></p>
<p>To add a background color that covers the entire web browser&#8217;s viewport,  set a background  property to the HTML body tag:<br />
<span style="font-style: italic; font-weight: bold; color: #ea9d14;"> body {<br />
background-color: #333333 ;<br />
}<br />
<span style="color: #000000; font-style: normal; font-weight: normal;">That create dark grey background color (#333333).</span></span><br />
Applying a background color to the body tag  add more contrast between  your web page content and the remainder of the screen particularly with fixed width CSS layouts.  In general, using a CSS background color is the easiest way to &#8220;colorize&#8221; a given block of content without adding much to your web page download time.</p>
<p>You can also add a background image to your web page body using the CSS style.<br />
<span style="font-style: italic; font-weight: bold; color: #ea9d14;">body {<br />
background-image: url(images/bgbody.gif) ;<br />
}</span><br />
The <em>url</em> parameter defines the relative path to the graphic used as a background image.<br />
That file&#8217;s path can be absolute (i.e. <em>http://livetrainingsession.com/images/bgbody.gi</em>f  or <em>/images/bgbody.gif</em>) or <em><strong>relative to the location the CSS style</strong></em> as show above.<br />
Feel free to copy and paste that absolute path nto your web browser&#8217;s address bar to see the actual background image.</p>
<p>In this instance the web page uses a very small graphic made of dark-grey patterns. You can see that tiling bleeding through the left and right edges of this web page if your display width is greater than 980 pixels.</p>
<p>You can  simultaneously apply the background color and the background image to the body tag as well. You would write the CSS style as follow:<br />
<span style="font-style: italic; font-weight: bold; color: #ea9d14;"> body {<br />
background-color: #333333 ;<br />
background-image: url(images/bgbody.gif) ;<br />
}</span></p>
<p>or use a more compact,  shorthand version:<br />
<span style="font-style: italic; font-weight: bold; color: #ea9d14;">body {<br />
background: #333333  url(images/bgbody.gif) ;<br />
}<br />
</span><br />
<span style="font-style: normal;">or even more compact:<span style="font-style: italic; font-weight: bold; color: #ea9d14;"><br />
body {<br />
background: #333  url(images/bgbody.gif) ;<br />
}</span></span></p>
<p><em><span style="font-style: normal;">In this example, the background color is written in its compact form (#333). An hexadecimal value  made of three pairs of identical values (33) can be replaced by just three values (333), one for each pair. Hence &#8220;#999999&#8243; could be replace by &#8220;#999&#8243; and the color &#8220;#FFFFFF&#8221; can be written &#8220;#FFF&#8221;.</span></em></p>
<p><em><span style="font-style: normal;"><br />
It&#8217;s always a good idea to use a background color in conjunction with a background image. The web browser covers the &#8220;viewport&#8221; with the background color while downloading the background graphic. It&#8217;s not only for aesthetic but to avoid the visitor having to stare an empty white screen while the web page is loading.</span></em></p>
<p><em> </em></p>
<p><em><strong><em>It&#8217;s worth mentioning the background image is always displayed on top of the background color whenever the two are applied to the same HTML element. And it does not matter in which order they are defined.</em></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.livetrainingsession.com/tips/2010/01/css-body-background-color-and-background-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

