<?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>Learn Web Design Online &#187; css</title>
	<atom:link href="/tag/css/feed" rel="self" type="application/rss+xml" />
	<link>https://learnwebdesignonline.com</link>
	<description>Resources for Learning Web Design and Web Development</description>
	<lastBuildDate>Sun, 06 Jan 2013 15:44:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Tutorial on Creating Your First HTML 5 Page</title>
		<link>https://learnwebdesignonline.com/tutorial-on-creating-your-first-html-5-page</link>
		<comments>https://learnwebdesignonline.com/tutorial-on-creating-your-first-html-5-page#comments</comments>
		<pubDate>Sun, 14 Oct 2012 05:53:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">https://learnwebdesignonline.com/?p=568</guid>
		<description><![CDATA[In this tutorial we will create a very simple HTML 5 page. We will keep it as simple as possible so that you can get something up and running quickly. HTML 5 is a significant change from HTML 4.  It comes with brand new tags and a new doctype plus more.   However older browsers [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial we will create a very simple HTML 5 page. We will keep it as simple as possible so that you can get something up and running quickly.</p>
<p>HTML 5 is a significant change from HTML 4.  It comes with brand new tags and a new doctype plus more.   However older browsers that was in existence prior to HTML 5 will not know of these news tags.  Of course, we will want our page to be viewable on these older browser as well. Therefore there are various tricks and techniques that we have to employ in order to get our HTML 5 page to render on older browsers.</p>
<p>The easiest way to start is to start with an HTML 5 template that has all these techniques and best practices coded for you already.   HTML 5 Boilerplate is the popular template to use.  We will use this template as the skeleton for our HTML page.</p>
<p>1.  First download the latest HTML5 Boilerplate from <a href="http://html5boilerplate.com/">http://html5boilerplate.com/</a></p>
<p>In this tutorial we are using version 4.0.0.</p>
<p>2.  After you have downloaded and extracted the zip file into a new folder on your hard disk, you will see a bunch of files like the following&#8230;</p>
<p><a href="/wp-content/uploads/2012/10/html5-templatefiles.jpg"><img class="alignnone size-full wp-image-571" title="html5-templatefiles" src="/wp-content/uploads/2012/10/html5-templatefiles.jpg" alt="" width="282" height="544" /></a></p>
<p>3.  The main file that we are interested in is index.html.   Open this file in your favorite text editor. (I&#8217;m using Dreamweaver).</p>
<p>4.  Note the new doctype is now the following&#8230;</p>
<p>&lt;!DOCTYPE html&gt;</p>
<p>This is the new doctype for HTML5.  If you see this, it means that the author intends for this to be an HTML 5 document.</p>
<p><a href="/wp-content/uploads/2012/10/html5-doctype.jpg"><img class="alignnone size-full wp-image-577" title="html5-doctype" src="/wp-content/uploads/2012/10/html5-doctype.jpg" alt="HTML5 doctype" width="564" height="331" /></a></p>
<p>5.  Without changing any code, just test it by running the index.html file in your browser.   We are using Chrome for this viewing. As of this writing in October 2012, Chrome version 22 is the browser that supports the most features of the latest HTML5 specifications, according to <a href="http://html5test.com/results/desktop.html">HTM5Test.com</a>. That is why many web designers like to using Google Chrome during development.</p>
<p>You will see the following in the browser &#8230;</p>
<p><a href="/wp-content/uploads/2012/10/first-html5-chrome.jpg"><img class="alignnone size-full wp-image-578" title="first-html5-chrome" src="/wp-content/uploads/2012/10/first-html5-chrome.jpg" alt="First HTML5 page viewed in Chrome" width="418" height="241" /></a></p>
<p>which indicates that everything currently works.</p>
<p>You can say that this is your first &#8220;Hello World&#8221; HTML5 page.  Of course, we now want to start writing some code so that we can understand how all the pieces are put together.</p>
<p>6.  Let&#8217;s add a title to our page by typing in &#8220;Our First HTML5 Page&#8221; into the index.html file in between the &lt;title&gt; tags as shown&#8230;</p>
<p><a href="/wp-content/uploads/2012/10/add-title.jpg"><img class="alignnone size-full wp-image-579" title="add-title" src="/wp-content/uploads/2012/10/add-title.jpg" alt="Add Page Title" width="512" height="192" /></a></p>
<p>This is known as the &#8220;Page Title&#8221;.  After saving the file and refreshing the browser, you should see that our page title shows up in the browser tab.</p>
<p><a href="/wp-content/uploads/2012/10/page-title-chrome.jpg"><img class="alignnone size-full wp-image-580" title="page-title-chrome" src="/wp-content/uploads/2012/10/page-title-chrome.jpg" alt="Page Title Shown in Tab" width="396" height="193" /></a></p>
<p>7.  HTML5 Boilerplate intends for you to delete things from it that you do not need.  One of the things that it puts in near the bottom of the HTML file is a code snippet intended for Google Analytics.  Since we will not be using that in this example, we will delete it.  If you don&#8217;t know what Google Analytics is, then you don&#8217;t need it.</p>
<p>Delete the code as that is marked as shown&#8230;</p>
<p><a href="/wp-content/uploads/2012/10/delete-google-analytics.jpg"><img class="alignnone size-full wp-image-581" title="delete-google-analytics" src="/wp-content/uploads/2012/10/delete-google-analytics.jpg" alt="Delete Google Analytics Code" width="768" height="442" /></a></p>
<p>If you save file and view in browser, you will see that the deletion had no effect.</p>
<p>8.  Let&#8217;s make the background color be a pale gray.   Styling information is done in CSS.  And if you are using HTML5, you would be using CSS3 (as opposed to CSS2).   The CSS code is found in the main.css file within the css folder.  You can see that our index.html file links to this css file via the link tag shown below &#8230;</p>
<p><a href="/wp-content/uploads/2012/10/html-link-css.jpg"><img class="alignnone size-full wp-image-582" title="html-link-css" src="/wp-content/uploads/2012/10/html-link-css.jpg" alt="HTML links to CSS file" width="508" height="227" /></a></p>
<p>8.  Now open up the main.css file in your editor and look for the section that says &#8220;Author&#8217;s custom styles&#8221; &#8212; that&#8217;s for us.</p>
<p><a href="/wp-content/uploads/2012/10/add-first-css.jpg"><img class="alignnone size-full wp-image-583" title="add-first-css" src="/wp-content/uploads/2012/10/add-first-css.jpg" alt="Add first CSS rule" width="342" height="483" /></a></p>
<p>9.  We write our first CSS rule into that section.   The code shown above highlighted by the red rectangle is the code that we just added.  This tells the browser to set the background color of our page to be light gray (which is the hexidecimal color #CCCCCC).  Save changes in the CSS file and refresh browser.   Our page now has gray background.</p>
<p><a href="/wp-content/uploads/2012/10/gray-background.jpg"><img class="alignnone size-full wp-image-585" title="gray-background" src="/wp-content/uploads/2012/10/gray-background.jpg" alt="Gray background" width="418" height="247" /></a></p>
<p>10.  Now you may have noticed that the index.html page also links to another css file called normalize.css.</p>
<p><a href="/wp-content/uploads/2012/10/normalize-css.jpg"><img class="alignnone size-full wp-image-584" title="normalize-css" src="/wp-content/uploads/2012/10/normalize-css.jpg" alt="Normalize css" width="508" height="227" /></a></p>
<p>11. You don&#8217;t have to worry about that css file.  Not all browsers may use the same default styling for a HTML page.  Hence, one technique is to use CSS to make the styling consistent among browsers .   This is known &#8220;normalizing the styles&#8221; and the code for doing that is known as &#8220;css reset code&#8221;.  That is what is contained within normalize.css.</p>
<p>12.  Also within normalize.css, you will see this code &#8230;</p>
<p><a href="/wp-content/uploads/2012/10/block-display-new-tags.jpg"><img class="alignnone size-full wp-image-586" title="block-display-new-tags" src="/wp-content/uploads/2012/10/block-display-new-tags.jpg" alt="Set block display for new tags" width="250" height="384" /></a></p>
<p><a href="/wp-content/uploads/2012/10/block-display-new-tags.jpg"></a>This is to allow older non-HTML5 browser to work well with the new HTML5 tags (some of which are article, aside, details, figcaption, figure, footer, header, hgroup, nav, section, summary).</p>
<p>The CSS contain styling to make these new tags display as &#8220;block style&#8221; tags.   Shown above is the &#8220;display&#8221; property with the &#8220;block&#8221; value for these new tags.  Don&#8217;t worry about what that means for now since this is your first  HTML5 page.  We have to take things one step at a time.  Just know that the above CSS code is needed to make older browser work with the new HTML5 tags.</p>
<p>13.  Next, let&#8217;s give some definition to our content area containing the text by adding some borders and a different content background color to set it apart from the background color.  In the index.html file, we will add an &#8220;article&#8221; tag (one of the new HTML5 tags) around the text content as shown&#8230;</p>
<p><a href="/wp-content/uploads/2012/10/article-tags.jpg"><img class="alignnone size-full wp-image-587" title="article-tags" src="/wp-content/uploads/2012/10/article-tags.jpg" alt="Article tags" width="423" height="200" /></a></p>
<p>Note that the starting tag (the first tag) is &lt;article&gt;</p>
<p>And the closing tag is &lt;/article&gt; with the extra slash at the end.  That is how most tags work.  They come in pairs with a starting tag and a closing tag.  Save changes and refresh browser.</p>
<p>14.  You will see no effect until we add styling rule for the article tag.  Let&#8217;s add the article CSS rule to the main.css file&#8230;</p>
<p><a href="/wp-content/uploads/2012/10/css-page-definition.jpg"><img class="alignnone size-full wp-image-588" title="css-page-definition" src="/wp-content/uploads/2012/10/css-page-definition.jpg" alt="CSS Page definition" width="292" height="274" /></a></p>
<p>We set the width of our page to be 500 pixels with the line &#8230;</p>
<pre>width: 500px;</pre>
<p>The margin property has two values &#8230;</p>
<pre>margin: 20px auto</pre>
<p>The first value 20px represents the top and bottom margins of our page.  The second value represents the left and right margins of our page.  Since we set that to &#8220;auto&#8221;, it has the effect of making the page be centered horizontally across the browser.</p>
<p>Saving the file and running in browser, we get  &#8230;</p>
<p><a href="/wp-content/uploads/2012/10/first-html5-page-centered.jpg"><img class="alignnone size-full wp-image-589" title="first-html5-page-centered" src="/wp-content/uploads/2012/10/first-html5-page-centered.jpg" alt="First HTML5 page centered" width="727" height="235" /></a></p>
<p>15.  In CSS3, we can have rounded corners and drop shadows like &#8230;</p>
<p><a href="/wp-content/uploads/2012/10/corners-drop-shadow1.jpg"><img class="alignnone size-full wp-image-592" title="corners-drop-shadow" src="/wp-content/uploads/2012/10/corners-drop-shadow1.jpg" alt="Corners and Drop Shadows" width="619" height="127" /></a></p>
<p>by adding the following two lines to our article CSS rule as shown below &#8230;</p>
<p><a href="/wp-content/uploads/2012/10/article-css-rule.jpg"><img class="alignnone size-full wp-image-593" title="article-css-rule" src="/wp-content/uploads/2012/10/article-css-rule.jpg" alt="CSS rule for corners and drop shadows" width="302" height="144" /></a></p>
<p>For the <strong>border-radius</strong> property, we set the roundness to 8 pixels (the greater the value, the more rounded).</p>
<p>The first two values of the <strong>box-shadow</strong> property represents the horizontal and vertical offset respectively.  The third value is the amount of blur.  And the fourth value is the color of the shadow.</p>
<p>16. One last thing before we are done, the text content is too close to the left edge of the page.  Add a bit of padding around the article element by &#8230;.</p>
<p><a href="/wp-content/uploads/2012/10/padding-article.jpg"><img class="alignnone size-full wp-image-594" title="padding-article" src="/wp-content/uploads/2012/10/padding-article.jpg" alt="Pad article" width="267" height="150" /></a></p>
<p>and we should get &#8230;</p>
<p><a href="/wp-content/uploads/2012/10/after-padding.jpg"><img class="alignnone size-full wp-image-595" title="after-padding" src="/wp-content/uploads/2012/10/after-padding.jpg" alt="After padding" width="608" height="149" /></a></p>
<p>Since  we had only specified one value for the padding property, it will use the 30 pixels as padding for the top, right, bottom, and left edges.</p>
<p>In this case, since all the properties of the article CSS rule is unique, it does not matter which order you place the properties in.  We just like putting the padding property where it was.</p>
<p>And that is your first HTML 5 page.</p>
]]></content:encoded>
			<wfw:commentRss>https://learnwebdesignonline.com/tutorial-on-creating-your-first-html-5-page/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List Drop Down Menu Examples</title>
		<link>https://learnwebdesignonline.com/drop-down-menu-examples</link>
		<comments>https://learnwebdesignonline.com/drop-down-menu-examples#comments</comments>
		<pubDate>Thu, 06 Sep 2012 04:50:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">https://learnwebdesignonline.com/?p=560</guid>
		<description><![CDATA[It is not a problem building a basic horizontal menu, but building a horizontal menu with drop down item upon hover is a bit more challenging &#8212; especially if it is a complex multi-level menu system. Plus there are so many different ways of building them, from pure CSS menus to those that uses some [...]]]></description>
			<content:encoded><![CDATA[<p>It is not a problem building a basic horizontal menu, but building a horizontal menu with drop down item upon hover is a bit more challenging &#8212; especially if it is a complex multi-level menu system.</p>
<p>Plus there are so many different ways of building them, from pure CSS menus to those that uses some jQuery.  Making them cross-browser compatible is another chore.</p>
<p>There are so many drop down menu examples out there, that you might want to look through a few to find one the most closely matches what you are looking for and then see how it works.</p>
<p>Here is a list of some drop down menu example (listed in no particular order).</p>
<ul>
<li><a href="http://www.alistapart.com/articles/dropdowns">SuckerFish</a> &#8211; AListApart.com</li>
<li><a href="http://www.htmldog.com/articles/suckerfish/dropdowns/">Son of SuckerFish</a> &#8211; HTMLDog</li>
<li><a href="http://users.tpg.com.au/j_birch/plugins/superfish/">SuperFish</a> -</li>
<li><a href="http://net.tutsplus.com/tutorials/html-css-techniques/how-to-create-a-drop-down-nav-menu-with-html5-css3-and-jquery/">How to Create a drop-down nav menu with HTML5, CSS3, and JQuery</a> &#8211; tutsplus.com</li>
<li><a href="http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm">Smooth Navigation Menu</a> &#8211; dynamicdrive.com</li>
<li><a href="http://www.hv-designs.co.uk/2009/02/17/sliding-jquery-menu/">Sliding JQuery Menu</a> &#8211; hv-designs.co.uk</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>https://learnwebdesignonline.com/drop-down-menu-examples/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resizable Images that does not break out of container</title>
		<link>https://learnwebdesignonline.com/resizable-images-that-does-not-break-out-of-container</link>
		<comments>https://learnwebdesignonline.com/resizable-images-that-does-not-break-out-of-container#comments</comments>
		<pubDate>Sun, 02 Sep 2012 06:56:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">https://learnwebdesignonline.com/?p=535</guid>
		<description><![CDATA[It is great when we create pages that resizes with the browser. However, it is not so great when an user resizes the browser to be smaller than an image. Typically, the image would remain at its fixed width and break out of its container. This can be fixed by applying &#8230; img { max-width: [...]]]></description>
			<content:encoded><![CDATA[<p>It is great when we create <a href="/page-resize-with-browser">pages that resizes with the browser</a>.  However, it is not so great when an user resizes the browser to be smaller than an image.   Typically, the image would remain at its fixed width and break out of its container.</p>
<p>This can be fixed by applying &#8230;</p>
<p>img { max-width: 100%; }</p>
<p>to the image.   This constrains the maximum width of the image to be the width of its container.  If the container resizes smaller, the image will accordingly resize smaller to fit the container.  If the container resizes larger than the image width, the image will just be as big as its native width.  </p>
<p>The image will not scale up, unless you do &#8230;</p>
<p>img { width: 100%; }</p>
<p>which in this case would cause the image to be always at the width of its container.</p>
<p>This is known as fluid image.  It not only work for images, but works for other media as well.  Often designers will use the rule &#8230;</p>
<p>img, embed, object, video { max-width: 100%; }</p>
<p>Alternatively, instead of resizing the image, one can hide any portion of the image that falls outside its container by &#8230;</p>
<p>img { overflow: hidden; }</p>
]]></content:encoded>
			<wfw:commentRss>https://learnwebdesignonline.com/resizable-images-that-does-not-break-out-of-container/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Based Horizontal Tabs</title>
		<link>https://learnwebdesignonline.com/css-based-horizontal-tabs</link>
		<comments>https://learnwebdesignonline.com/css-based-horizontal-tabs#comments</comments>
		<pubDate>Mon, 25 Jul 2011 02:50:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">https://learnwebdesignonline.com/?p=436</guid>
		<description><![CDATA[In this tutorial, we are going to create CSS-based horizontal tabs as shown here. View live code here. Graphics Used The graphics looks like this &#8230; Default gradient tab: default_tab.jpg &#160; Highlighted tab&#8230; &#160; But instead of using two different graphic files for the two tabs, we combine the default tab and highlighted tab into [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial, we are going to create CSS-based horizontal tabs as shown here.</p>
<div id="attachment_437" class="wp-caption alignnone" style="width: 361px"><img class="size-full wp-image-437" title="horizontal CSS tabs" src="/wp-content/uploads/2011/07/horizontal-css-tabs-final.gif" alt="horizontal CSS tabs" width="351" height="217" /><p class="wp-caption-text">horizontal CSS tabs</p></div>
<p><a href="/example/code/horizontal-tabs.html">View live code here</a>.</p>
<h2>Graphics Used</h2>
<p>The graphics looks like this &#8230;</p>
<p>Default gradient tab: <strong>default_tab.jpg</strong></p>
<p><img class="alignnone size-full wp-image-438" title="default_tab" src="/wp-content/uploads/2011/07/default_tab.jpg" alt="" width="88" height="23" /></p>
<p>&nbsp;</p>
<p><strong>Highlighted tab&#8230;</strong></p>
<p><strong><img class="alignnone size-full wp-image-439" title="highlighted_tab" src="/wp-content/uploads/2011/07/highlighted_tab.jpg" alt="" width="88" height="23" /></strong></p>
<p>&nbsp;</p>
<p>But instead of using two different graphic files for the two tabs, we  combine the default tab and highlighted tab into one graphic as shown.</p>
<p>Combined tab: <strong>tabs.jpg</strong></p>
<p><strong><img class="alignnone size-full wp-image-440" title="tabs" src="/wp-content/uploads/2011/07/tabs.jpg" alt="" width="176" height="23" /></strong></p>
<p>Because the two tab images are on one file, they will load with the  single file.  This will improve performance due to one less server call  to get another graphics file.  And it will avoid any &#8220;flicker&#8221; that may  occur if we had to wait for the browser to load a separate image for the  hover state.</p>
<h2>Page Structure</h2>
<p>First, we will start out with a page structure on to which we will  place our tabs to be sitting right on top of the gold nav strip.</p>
<div id="attachment_441" class="wp-caption alignnone" style="width: 535px"><img class="size-full wp-image-441" title="page structure for horizontal tabs" src="/wp-content/uploads/2011/07/skeleton-page.gif" alt="page structure for horizontal tabs" width="525" height="287" /><p class="wp-caption-text">page structure for horizontal tabs</p></div>
<p>The code for this page looks like &#8230;</p>
<div id="attachment_442" class="wp-caption alignnone" style="width: 518px"><img class="size-full wp-image-442" title="code for page structure of CSS tabs" src="/wp-content/uploads/2011/07/skeleton-code-css-tabs.gif" alt="code for page structure of CSS tabs" width="508" height="832" /><p class="wp-caption-text">code for page structure of CSS tabs</p></div>
<p>Note that for the sake of simplicity, this tutorial had placed the  CSS on the same page embedded in the head section.  However, for  production code, you should put the CSS in a separate CSS file.  Also  images will be referenced in the same directory.  Again, for production  code, they would normally be in a separate directory.</p>
<h2>Coding the CSS Based Horizontal Tabs</h2>
<p>1. Start by letting the tabs be links in an unordered list&#8230;</p>
<p><img class="alignnone size-full wp-image-443" title="where-code-css-horizontal-tabs" src="/wp-content/uploads/2011/07/where-code-css-horizontal-tabs.gif" alt="" width="376" height="194" /></p>
<p>And we get this &#8230;</p>
<p><img class="alignnone size-full wp-image-444" title="css-horizontal-tabs-1" src="/wp-content/uploads/2011/07/css-horizontal-tabs-1.gif" alt="" width="280" height="218" /></p>
<p>2. Because different browsers may have different default margins and paddings for <strong>ul</strong>&#8216;s and <strong>li</strong>&#8216;s, we set them all to zero first and then we can adjust them later. We give the ul element an id of tabnav and create a CSS rule to select this ul and li&#8217;s that it contains.</p>
<p><img class="alignnone size-full wp-image-445" title="code for css tabs" src="/wp-content/uploads/2011/07/zero-out-css-tabs-margin-padding.gif" alt="code for css tabs" width="402" height="437" /></p>
<p>3.  In the CSS, we remove the bullets that normally appears in the  unordered list.  And we remove the underlines that normally occurs in  the links for li&#8217;s.</p>
<p><img class="alignnone size-full wp-image-446" title="code for CSS horizontal tabs" src="/wp-content/uploads/2011/07/remove-css-horiz-tabs.gif" alt="code for CSS horizontal tabs" width="342" height="213" /></p>
<p>4. The main characteristic about horizontal css tabs is that they actually be horizontal.  We make the list items horizontal by floating the li&#8217;s.  When we float the li&#8217;s, we need to give it a width.  We set the li&#8217;s to 88px by 23px since that is the size of our graphic image for one tab.</p>
<p><img class="alignnone size-full wp-image-447" title="float-size-horiz-css-tabs" src="/wp-content/uploads/2011/07/float-size-horiz-css-tabs.gif" alt="" width="339" height="257" /></p>
<p>Now the list items are horizontal &#8230;</p>
<p><img class="alignnone size-full wp-image-448" title="horizontal list items to be tabs" src="/wp-content/uploads/2011/07/horizontal-list-item-tabs.gif" alt="horizontal list items to be tabs" width="331" height="217" /></p>
<p>5. We set the display of the link to be block so that the link will expand to fill the entire width of the li, making the entire tab clickable and not just the text clickable.  This is done with the following CSS &#8230;</p>
<p>display:block;</p>
<p>6.  We set the background image of link to be the tab graphic.  We  center align the text.  Finally, we stylize the link with a color and  font size that is suitable to match the tab graphics&#8230;</p>
<p><img class="alignnone size-full wp-image-449" title="stylize horizontal CSS tabs" src="/wp-content/uploads/2011/07/stylize-horizontal-css-tab.gif" alt="stylize horizontal CSS tabs" width="458" height="371" /></p>
<p>And we get&#8230;</p>
<p><img class="alignnone size-full wp-image-450" title="horizontal CSS tabs" src="/wp-content/uploads/2011/07/horizontal-css-tabs-6.gif" alt="horizontal CSS tabs" width="308" height="205" /></p>
<p>7. Notice that the tabs are much shorter than we would like.  In fact,  the tab height is only taking up as much height as needed by the text  instead of the full 23px height of the tab graphic.  Therefore, we remove  the &#8220;height&#8221; attribute from the &#8220;li&#8221; to the &#8220;a&#8221; selector rule.</p>
<p><img class="alignnone size-full wp-image-451" title="height-horizontal-css-tabs" src="/wp-content/uploads/2011/07/height-horizontal-css-tabs.gif" alt="" width="457" height="370" /></p>
<p>And we get &#8230;</p>
<p><img class="alignnone size-full wp-image-452" title="horizontal-css-tabs-7" src="/wp-content/uploads/2011/07/horizontal-css-tabs-7.gif" alt="" width="325" height="215" /></p>
<p>&nbsp;</p>
<p>8.  The text is sitting a little bit too high in relation to the tab graphics, so we add 3px top padding to the link.  But when we add padding to the link, remember to decrease the height by the same amount since &#8220;height&#8221; in CSS is defined as &#8220;content height&#8221; and does not include any padding.</p>
<p><img class="alignnone size-full wp-image-453" title="adjust-height-css-horizontal-tabs" src="/wp-content/uploads/2011/07/adjust-height-css-horizontal-tabs.gif" alt="" width="447" height="192" /></p>
<p>9. To create the hover effect where the highlighted tab is displayed  when the mouse cursor is over the tab, we add a new CSS rule using the  hover pseudo-class where we shift the background image to the left by  88px.  Recall that the highlighted tab image is on the right-half of the  graphics file and that each tab image is 88px in width.</p>
<p><img class="alignnone size-full wp-image-454" title="shift bg image of horizontal CSS tabs" src="/wp-content/uploads/2011/07/shift-bg-image-horiz-css-tabs.gif" alt="shift bg image of horizontal CSS tabs" width="443" height="259" /></p>
<p>We also altered the link color upon hover to better constrast with the highlighted tab.</p>
<p>And here is what it looks like if you hover over the home tab&#8230;</p>
<p><img class="alignnone size-full wp-image-455" title="horizontal-css-tabs-9" src="/wp-content/uploads/2011/07/horizontal-css-tabs-9.gif" alt="" width="350" height="215" /></p>
<p>10.  If we want the home tab to stay highlighted because this is the &#8220;home&#8221; page, then we have to add a class to the &#8220;home&#8221; link to make it different from the rest of the links.  We&#8217;ll give it the arbitrary class called &#8220;selected&#8221; and add the CSS selector rule as shown&#8230;</p>
<p><img class="alignnone size-full wp-image-456" title="horizontal CSS selected tab" src="/wp-content/uploads/2011/07/horizontal-css-selected-tab.gif" alt="horizontal CSS selected tab" width="446" height="254" /></p>
<p>11.  We want the tabs to be sitting on the gold nav strip, not floating  near the top of the page masthead.  No problem.  With some graphical  measurements, we determined that all we need to do is to move the whole  tab structure 71px lower.  We do so by giving a top margin to the ul element, since the ul element is what contains all the tabs.</p>
<p><img class="alignnone size-full wp-image-457" title="top-margin-css-horizontal-tabs" src="/wp-content/uploads/2011/07/top-margin-css-horizontal-tabs.gif" alt="" width="361" height="196" /></p>
<p>And now it looks like &#8230;</p>
<p><img class="alignnone size-full wp-image-458" title="horizontal-css-tabs-located" src="/wp-content/uploads/2011/07/horizontal-css-tabs-located.gif" alt="" width="333" height="220" /></p>
<p>12.  Let&#8217;s space the horizontal tabs apart by adding 10px right margin to the li element.</p>
<p><img class="alignnone size-full wp-image-459" title="right-margin-horizontal-css-tabs" src="/wp-content/uploads/2011/07/right-margin-horizontal-css-tabs.gif" alt="" width="383" height="195" /></p>
<p>And we got our final product that looks like &#8230;</p>
<div id="attachment_437" class="wp-caption alignnone" style="width: 361px"><img class="size-full wp-image-437" title="horizontal CSS tabs" src="/wp-content/uploads/2011/07/horizontal-css-tabs-final.gif" alt="horizontal CSS tabs" width="351" height="217" /><p class="wp-caption-text">horizontal CSS tabs</p></div>
<p>And there you have it.</p>
]]></content:encoded>
			<wfw:commentRss>https://learnwebdesignonline.com/css-based-horizontal-tabs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Rollover Buttons</title>
		<link>https://learnwebdesignonline.com/css-rollover-buttons</link>
		<comments>https://learnwebdesignonline.com/css-rollover-buttons#comments</comments>
		<pubDate>Mon, 04 Jul 2011 14:53:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">https://learnwebdesignonline.com/?p=154</guid>
		<description><![CDATA[We want to create rollover buttons using CSS like the follow&#8230; When you roll your mouse over the button, the button state changes. 1. First we put the images of the two button states into one single image file called button.gif&#8230; The advantage of having both the hover-state graphic and the default-state graphic on the [...]]]></description>
			<content:encoded><![CDATA[<p>We want to create rollover buttons using CSS like the follow&#8230;</p>
<p>
<style>
.btnContinue {
	width: 89px;
	height: 27px;
	display: block;
	font-size: 10px;
	text-decoration: none;
	background-repeat:no-repeat;
	background-image:url(/example/css-button/button.gif);
}

.btnContinue:hover {
    background-position:right;
}
</style>
<a class="btnContinue" href="/"> </a>
</p>
<p>When you roll your mouse over the button, the button state changes.</p>
<p>1. First we put the images of the two button states into one single image file called button.gif&#8230;</p>
<p><img src="/example/css-button/button.gif" alt="" /></p>
<p>The advantage of having both the hover-state graphic and the default-state graphic on the same image file is that they are loaded at the same time during page loads. This avoids any flicker-effect during hover-over cause by the extra loading of the hover-state graphics.</p>
<p>2.  The left side of the image represents the default state of the button. And the right side of the image represents the hover state.  The image is in GIF format with a transparent background.</p>
<p>3. Write the code for a simple link with a single space as the link text. We don&#8217;t need text for the link since the &#8220;Click Me&#8221; text is already in the graphics of the button.</p>
<div id="attachment_162" class="wp-caption alignnone" style="width: 612px"><img class="size-full wp-image-162" title="CSS button code" src="/wp-content/uploads/2011/07/css-button-code.jpg" alt="CSS button code" width="602" height="449" /><p class="wp-caption-text">CSS button code</p></div>
<p>4. We gave this link a class name of &#8220;btnContinue&#8221;.</p>
<p>5. We define this new CSS class &#8220;btnContinue&#8221; in the head style section as shown above.</p>
<p>We had set the height and width properties to be 89px and 27px since that is the size of one button in the image. In order for the link to be clickable in the entire 89 pixel by 27 pixel area of this button to be clickable, we set <strong>display: block</strong>.</p>
<p>We set font-size to 10px to ensure that our space in the link does not become larger than the 89px by 27px area of the button. We set <strong>text-decoration:none</strong> so that there would not be an underline under the space character of the link.   Finally, we set the background image to be our graphical button.gif. We also specify background-repeat:no-repeat as we did not intend for the button image to repeat.</p>
<p>The graphical image with the two button is 178px wide.  But we only see the blue graphic button in its default state since our link element is only 89px wide.  By default, the background image will show the left and topmost portion of an image if it can not fit the whole image.</p>
<p>6. Now if you have your browser render the HTML code so far, you should get&#8230;</p>
<div id="attachment_163" class="wp-caption alignnone" style="width: 254px"><img class="size-full wp-image-163" title="default button state" src="/wp-content/uploads/2011/07/purecss-firstoutput.gif" alt="default button state" width="244" height="284" /><p class="wp-caption-text">default button state</p></div>
<p>As you hover over the button, you get the <a href="/cursor-hand-pointer">hand pointer cursor icon</a> of your browser.</p>
<p>7. Time to build in the hover effect so that the orange background image appears as well as you hover over the link. We will use the hover pseudo-class. To do that we create another CSS rule using the same class name <strong>btnContinue </strong>but with <strong>:hover</strong> after it as shown&#8230;</p>
<p><strong>.btnContinue:hover {</strong><br />
<strong> background-position:right;</strong><br />
<strong>}</strong></p>
<p>This rule is selected (or applies) when the user hovers over the element of the specified class. So when the user hover over our link with the class <strong>btnContinue</strong>, the properties in the rule <strong>.btnContinue:hover</strong> will apply as well as the properties in the <strong>.btnContinue</strong> rule.</p>
<p>The only property that we need to change upon hover is the background-position.  By setting the background-position to right, we see the right portion of the graphic file which shows the orange hover state of the button.</p>
<div id="attachment_164" class="wp-caption alignnone" style="width: 245px"><img class="size-full wp-image-164" title="CSS button hover state" src="/wp-content/uploads/2011/07/purecss-done.gif" alt="CSS button hover state" width="235" height="221" /><p class="wp-caption-text">CSS button hover state</p></div>
]]></content:encoded>
			<wfw:commentRss>https://learnwebdesignonline.com/css-rollover-buttons/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vertical Menu with Hover Effect using CSS</title>
		<link>https://learnwebdesignonline.com/vertical-menu-hover-effect-css</link>
		<comments>https://learnwebdesignonline.com/vertical-menu-hover-effect-css#comments</comments>
		<pubDate>Mon, 04 Jul 2011 05:21:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[revisit]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">https://learnwebdesignonline.com/?p=96</guid>
		<description><![CDATA[We will be constructing this vertical menu with HTML / CSS&#8230; View live code » Step 1: Setup a new HTML file with a tan background color as shown. Step 2: Create a HTML unordered-list structure with list elements that will become our menu. And this is what we have&#8230; Step 3: Because we want [...]]]></description>
			<content:encoded><![CDATA[<p>We will be constructing this vertical menu with HTML / CSS&#8230;</p>
<div id="attachment_97" class="wp-caption alignnone" style="width: 201px"><img class="size-full wp-image-97" title="vertical menu" src="/wp-content/uploads/2011/07/vertical-menu.gif" alt="vertical menu" width="191" height="132" /><p class="wp-caption-text">vertical menu</p></div>
<p><a href="/example/vertical-menu/vertical-menu.html">View live code »</a></p>
<p><strong>Step 1: </strong> Setup a new HTML file with a tan background color as shown.</p>
<div id="attachment_98" class="wp-caption alignnone" style="width: 318px"><img class="size-full wp-image-98" title="vertical menu step 1" src="/wp-content/uploads/2011/07/vertical-menu-1.gif" alt="vertical menu step 1" width="308" height="254" /><p class="wp-caption-text">vertical menu step 1</p></div>
<p><strong>Step 2:</strong> Create a HTML unordered-list structure with list elements that will become our menu.</p>
<div id="attachment_99" class="wp-caption alignnone" style="width: 281px"><img class="size-full wp-image-99" title="vertical menu step 2" src="/wp-content/uploads/2011/07/vertical-menu-2.gif" alt="vertical menu step 2" width="271" height="164" /><p class="wp-caption-text">vertical menu step 2</p></div>
<p>And this is what we have&#8230;</p>
<div id="attachment_100" class="wp-caption alignnone" style="width: 238px"><img class="size-full wp-image-100" title="vertical menu output after step2" src="/wp-content/uploads/2011/07/vertical-menu-2output.gif" alt="vertical menu output after step2" width="228" height="284" /><p class="wp-caption-text">vertical menu output after step2</p></div>
<p><strong>Step 3:</strong> Because we want our menu buttons to be clickable, we make them anchor links.</p>
<div id="attachment_101" class="wp-caption alignnone" style="width: 349px"><img class="size-full wp-image-101" title="vertical menu step 3" src="/wp-content/uploads/2011/07/vertical-menu-step3.gif" alt="vertical menu step 3" width="339" height="114" /><p class="wp-caption-text">vertical menu step 3</p></div>
<div id="attachment_102" class="wp-caption alignnone" style="width: 170px"><img class="size-full wp-image-102" title="vertical menu after step3" src="/wp-content/uploads/2011/07/vertical-menu-3.gif" alt="vertical menu after step3" width="160" height="116" /><p class="wp-caption-text">vertical menu after step3</p></div>
<p><strong>Step 4: </strong>To remove the bullets from our unordered list, we give our unordered list a class name called <strong>sidemenu</strong> and stylize it with <strong>list-style: none</strong> as shown&#8230;</p>
<div id="attachment_103" class="wp-caption alignnone" style="width: 343px"><img class="size-full wp-image-103" title="vertical menu step-4" src="/wp-content/uploads/2011/07/vertical-menu-4.gif" alt="vertical menu step-4" width="333" height="290" /><p class="wp-caption-text">vertical menu step-4</p></div>
<p><strong>Step 5:</strong> We want our list text to be of san-serif font (such as Verdana or Arial) for a cleaner uncluttered look. We add the <strong>font-family</strong> property as shown below. And we make the font-size 80% of normal.</p>
<div id="attachment_104" class="wp-caption alignnone" style="width: 402px"><img class="size-full wp-image-104" title="vertical menu step 5" src="/wp-content/uploads/2011/07/vertical-menu-5.gif" alt="vertical menu step 5" width="392" height="92" /><p class="wp-caption-text">vertical menu step 5</p></div>
<p>Now  we have &#8230;</p>
<div id="attachment_105" class="wp-caption alignnone" style="width: 144px"><img class="size-full wp-image-105" title="vertical menu output after step 5" src="/wp-content/uploads/2011/07/vertical-menu-5out.gif" alt="vertical menu output after step 5" width="134" height="108" /><p class="wp-caption-text">vertical menu output after step 5</p></div>
<p><strong>Step 6: </strong>Add borders to our individual list elements  with the following rule. This rule says to give a one pixel wide solid  border of color <strong>#6F3E04</strong> to <strong>&lt;li&gt;</strong> elements found within the <strong>&lt;ul&gt;</strong> element of class <strong>sidemenu</strong>.</p>
<div id="attachment_106" class="wp-caption alignnone" style="width: 279px"><img class="size-full wp-image-106" title="vertical menu step-6" src="/wp-content/uploads/2011/07/vertical-menu-6.gif" alt="vertical menu step-6" width="269" height="80" /><p class="wp-caption-text">vertical menu step-6</p></div>
<p>Note that we specify a top, left, and right borders; but we do not  specify a bottom border. That is because we don&#8217;t want both a top and  bottom border for the <strong>&lt;li&gt;</strong> elements. Otherwise adjacent elements will have double borders.</p>
<div id="attachment_107" class="wp-caption alignnone" style="width: 321px"><img class="size-full wp-image-107" title="vertical menu output after step 6" src="/wp-content/uploads/2011/07/vertical-menu-6out.gif" alt="vertical menu output after step 6" width="311" height="274" /><p class="wp-caption-text">vertical menu output after step 6</p></div>
<p><strong>Step 7:</strong> To close the menu, we add a bottom border to the <strong>&lt;ul&gt;</strong> element. Also we need to fix the width of the <strong>&lt;ul&gt;</strong> element to be 100px and give our menu a lighter background color of <strong>#EEEEDC</strong>. All this is done by the addition of the following properties.</p>
<div id="attachment_108" class="wp-caption alignnone" style="width: 402px"><img class="size-full wp-image-108" title="vertical menu step-7" src="/wp-content/uploads/2011/07/vertical-menu-7.gif" alt="vertical menu step-7" width="392" height="131" /><p class="wp-caption-text">vertical menu step-7</p></div>
<p>Now our menu is starting to look like a menu.</p>
<div id="attachment_109" class="wp-caption alignnone" style="width: 242px"><img class="size-full wp-image-109" title="After step 7 in Internet Explorer 6.0" src="/wp-content/uploads/2011/07/vertical-menu-7ex.gif" alt="After step 7 in Internet Explorer 6.0" width="232" height="226" /><p class="wp-caption-text">After step 7 in Internet Explorer</p></div>
<p>as seen in Internet Explorer 6.0.</p>
<p>At least in Internet Explorer that is. Take a look at it in Firefox, and this is what you see&#8230;</p>
<div id="attachment_110" class="wp-caption alignnone" style="width: 250px"><img class="size-full wp-image-110" title="After step 7 in Firefox" src="/wp-content/uploads/2011/07/vertical-menu-7ff.gif" alt="After step 7 in Firefox" width="240" height="225" /><p class="wp-caption-text">After step 7 in Firefox</p></div>
<p>That is because different browsers have different default paddings and margins on elements.</p>
<p><strong>Step 8:</strong> Hence, we will explicitly zero out the padding and margin on our <strong>&lt;ul&gt;</strong> element&#8230;</p>
<div id="attachment_111" class="wp-caption alignnone" style="width: 410px"><img class="size-full wp-image-111" title="vertical menu step8" src="/wp-content/uploads/2011/07/vertical-menu-8.gif" alt="vertical menu step8" width="400" height="172" /><p class="wp-caption-text">vertical menu step8</p></div>
<p>and this makes it look correct on both browsers&#8230;</p>
<div id="attachment_112" class="wp-caption alignnone" style="width: 321px"><img class="size-full wp-image-112" title="vertical-menu after step8" src="/wp-content/uploads/2011/07/vertical-menu-step8.gif" alt="vertical-menu after step8" width="311" height="333" /><p class="wp-caption-text">vertical-menu after step8</p></div>
<p><strong>Step 9</strong>: The underlining of the links is adding clutter. Get rid of the underline from the links by setting the <strong>text-decoration</strong> of the <strong>&lt;a&gt;</strong> element to the value <strong>none</strong> as shown here&#8230;</p>
<div id="attachment_113" class="wp-caption alignnone" style="width: 216px"><img class="size-full wp-image-113" title="vertical-menu step-9" src="/wp-content/uploads/2011/07/vertical-menu-9.gif" alt="vertical-menu step-9" width="206" height="53" /><p class="wp-caption-text">vertical-menu step-9</p></div>
<p>The underline is gone. But they are still links as evidence by the hand icon when you hover your mouse over the text. The problem is that if you hover over the non-text portion of the menu,  the hand icon disappears &#8212; making the non-text portion of the menu  non-clickable.</p>
<div id="attachment_114" class="wp-caption alignnone" style="width: 307px"><img class="size-full wp-image-114" title="step9 vertical-menu" src="/wp-content/uploads/2011/07/step9-vertical-menu.gif" alt="step9 vertical-menu" width="297" height="134" /><p class="wp-caption-text">step9 vertical-menu</p></div>
<p><strong>Step 10:</strong> We fix this by setting the <strong>&lt;a&gt;</strong> element to <strong>display: block</strong>.</p>
<div id="attachment_115" class="wp-caption alignnone" style="width: 234px"><img class="size-full wp-image-115" title="step10 code" src="/wp-content/uploads/2011/07/step10-code.gif" alt="step10 code" width="224" height="76" /><p class="wp-caption-text">step10 code</p></div>
<p>This works in Firefox but not in Internet Explorer.</p>
<div id="attachment_116" class="wp-caption alignnone" style="width: 352px"><img class="size-full wp-image-116" title="step10 output" src="/wp-content/uploads/2011/07/step10-output.gif" alt="step10 output" width="342" height="420" /><p class="wp-caption-text">step10 output</p></div>
<p><strong>Step 11:</strong> It turns out that Internet Explorer likes to have a <strong>width</strong> in order for <strong>display: block</strong> to take effect. For the time being, we set this width to be 100px &#8212; the same as the width that we had set for the <strong>&lt;ul&gt;</strong> element.</p>
<div id="attachment_117" class="wp-caption alignnone" style="width: 254px"><img class="size-full wp-image-117" title="vertical-menu step-11" src="/wp-content/uploads/2011/07/step11-vertical-menu.gif" alt="vertical-menu step-11" width="244" height="104" /><p class="wp-caption-text">vertical-menu step-11</p></div>
<p><strong>Step 12:</strong> Next step is to stylize the links to get rid of that default blue color. And apply some padding as shown in the below rule.</p>
<div id="attachment_118" class="wp-caption alignnone" style="width: 248px"><img class="size-full wp-image-118" title="step12 vertical-menu" src="/wp-content/uploads/2011/07/step12-vertical-menu.gif" alt="step12 vertical-menu" width="238" height="154" /><p class="wp-caption-text">step12 vertical-menu</p></div>
<p>And here is the result&#8230;</p>
<div id="attachment_119" class="wp-caption alignnone" style="width: 170px"><img class="size-full wp-image-119" title="step12 output" src="/wp-content/uploads/2011/07/step12-output.gif" alt="step12 output" width="160" height="106" /><p class="wp-caption-text">step12 output</p></div>
<p><strong>Step 13: </strong>If you take a look at the menu in both Firefox  and Internet Explorer 6.0, you will notice that after we have added the  padding, the width of the menu in Explorer is no longer correct. It has  become too width.</p>
<div id="attachment_120" class="wp-caption alignnone" style="width: 335px"><img class="size-full wp-image-120" title="vertical-menu step-13" src="/wp-content/uploads/2011/07/vertical-menu-step-13.gif" alt="vertical-menu step-13" width="325" height="482" /><p class="wp-caption-text">vertical-menu step-13</p></div>
<p><strong>Step 14:</strong> To fix this, we have to set the width of the <strong>&lt;a&gt;</strong> links to be 78px. Why 78px? We have to remember that the definition of width is the <em><strong>content width</strong></em> of an element &#8212; that is the width excluding the margin, padding, and borders. Our <strong>&lt;ul&gt;</strong> is 100px. Inside the <strong>&lt;ul&gt;</strong> is our <strong>&lt;li&gt;</strong> which has an one pixel left border and a one pixel right border. So the content width of our <strong>&lt;li&gt;</strong> is 98px. The <strong>&lt;a&gt;</strong> that is inside our <strong>&lt;li&gt;</strong> has a left padding of 10px and a right padding of 10px. Excluding the padding, the content width of the <strong>&lt;a&gt;</strong> element is 78px.</p>
<div id="attachment_121" class="wp-caption alignnone" style="width: 212px"><img class="size-full wp-image-121" title="vertical-menu step14" src="/wp-content/uploads/2011/07/vertical-menu-step14.gif" alt="vertical-menu step14" width="202" height="139" /><p class="wp-caption-text">vertical-menu step14</p></div>
<p><strong>Step 15:</strong> And now it looks perfect in  both Internet Explorer and Firefox.</p>
<div id="attachment_122" class="wp-caption alignnone" style="width: 335px"><img class="size-full wp-image-122" title="vertical-menu step-15" src="/wp-content/uploads/2011/07/vertical-menu-15.gif" alt="vertical-menu step-15" width="325" height="473" /><p class="wp-caption-text">vertical-menu step-15</p></div>
<p><strong>Step 16: </strong>Next we add a hover effect to the menu by  adding the following rule. As the mouse hovers over the menu, the text  color changes to <strong>#EEEEDC</strong> and the background color changes to <strong>#B9BB79</strong>.</p>
<div id="attachment_123" class="wp-caption alignnone" style="width: 287px"><img class="size-full wp-image-123" title="vertical-menu step-16" src="/wp-content/uploads/2011/07/vertical-menu-16.gif" alt="vertical-menu step-16" width="277" height="277" /><p class="wp-caption-text">vertical-menu step-16</p></div>
<p><strong>Step 17:</strong> Test this in Firefox and Internet Explorer and see that it works as expected.</p>
<div id="attachment_124" class="wp-caption alignnone" style="width: 201px"><img class="size-full wp-image-124" title="vertical menu step-17" src="/wp-content/uploads/2011/07/vertical-menu-17.gif" alt="vertical menu step-17" width="191" height="132" /><p class="wp-caption-text">vertical menu step-17</p></div>
<p>The menu is complete, you can get the full code by <a href="/example/vertical-menu/vertical-menu.html">viewing the live code</a> and doing a view-source in your browser.</p>
]]></content:encoded>
			<wfw:commentRss>https://learnwebdesignonline.com/vertical-menu-hover-effect-css/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Cursor Hand or Cursor Pointer?</title>
		<link>https://learnwebdesignonline.com/cursor-hand-pointer</link>
		<comments>https://learnwebdesignonline.com/cursor-hand-pointer#comments</comments>
		<pubDate>Mon, 04 Jul 2011 01:42:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">https://learnwebdesignonline.com/?p=16</guid>
		<description><![CDATA[The truth is that most often you need neither &#8230; cursor: hand; nor cursor: pointer; Most of the time, your browser will change the cursor to be a clickable icon when you hover over a link. For example, the following code will give you a proper cursor without any CSS rules&#8230; View live code And [...]]]></description>
			<content:encoded><![CDATA[<p>The truth is that most often you need neither &#8230;</p>
<p><strong>cursor: hand;</strong></p>
<p>nor</p>
<p><strong>cursor: pointer;</strong></p>
<p>Most of the time, your browser will change the cursor to be a  clickable icon when you hover over a link. For example, the following  code will give you a proper cursor without any CSS rules&#8230;</p>
<div id="attachment_18" class="wp-caption alignnone" style="width: 529px"><img class="size-full wp-image-18" title="hand cursor example code" src="/wp-content/uploads/2011/07/hand-cursor_11.gif" alt="hand cursor example code" width="519" height="252" /><p class="wp-caption-text">hand cursor example code</p></div>
<p><a href="/example/code/cursor-auto.html">View live code</a></p>
<p>And this is the standard perferred way of constructing a clickable image.</p>
<p>However, sometimes you do not have an &lt;a&gt; tag link bounding your image.   You just have an image which uses Javascript to implement a click as in &#8230;</p>
<div id="attachment_19" class="wp-caption alignnone" style="width: 571px"><img class="size-full wp-image-19" title="hand cursor code 2" src="/wp-content/uploads/2011/07/hand-cursor_2.gif" alt="hand cursor code 2" width="561" height="305" /><p class="wp-caption-text">hand cursor code 2</p></div>
<p><a href="/example/code/cursor-alt.html">View live code.</a></p>
<p>Then the browser will not know to change the cursor to a hand icon when mouse is over the image unless you add the CSS rule</p>
<p><strong>cursor: pointer;</strong></p>
<p>on your image as shown above.</p>
<p>All &#8220;modern&#8221; browsers will support &#8220;<strong>pointer</strong>&#8221; and that is the W3C standard.  As you can see from the <a href="http://www.w3.org/TR/REC-CSS2/ui.html#cursor-props">W3C specs</a>, &#8220;<strong>hand</strong>&#8221; is not a valid valid for the &#8220;cursor&#8221; property.</p>
<p>But you sometimes might see old code that uses &#8230;</p>
<p><strong>cursor: hand;</strong></p>
<p>That is because the &#8220;<strong>hand</strong>&#8221; value is only needed by Internet Explorer 5.5 and below.<strong> </strong> But hardly anyone uses Internet Explorer 5.5 anymore.  So use&#8230;</p>
<p><strong>cursor: pointer;</strong></p>
<p>And not worry about&#8230;</p>
<p><strong>cursor: hand;</strong></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://learnwebdesignonline.com/cursor-hand-pointer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
