<?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>Saheltech Blog &#187; CSS Tips &amp; Tricks</title>
	<atom:link href="http://www.saheltech.com/blog/category/cascading-style-sheets/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.saheltech.com/blog</link>
	<description>Web Programming - Online Marketing - Multimedia Training</description>
	<lastBuildDate>Fri, 29 Jan 2010 03:15:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using CSS or Tables Web Page Layout</title>
		<link>http://www.saheltech.com/blog/20090706/using-css-or-tables-web-page-layout/</link>
		<comments>http://www.saheltech.com/blog/20090706/using-css-or-tables-web-page-layout/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 02:34:25 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips & Tricks]]></category>
		<category><![CDATA[Dreamweaver Tips]]></category>
		<category><![CDATA[Web Design Tips]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[floating]]></category>
		<category><![CDATA[layer]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[positioning]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.saheltech.com/blog/?p=67</guid>
		<description><![CDATA[I receive an email this morning from a client I just provided Dreamweaver Training to. Here it is:
 A quick question for you&#8230;I&#8217;m wondering about the differences between using tables, layers, and floating divs (is that what you call what we used yesterday with CSS?) When would someone want to use one vs. the others? [...]]]></description>
			<content:encoded><![CDATA[<!-- sphereit start --><p>I receive an email this morning from a client I just provided <a href="/training/dreamweaver.html">Dreamweaver Training</a> to.<br /> <strong>Here it is:</strong></p>
<p> <em>A quick question for you&#8230;I&#8217;m wondering about the differences between using tables, layers, and floating divs (is that what you call what we used yesterday with CSS?) When would someone want to use one vs. the others? Layers seem to be the easiest way to create your layout the way you want it, but I&#8217;m wondering what the drawbacks are to that? Also wondering how you might combine two or more methods to create your layout?</p>
<p><span id="more-67"></span></p>
<p> Thanks again Alex!<br /> It was great to work with you&#8230;</em></p>
<p> <strong>Here is in a nutshell my response:</strong></p>
<p> <em>Tables are more appropriate to present a grid-layout data just as you would display data in an Excel spreadsheet with rows and columns. As you will notice in the index.html file inside the portfolio folder, we use a table to display the content of that page because the information is presented as a grid. </p>
<p> </em><em>However using tables for the website layout is cumbersome. Tables take more time to display compared to DIV elements because all the rows and columns are tied together. The web browser has to make an extra effort to have all the cells in the right places taking into account all the rowspan and colspan that might be defined in the HTML markup.</p>
<p>You also have less control over the table layout unless you use invisible spacer images to force cells and rows to match the dimensions you specified. That can make your HTML markup as bloated as it can be.</p>
<p> On the other hand with CSS, you can separate the data (page content) from the presentation (layout). Using an external css file (i.e. layout.css) you can have a uniform look-and-feel throughout the entire site. But more importantly wen you decide to change a give style, you do it once in the CSS file and all pages sharing that style sheet will take effect of that changes: real time saver.</p>
<p>CSS makes your pages markup cleaner. The web page is just an aggregate of individual blocks you can position with pixel precision anywhere you want. You can move one block anywhere you want without pretty much affecting other blocks.</p>
<p> To use a simple metaphor, if designing a website with tables is like building a typical car, with CSS you bring in the capabilities of the &#8220;Transformers&#8221;. How cool is that!!<br /> That means, your website look-and-and-feel can be quickly changed in terms of fonts, colors, layout,.. from your external CSS file.</p>
<p> Now when we talk about layers or div tags they all mean pretty much the same thing as far as the layout is concerned.</p>
<p> The tag &quot;&lt;layer&gt;&#8230;&#8230;. &lt;/layer&gt;&quot; was introduced by Netscape when CSS was in its embryonic stage. That tag is no longer used today in XHTML.<br /> Using div tags as  containing boxes, you can stack them on top of each other using the z-Index (value defining the stacking order) and absolute positioning (you can find it in the positioning category when you open the Dreamweaver&#8217;s CSS editor). </p>
<p> You can hide or show a box (layer, div tag, container) either by changing its visibility from visible to hidden or set its display property to &#8220;inline&#8221; ,  &#8220;block&#8221; or &#8220;none&#8221;.<br /> </em><em><br /> Floating Div tags comes in handy when the need arises to align rectangular blocks of content side by side horizontally without having to use absolute positioning. A div tag creates is typically a block-level container. As such has natural tendency to occupy a 100% width of its parent container and push down any another other  element placed after it in the HTML markup. Therefore by specifying the width of div tags and floating them you can place them side by side as long as the width of their common parent container can allow.</p>
<p> The only drawback of using CSS is that you have to do the math as we did yesterday to get the right positioning or calculate the dimensions of each box to align them side by side.<br /> </em><em><br /> So always design you website layout using div tags (i.e. #wrapper, #header, #maincontent, #footer, &#8230;.) as the main building blocks of your web page layout. </em><em>You can then use more div tags to create smaller containers for your content and position each section of your web page.</p>
<p> When the data you are presenting is a grid then use tables to get the job done more efficiently.  Table and CSS are not mutually exclusive. You can use a table then format its look-and-feel with CSS. Again it keeps your HTML and content semantic clean &amp; tidy, easy to maintain and Search Engines Friendly.<br /> </em><em><br /> I hope this message answers your questions.</em></p>
<!-- sphereit end -->]]></content:encoded>
			<wfw:commentRss>http://www.saheltech.com/blog/20090706/using-css-or-tables-web-page-layout/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Featured Video Plugin For WordPress</title>
		<link>http://www.saheltech.com/blog/20080726/featured-video-plugin-for-wordpress/</link>
		<comments>http://www.saheltech.com/blog/20080726/featured-video-plugin-for-wordpress/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 19:33:39 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips & Tricks]]></category>
		<category><![CDATA[WordPress Blog]]></category>
		<category><![CDATA[Wordpress plugins]]></category>

		<guid isPermaLink="false">http://www.saheltech.com/blog/?p=22</guid>
		<description><![CDATA[The WordPress Featured Video Plugin is a very useful and powerful feature to add in your wordpress blog.
* It  reads and displays a video in your wordpress blog post.
* All you need is tag the video HTML code as follows:
[youtube:url to your video] (e.g. [youtube:http://www.youtube.com/watch?v=7o84PE871BE]) or taggged [googlevideo:url] (e.g. [googlevideo:http://video.google.com/googleplayer.swf?docid=8577255250907450469])

* It would display a video in a [...]]]></description>
			<content:encoded><![CDATA[<!-- sphereit start --><p>The WordPress <a rel="nofollow" href="http://pressography.com/plugins/featured-video/"><strong>Featured Video Plugin</strong></a> is a very useful and powerful feature to add in your wordpress blog.<br />
* It  reads and displays a video in your wordpress blog post.<br />
* All you need is tag the video HTML code as follows:<br />
[youtube:url to your video] (e.g. [youtube:http://www.youtube.com/watch?v=7o84PE871BE]) or taggged [googlevideo:url] (e.g. [googlevideo:http://video.google.com/googleplayer.swf?docid=8577255250907450469])</p>
<p><span id="more-22"></span></p>
<p>* It would display a video in a &#8220;Featured Video&#8221; section or the sidebar of your blog.<br />
I have used it quite a few times during the cutsomization process of some of my clients&#8217; blog using themes from Revolution News/Magazine<br />
However when using it in the &#8220;Revolution News&#8221; theme, the Featued Video seems to be displaying the same video on the featured video section despite the fact that my customer has</p>
<p>Solution:<br />
* open the &#8220;featuredvideo.php&#8221; file in your wordpress plugins folder /wp-content/plugins/FeaturedVideo<br />
* add <strong>ORDER BY post_date DESC</strong> to the $sql varible which becomes:</p>
<pre> $sql = "SELECT distinct ID, post_title, post_date, post_content                         
            FROM {$prefix}posts, {$prefix}term_relationships, {$prefix}term_taxonomy
            WHERE {$prefix}posts.ID = {$prefix}term_relationships.object_id
            AND {$prefix}term_relationships.term_taxonomy_id = {$prefix}term_taxonomy.term_taxonomy_id
            AND {$prefix}term_taxonomy.taxonomy = 'category'
            {$catsql}
            AND post_status = 'publish'
            AND post_type != 'page'
   ORDER BY post_date DESC";</pre>
<p> * save and upload that file to your blog at the same location (/wp-content/plugins/FeaturedVideo/featuredvideo.php)</p>
<p>Just as with any other plugin, you need to activate it in your blog admin panel and set the options offered.<br />
Then &#8220;Featured Video Plugin&#8221; will now located the latest youtube or googlevideo file used in your posts and display it in the Featured Video section of your choice. Just be sure to have to call <strong>vsf_show_video()</strong> in order to get the job done</p>
<!-- sphereit end -->]]></content:encoded>
			<wfw:commentRss>http://www.saheltech.com/blog/20080726/featured-video-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS what can you do with it?</title>
		<link>http://www.saheltech.com/blog/20070107/css-what-can-you-do-with-it/</link>
		<comments>http://www.saheltech.com/blog/20070107/css-what-can-you-do-with-it/#comments</comments>
		<pubDate>Mon, 08 Jan 2007 03:52:11 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips & Tricks]]></category>
		<category><![CDATA[Definitions and Usages]]></category>

		<guid isPermaLink="false">http://www.saheltech.com/blog/2007/01/03/css-what-can-you-do-with-it/</guid>
		<description><![CDATA[CSS stands for Cascading Style Sheets.
Typically a Style Sheet is a plain text document with a set of instructions (CSS styles, rules) specifying how each element (selectors) in your web page should be appear in a computer screen or even how it is printed on a sheet of paper.


You can use CSS to specify for [...]]]></description>
			<content:encoded><![CDATA[<!-- sphereit start --><p>CSS stands for Cascading Style Sheets.</p>
<p>Typically a Style Sheet is a plain text document with a set of instructions (CSS styles, rules) specifying how each element (selectors) in your web page should be appear in a computer screen or even how it is printed on a sheet of paper.
</p>
<p><span id="more-7"></span></p>
<p>You can use CSS to specify for instance:<br />
- to specify what font to use  in a paragrah, in what the size the text will be and it color, alignment, the paragraph&#8217;s  background image, background color and more.</p>
<p>- or even intead of the regular blue color of text link, with CSS you can choose a different color and even create a rollover effect on each text link when the mouse hover on it.</p>
<p>Above all, the power of Style Sheets is more revealed when it comes to positioning different sections of a web page. </p>
<p>For example in this web site, the HTML code of the navigation menu is at the very bottom of the page code. Without CSS this web page navigation would appear on the botton of your screen. But thanks to CSS positioning our web site navigation (Home, Web Design, &#8230;, Blog) is et to be shown at the top of the page.</p>
<p>In othe words your web pages visual appearance is not anymore determine by how the HTML code is formatted. To illustrate that with a metaphor, the HTML represent the inventory of the store and the CSS determine how items are placed in the shelves.</p>
<p>You can pretty much use CSS to create a visual layout of your web page just like a puzzle except that in this case the pieces are in a rectangular shape. </p>
<p>YEH, YEH, YEH, we got it now!! <strong>What is the Cascading For in CSS?</strong><br />
I am glad you ask.</p>
<p>The cool thing is you can have as many style sheets in a web page as you want. Each style sheets defines a certain number of styles named CSS rules. When the web browser read the CSS rules coming from each style sheet it combined them then apply each CSS rule to your web page. </p>
<p>You can define the positioning of a element in one style sheet, then its font formatting in another style sheet and so forth.<br />
Therefore the final style of that element is the combination of CSS rules defined is different style sheets: that&#8217;s a <strong>cascade</strong> of styles</p>
<p>If the CSS rule defined in a style sheet does nt conflict with those defined in the next style sheets then the last CSS rules augment any previous style defined for that element (selector).<br />
If the CSS rules of the style sheets conflict, then the last defined rule takes precedence.</p>
<p>Using CSS make not only the web page code cleaner by separating the content ffrom the presentation, it also make your web site maintenance easier. Many web pages can share the same CSS file. You can modify your entire web site presentation by just updating your CSS file without going through each web page.  </p>
<!-- sphereit end -->]]></content:encoded>
			<wfw:commentRss>http://www.saheltech.com/blog/20070107/css-what-can-you-do-with-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vertical Navigation Bar Expanding To The Page Height</title>
		<link>http://www.saheltech.com/blog/20061229/vertical-navigation-column-filling-the-page-height/</link>
		<comments>http://www.saheltech.com/blog/20061229/vertical-navigation-column-filling-the-page-height/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 03:03:17 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.saheltech.com/blog/archives/6</guid>
		<description><![CDATA[How to make the vertical navigation column expands through the entire height of the web page with CSS. That&#8217;s question often asked time and time again on various forums. 

While this can be easily achieved with table-based web page layout, it can be tricky when using CSS instead. As a matter of fact maintaining columns [...]]]></description>
			<content:encoded><![CDATA[<!-- sphereit start --><p>How to make the vertical navigation column expands through the entire height of the web page with CSS. That&#8217;s question often asked time and time again on various forums. </p>
<p>
While this can be easily achieved with table-based web page layout, it can be tricky when using CSS instead. As a matter of fact maintaining columns of same height when one of them is expanding vertically is quite a bit of a challenge in CSS without the use of javascript. </p>
<p><span id="more-6"></span></p>
<p>The graphic below illustrates the look-and-feel we want to create:<br />
  <img src="http://www.saheltech.com/blog/wp-content/uploads/2006/12/vnav-css-bg.gif" width="302" height="281" hspace="20" vspace="10" /><br />
  As you can see, we want the left naigation bar (orange strip) to expand vertically to the bottom of the page. To achieve that result, here is a snippet of the CSS code needed to create that layout.</p>
<p><i><br />
  &lt;div style=&quot;position:relative; background:url(../images/bg-vnav-css.gif) repeat-y 0px 0px; width:800px; height:auto; &quot;&gt; <br />
&lt;div style=&quot;position:relative; top:0px; left:0px;background:#007F00; width:100%; height:80px; text-align:center;&quot;&gt;Page Header .. &lt;/div&gt;<br />
&lt;div style=&quot;position:relative; display:inline;left:0px; top:0px; float:left; clear:left; width:180px; height:auto; &quot;&gt;Links&#8230; &lt;/div&gt;<br />
&lt;div style=&quot;position:relative;display:inline; left:20px; top:0px; float:left; clear:right; with:600px; height:auto; &quot;&gt;Page Content ..&lt;/div&gt; <br />
&lt;/div&gt;</i></p>
<p>
The important point here is the main container&#8217;s background image (bg-vnav-css.gif) set to tile vertically only (repeat-y) starting from the top left corner of the web page (0px 0px). When the web page expands vertically your web site visitor gets the illusion that the navigation bar is also stretched vertically. In reality it&#8217;s the background image of the main container box that is tiling vertically.</p>
<p>
The rest of CSS rules set the alignment of different areas and their respective formatting. </p>
<!-- sphereit end -->]]></content:encoded>
			<wfw:commentRss>http://www.saheltech.com/blog/20061229/vertical-navigation-column-filling-the-page-height/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS in Classified Ads</title>
		<link>http://www.saheltech.com/blog/20061228/css-in-classified-ads/</link>
		<comments>http://www.saheltech.com/blog/20061228/css-in-classified-ads/#comments</comments>
		<pubDate>Thu, 28 Dec 2006 21:22:08 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.saheltech.com/blog/archives/5</guid>
		<description><![CDATA[The power of CSS, besides giving the web designers more control over the web pages layout is also the separation between the page content and  its presentation.
Linking your web pages to an external CSS file makes the HTML code cleaner, creates a more consistent look throughout your web site and updating your web pages [...]]]></description>
			<content:encoded><![CDATA[<!-- sphereit start --><p>The power of CSS, besides giving the web designers more control over the web pages layout is also the separation between the page content and  its presentation.</p>
<p>Linking your web pages to an external CSS file makes the HTML code cleaner, creates a more consistent look throughout your web site and updating your web pages layout much much easier: modify your CSS files then all your web pages follow the new CSS rules in a snap.</p>
<p><span id="more-5"></span></p>
<p>However when you want to use CSS to format your classified ads or other type of ads to be posted on somewhere else than your website, using an external CSS is not often possible.<br />
<strong>In that case, inline CSS is the way to go.</strong><br />
For instance to create a dashed red border of 2 pixels width around your ad, you would write your flyer like this:</p>
<p><em>&lt;div style=&#8221;padding-right: 5px; padding-left: 5px; padding-bottom: 5px; margin: 10px; width: 400px; padding-top: 5px; height: 150px; border: #ff0000 2px dashed;&#8221;&gt;<br />
</em><strong>The content of your ad would go here.</strong><em><br />
You can add in some pictures, links or anything else<br />
just like in a regular web pages.</em><em><br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</em><em>&lt;/div&gt;</em><em>You just created CSS box of 400 pixels wide and 150 pixels height where your ad content is padded 5 pixels from the box edges. A 10 pixels margin is defined around the box as shown below.</em><em>You just created CSS box of 400 pixels wide and 150 pixels height where your ad content is padded 5 pixels from the box edges. A 10 pixels margin is defined around the box as shown below.</em><em>You just created CSS box of 400 pixels wide and 150 pixels height where your ad content is padded 5 pixels from the box edges. A 10 pixels margin is defined around the box as shown below.</p>
<p></em>You just created CSS box of 400 pixels wide and 150 pixels height where your ad content is padded 5 pixels from the box edges. A 10 pixels margin is defined around the box as shown below.</p>
<div style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px; margin: 10px; width: 400px; padding-top: 5px; height: 150px; border: #ff0000 2px dashed">The content of your ad would go here.<br />
<em>You can add in some pictures, links or anything else<br />
just like in a regular web pages.</em><br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</div>
<p>Feel free to add in the font type, color and size to have more control over your ad&#8217;s text.<br />
<em>font-family: verdana, arial, helvetica, sans-serif; color: #00000; size:13px;</em><br />
Your text color is now defined to be in black (six characters hexadecimal value: 000000) with a size of 13 pixels.</p>
<p>You should <strong><em>always give the web browser a choice of fonts at least 3</em></strong>.</p>
<p>That means if the end-user computer does not have <em><strong>Verdana</strong></em>, the browser will look for the second option which is <em><strong>Arial</strong>. I</em>f available then <em><strong>Helvetica</strong></em> or any other <em><strong>sans-serif</strong></em> font if any of the above is not installed in the user&#8217;s computer.</p>
<!-- sphereit end -->]]></content:encoded>
			<wfw:commentRss>http://www.saheltech.com/blog/20061228/css-in-classified-ads/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Background Image Position and Repeat</title>
		<link>http://www.saheltech.com/blog/20061228/background-image/</link>
		<comments>http://www.saheltech.com/blog/20061228/background-image/#comments</comments>
		<pubDate>Thu, 28 Dec 2006 20:24:39 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.saheltech.com/blog/archives/4</guid>
		<description><![CDATA[Css offers web developers a new way to control the display of the background image in a given layer.
With plain HTML, the background image is always tiled both horizontally and vertically in the containing area. TheÃ‚Â usual trick to avoid the tiling was then toÃ‚Â create a background graphic with the same dimensions as the area it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<!-- sphereit start --><p>Css offers web developers a new way to control the display of the <strong>background image</strong> in a given layer.</p>
<p>With plain HTML, the background image is always <strong>tiled both horizontally and vertically</strong> in the containing area. TheÃ‚Â usual trick to avoid the tiling was then toÃ‚Â create a background graphic with the same dimensions as the area it&#8217;s placed.</p>
<p><span id="more-4"></span></p>
<p>
That way, the background imageÃ‚Â will beÃ‚Â diplayed once. Even with that trick you cannot realy control the positioning without going through a graphic program to put additional spacing that will blend with the background color.</p>
<p>
Now thanks to CSS one can define the web designer can specify whether or not she want the background image to be tiled horizontaly (<em>repeat-x</em>), vertically (<em>repeat-y</em>) or both (repeat).</p>
<p>
That&#8217;s not all. You can now ask the web browser <strong>not to tile the background image</strong> at all with <em>no-repeat .</em> As a web deigner you can even specify where you would like the place the background image by specifying its coordinates x and y:</p>
<p><em>#containerbox {<br />
background: url(images/bgimage.jpg) no-repeat 20px 15px;<br />
}</em>
</p>
<p>
That <strong>CSS rule</strong> will place the background image (bgimage.jpg) inside the containing layer (containerbox) at the horizontal coordinate x equals to 20 pixels (from the top left corner of the container box) and 15 pixels vertically away from that top left edge.
</p>
<p>
<strong>What is now missing however is the ability to now define where (x, y)Ã‚Â one would like tthe background image to start tiling, how many time should it tile then stops.</strong></p>
<p><strong>That would be really cool, sweet, neatÃ‚Â and powerful !!<br />
</strong></p>
<p>
Until then, we both have to hang on to what we have and get the most of it by using tricks to achieve the effects we want.</p>
<!-- sphereit end -->]]></content:encoded>
			<wfw:commentRss>http://www.saheltech.com/blog/20061228/background-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Layer Scrolling without Horizontal scroll bar</title>
		<link>http://www.saheltech.com/blog/20061125/layer-content-scrolling/</link>
		<comments>http://www.saheltech.com/blog/20061125/layer-content-scrolling/#comments</comments>
		<pubDate>Sat, 25 Nov 2006 21:09:03 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.saheltech.com/blog/archives/3</guid>
		<description><![CDATA[You can create a CSS layer that scrollsÃ‚Â when its content exceeds the dimension of the viewable area defined.Ã‚Â All you need is to specify theÃ‚Â overflow rule in your layer style definition: #layer{overflow:scroll;}

UnfortunatelyÃ‚Â both the vertical and horizontal scroll bars are displayed even though in most cases we just need the vertical scrolling of the content.
You will learn [...]]]></description>
			<content:encoded><![CDATA[<!-- sphereit start --><p>You can create a CSS layer that scrollsÃ‚Â when its content exceeds the dimension of the viewable area defined.Ã‚Â All you need is to specify theÃ‚Â overflow rule in your layer style definition: <em>#layer{overflow:scroll;}<br />
</em><br />
UnfortunatelyÃ‚Â both the vertical and horizontal scroll bars are displayed even though in most cases we just need the vertical scrolling of the content.<br />
You will learn here <strong>how to &#8220;get rid off&#8221; the horizontal scroll bar</strong>.</p>
<p><span id="more-3"></span></p>
<p><strong>Option 1</strong>) Most designersÃ‚Â create graphic imageÃ‚Â of theÃ‚Â vertical scrollbar thenÃ‚Â use a javascript function to scroll the content of the layer based on specific mouse events: rollover or click.</p>
<p>This solution certainely has its appeals andÃ‚Â offers theÃ‚Â ability to customize your vertical scrollbar look-and-feel. However it requires extra code (javascript), graphic design skills andÃ‚Â extra files to download.</p>
<p><strong>Option 2</strong>) A much easier approach is to use CSS and take advantage of the already existing scrollbars functionality in your web browser.</p>
<p><strong>The trick is to just hide the horizontal scrollbar.<br />
</strong><br />
All you need is three CSS Layers: #Layer1, #Layer2, #Layer3</p>
<p>a) Layer1 definesÃ‚Â the scrollable viewÃ‚Â area.<br />
b) Layer2Ã‚Â  is <strong>non scrollable</strong>Ã‚Â and contains the Layer1. Its height shouldÃ‚Â have aboutÃ‚Â 17 px less in order to hide the horizontal scrollbar in Layer1. The with of Layer1 and Layer2 couldÃ‚Â be ofÃ‚Â the same width.<br />
c)Ã‚Â Layer3Ã‚Â where you page content will be inserted. It&#8217;s contained by Layer1<br />
It can have the same (or less)Ã‚Â width as layer2.</p>
<p>BelowÃ‚Â is an example:<br />
<em>#Layer1 {<br />
Ã‚Â position: relative;Ã‚Â Ã‚Â visibility: inherit;Ã‚Â display: inline;Ã‚Â  margin: 0px; padding: 0px;<br />
left: 0px; top: 0px;Ã‚Â text-align: left;Ã‚Â vertical-align: top; clear: both;Ã‚Â float: left;<br />
</em><em><strong>width: 695px; height: 557px; overflow: scroll;<br />
</strong>}</em></p>
<p><em>#Layer2{<br />
Ã‚Â position: relative;Ã‚Â visibility: inherit;Ã‚Â display: inline;Ã‚Â Ã‚Â margin: 0px;Ã‚Â padding: 0px;Ã¯Â¿Â½<br />
left: 10px; top: 10px;Ã‚Â text-align: left;Ã‚Â vertical-align: top; clear: both;Ã‚Â float: left;<br />
</em><em><strong>width:695px;Ã‚Â Ã‚Â height:540px; overflow: hidden;</strong></em><em><br />
}</em></p>
<p><em>#Layer3 {<br />
Ã‚Â position:relative;Ã‚Â visibility: inherit;Ã‚Â display: block;Ã‚Â margin: 0px; padding: 0px;</em><em><br />
Ã‚Â left: 0px;Ã‚Â top: 0px;text-align: left;Ã‚Â vertical-align: top;Ã‚Â float: left;Ã‚Â clear: both;<br />
Ã‚Â <strong>width:700px;Ã‚Â height:700px;Ã‚Â  overflow: visible;</strong><br />
}</em></p>
<p>Notice the <em>width</em>, <em>height</em> and <em>overflow</em> CSS rulesÃ‚Â on theÃ‚Â 3 layers. Other rules are for positioning each layer and its content.</p>
<p>The HTML code would be:<br />
&lt;div id=&#8221;Layer2&#8243;&gt;<br />
&lt;div id=&#8221;Layer1&#8243;&gt;<br />
&lt;div id=&#8221;Layer3&#8243;&gt;Your content shouldÃ‚Â go here &lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>You can put any type of information in Layer3: text, pictures, movies&#8230; just about anything that can go in a web page.<br />
You can also use CSS rules to customize the look-and-feel of your scrollbars.</p>
<p>Of course this post applies only to the scrollbars in a layer and not the web browser&#8217; scrollbar. To get rid off your web browser horizontal scrollbar, make sure the content of your web page does not exceed the width of the viewable area of your web browser.</p>
<p>No matter what the screen resolution your web site is optimized for, always leave off about 20px or more to take into account the width of the ever presentÃ‚Â vertical scrollbar.</p>
<!-- sphereit end -->]]></content:encoded>
			<wfw:commentRss>http://www.saheltech.com/blog/20061125/layer-content-scrolling/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
