<?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>Web Dev News&#187; CSS &#8211; News for Web Developers</title>
	<atom:link href="http://webdevnews.net/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://webdevnews.net</link>
	<description>News For Web Developers</description>
	<lastBuildDate>Sat, 30 Jan 2010 15:25:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Conditional Statements, Cross-Browser Analysis, &amp; Tools Bars for Web Developers</title>
		<link>http://webdevnews.net/2009/04/conditional-statements-cross-browser-analysis-tools-bars-for-web-developers/</link>
		<comments>http://webdevnews.net/2009/04/conditional-statements-cross-browser-analysis-tools-bars-for-web-developers/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 13:00:54 +0000</pubDate>
		<dc:creator>Jeffrey Scott -TypeHost Web Development</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Cross-Browser]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[FireFox]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[web kit]]></category>

		<guid isPermaLink="false">http://webdevnews.net/?p=460</guid>
		<description><![CDATA[When designing sites or themes, I currently test and make CSS revisions for six different browsers:

Firefox 3
IE 7
IE 6
Safari
Chrome
Opera

Now that IE 8 has been released, it will have to be added to the list as well. According to this blog, conditional browser statements and style-sheets can be used to set web pages to display as [...]<p>This is a post from <a href="http://webdevnews.net" title="News for Web Developers">Web Dev News</a>, a site brought to you by <a href="http://xavisys.com" title="For all your web development needs">Xavisys Web Development</a>.  <br/><br/><a href="http://webdevnews.net/2009/04/conditional-statements-cross-browser-analysis-tools-bars-for-web-developers/">Conditional Statements, Cross-Browser Analysis, &#038; Tools Bars for Web Developers</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>When designing sites or themes, I currently test and make CSS revisions for six different browsers:</p>
<ol>
<li>Firefox 3</li>
<li>IE 7</li>
<li>IE 6</li>
<li>Safari</li>
<li>Chrome</li>
<li>Opera</li>
</ol>
<p>Now that <a href="http://blogs.msdn.com/ie/">IE 8 has been released</a>, it will have to be added to the list as well. According to this blog, conditional browser statements and style-sheets can be used to set web pages to display as IE 7 pages within IE 8:</p>
<p><span id="more-460"></span></p>
<p><a href="http://blogs.msdn.com/ie/archive/2008/03/09/using-the-emulate-ie7-button.aspx">http://blogs.msdn.com/ie/archive/2008/03/09/using-the-emulate-ie7-button.aspx</a></p>
<p><a href="http://blogs.msdn.com/ie/archive/2008/03/07/improved-productivity-through-internet-explorer-8-developer-tools.aspx">http://blogs.msdn.com/ie/archive/2008/03/07/improved-productivity-through-internet-explorer-8-developer-tools.aspx</a></p>
<p>I find conditional style sheets the most effective way to manage cross browser issues, and generally create one style-sheet for both IE 6 and IE 7 to address the particular nature of those browsers.</p>
<p>For more information on Conditional Statements for IE Browsers, see:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx</a></p>
<p>For some time, I have actually been considering that it may be better to have a conditional style-sheet for every browser. I have been putting off implementing browser specific CSS code such as Mozilla extensions:</p>
<p><a href="https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions">https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions</a></p>
<p>essentially because of principle. Imagine you purchased a calculator. On one calculator, 2 + 2 = 4, on another it is 4.1, on another 3.9, etc.  Someone says, well you should run a slightly different set of values on this calculator, and a different set on this one, and you&#8217;ll end up with the correct value. That is the same as conditional style-sheets – they shouldn&#8217;t be necessary, because this is what the CSS is for &#8211; we made an exception for IE because the browsers had so many problems, but the movement should be in the other direction. Either way, I can see little way around them, but I still haven&#8217;t found a way to target Opera/Safari exclusively through this method either.</p>
<p>When it comes to cross-browser analysis and testing, I find these tools to be essential:</p>
<p><strong>Firefox Browser:</strong></p>
<ol>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2104">CSS Viewer</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2289">CSS Validator</a> / <a href="https://addons.mozilla.org/en-US/firefox/addon/2245">W3C CSS Validator</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/249">HTML Validator</a></li>
</ol>
<p><strong>Internet Explorer Browsers:</strong></p>
<ol>
<li><a href="http://tredosoft.com/Multiple_IE">Multiple IEs</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;displaylang=en">IE Developer&#8217;s Toolbar</a></li>
</ol>
<p><strong>Safari:</strong></p>
<ol>
<li><a href="http://trac.webkit.org/wiki/Web%20Inspector">Safari / Web Kit &#8211; Web Inspector</a></li>
</ol>
<p><strong>Chrome Browser:</strong></p>
<ol>
<li><a href="http://www.google.com/chrome/intl/en/webmasters-faq.html">Chrome / Web Kit &#8211; Web Inspector</a></li>
</ol>
<p><strong>Opera Browser:</strong></p>
<ol>
<li><a href="http://dev.opera.com/articles/view/introduction-to-opera-dragonfly/">Opera Dragonfly</a></li>
</ol>
<p>I don&#8217;t know any web developer currently that is not using Firebug to inspect the CSS of div elements in a page and making CSS adjustments, it is really indispensable. The &#8216;Web Developer&#8217; add-on has some powerful tools as well for inspection, div element outlining, CSS and HTML validation. Multiple IEs is great because it allows you to overcome the Windows restriction of only having one Microsoft browser version installed at one time – it even allows you to test as far back as IE 3.0. IE Developer&#8217;s Toolbar is not as good as Firebug, or even the Chrome debugging tool which is itself excellent. In fact, the Chrome debugging tool + JavaScript console is a worthy equivalent to Firebug in most areas, once you become accustomed to it. The Safari Toolbar seems basically identical to the Chrome kit. By the time it finally comes to testing in Opera, the Opera web development tools seem promising, but I rarely have the interest in getting involved too much on this platform.</p>
<p>With these tools – conditional style-sheets and browser-specific developer toolbars, you should be able to pull apart your CSS code enough to figure out where and why the small glitches are appearing in the display of web pages in the different browsers. While I would love to be able to write conditional style-sheets for every browser, to ensure pixel-perfect specific margins and details, I will continue to hope for more improvements like we have seen with FF3, IE8, Safari, &amp; Chrome coming closer to a universal rendering of CSS values. Until then, these tools will remain for working out the small bugs and issues with cross browser display.</p>
<!-- google_ad_section_end --><p>This is a post from <a href="http://webdevnews.net" title="News for Web Developers">Web Dev News</a>, a site brought to you by <a href="http://xavisys.com" title="For all your web development needs">Xavisys Web Development</a>.  <br/><br/><a href="http://webdevnews.net/2009/04/conditional-statements-cross-browser-analysis-tools-bars-for-web-developers/">Conditional Statements, Cross-Browser Analysis, &#038; Tools Bars for Web Developers</a></p>



Share and Enjoy:


	<a rel="nofollow"  href="http://twitter.com/home?status=Conditional%20Statements%2C%20Cross-Browser%20Analysis%2C%20%26%20Tools%20Bars%20for%20Web%20Developers%20-%20http%3A%2F%2Fwebdevnews.net%2F2009%2F04%2Fconditional-statements-cross-browser-analysis-tools-bars-for-web-developers%2F" title="Twitter"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwebdevnews.net%2F2009%2F04%2Fconditional-statements-cross-browser-analysis-tools-bars-for-web-developers%2F&amp;title=Conditional%20Statements%2C%20Cross-Browser%20Analysis%2C%20%26%20Tools%20Bars%20for%20Web%20Developers&amp;notes=When%20designing%20sites%20or%20themes%2C%20I%20currently%20test%20and%20make%20CSS%20revisions%20for%20six%20different%20browsers%3A%0D%0A%0D%0A%09Firefox%203%0D%0A%09IE%207%0D%0A%09IE%206%0D%0A%09Safari%0D%0A%09Chrome%0D%0A%09Opera%0D%0A%0D%0ANow%20that%20IE%208%20has%20been%20released%2C%20it%20will%20have%20to%20be%20added%20to%20the%20list%20as%20well.%20According%20to%20t" title="del.icio.us"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwebdevnews.net%2F2009%2F04%2Fconditional-statements-cross-browser-analysis-tools-bars-for-web-developers%2F&amp;title=Conditional%20Statements%2C%20Cross-Browser%20Analysis%2C%20%26%20Tools%20Bars%20for%20Web%20Developers" title="StumbleUpon"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwebdevnews.net%2F2009%2F04%2Fconditional-statements-cross-browser-analysis-tools-bars-for-web-developers%2F&amp;title=Conditional%20Statements%2C%20Cross-Browser%20Analysis%2C%20%26%20Tools%20Bars%20for%20Web%20Developers&amp;bodytext=When%20designing%20sites%20or%20themes%2C%20I%20currently%20test%20and%20make%20CSS%20revisions%20for%20six%20different%20browsers%3A%0D%0A%0D%0A%09Firefox%203%0D%0A%09IE%207%0D%0A%09IE%206%0D%0A%09Safari%0D%0A%09Chrome%0D%0A%09Opera%0D%0A%0D%0ANow%20that%20IE%208%20has%20been%20released%2C%20it%20will%20have%20to%20be%20added%20to%20the%20list%20as%20well.%20According%20to%20t" title="Digg"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwebdevnews.net%2F2009%2F04%2Fconditional-statements-cross-browser-analysis-tools-bars-for-web-developers%2F" title="Sphinn"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwebdevnews.net%2F2009%2F04%2Fconditional-statements-cross-browser-analysis-tools-bars-for-web-developers%2F&amp;t=Conditional%20Statements%2C%20Cross-Browser%20Analysis%2C%20%26%20Tools%20Bars%20for%20Web%20Developers" title="Facebook"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwebdevnews.net%2F2009%2F04%2Fconditional-statements-cross-browser-analysis-tools-bars-for-web-developers%2F&amp;title=Conditional%20Statements%2C%20Cross-Browser%20Analysis%2C%20%26%20Tools%20Bars%20for%20Web%20Developers&amp;annotation=When%20designing%20sites%20or%20themes%2C%20I%20currently%20test%20and%20make%20CSS%20revisions%20for%20six%20different%20browsers%3A%0D%0A%0D%0A%09Firefox%203%0D%0A%09IE%207%0D%0A%09IE%206%0D%0A%09Safari%0D%0A%09Chrome%0D%0A%09Opera%0D%0A%0D%0ANow%20that%20IE%208%20has%20been%20released%2C%20it%20will%20have%20to%20be%20added%20to%20the%20list%20as%20well.%20According%20to%20t" title="Google Bookmarks"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://webdevnews.net/2009/04/conditional-statements-cross-browser-analysis-tools-bars-for-web-developers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Styling the Drupal User Login Block &#8211; PHP Code &amp; CSS</title>
		<link>http://webdevnews.net/2008/11/styling-the-drupal-user-login-block-php-code-css/</link>
		<comments>http://webdevnews.net/2008/11/styling-the-drupal-user-login-block-php-code-css/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 10:00:17 +0000</pubDate>
		<dc:creator>Jeffrey Scott -TypeHost Web Development</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://webdevnews.net/?p=290</guid>
		<description><![CDATA[This tutorial goes through the steps of one way to create a custom user login block for Drupal. Best is to disable the original login block in the admin/build/block section, start with a new block with custom code, and then style the details with CSS. The requirements for this project are a rounded corner, blue [...]<p>This is a post from <a href="http://webdevnews.net" title="News for Web Developers">Web Dev News</a>, a site brought to you by <a href="http://xavisys.com" title="For all your web development needs">Xavisys Web Development</a>.  <br/><br/><a href="http://webdevnews.net/2008/11/styling-the-drupal-user-login-block-php-code-css/">Styling the Drupal User Login Block &#8211; PHP Code &#038; CSS</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>This tutorial goes through the steps of one way to create a custom user login block for Drupal. Best is to disable the original login block in the admin/build/block section, start with a new block with custom code, and then style the details with CSS. The requirements for this project are a rounded corner, blue background block with two custom tabs at the top.</p>
<p>1. in admin/build/blocks – click on the “add new block” tab</p>
<p>2. enter the following code:</p>
<pre class="brush: php">&lt;?php global $user; ?&gt;
&lt;?php if ($user-&gt;uid) : ?&gt;
&lt;span class=&quot;login_text&quot;&gt;Welcome, &lt;/span&gt; &lt;?php print ($user-&gt;name); ?&gt; &lt;br&gt;
&lt;?php print l(&quot;Your Account&quot;,&#039;user/&#039;.$user-&gt;uid); ?&gt; |
&lt;?php print l(&quot;Log-Out&quot;,&quot;logout&quot;); ?&gt;
&lt;?php else : ?&gt;
&lt;div id=&quot;usertabs&quot;&gt;
&lt;span class=&quot;utabs1&quot;&gt;Log In&lt;/span&gt;&lt;span class=&quot;utabs2&quot;&gt;&lt;a href=&quot;/user/register&quot;&gt;Sign Up!&lt;/a&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div id=&quot;umain&quot;&gt;
&lt;form action=&quot;/user?&lt;?php print drupal_get_destination() ?&gt;&quot; method=&quot;post&quot; id=&quot;user-login-form&quot;&gt;
Username:
&lt;input type=&quot;text&quot; maxlength=&quot;60&quot; name=&quot;name&quot; id=&quot;edit-name&quot; size=&quot;20&quot; value=&quot;&quot; tabindex=&quot;1&quot; class=&quot;form-text required&quot; /&gt;
&lt;br&gt;
Password:
&lt;input type=&quot;password&quot; name=&quot;pass&quot; id=&quot;edit-pass&quot; size=&quot;20&quot; tabindex=&quot;2&quot; class=&quot;form-text required&quot; /&gt;
&lt;br&gt;
&lt;span class=&quot;utabs3&quot;&gt;&lt;a href=&quot;/user/password&quot; title=&quot;Forgot your password?&quot;&gt;Forgot your password?&lt;/a&gt;&lt;/span&gt;
&lt;span&gt;&lt;input type=&quot;submit&quot; name=&quot;op&quot; id=&quot;edit-submit&quot; value=&quot;Log In&quot; tabindex=&quot;3&quot; class=&quot;form-submit&quot; /&gt;
&lt;/span&gt;
&lt;input type=&quot;hidden&quot; name=&quot;form_id&quot; id=&quot;edit-user-login&quot; value=&quot;user_login&quot; /&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;?php endif; ?&gt;</pre>
<p><span id="more-290"></span></p>
<p>This code originally came from: <a href="http://nossdutytask.com/node/240" target="_self">http://nossdutytask.com/node/240</a></p>
<p>There are also some nice examples at: <a href="http://nossdutytask.com/node/228" target="_self">http://nossdutytask.com/node/228</a></p>
<p>I modified the code to add some css IDs, classes, span tags, and also the text/links for the top tabs.</p>
<p>3. Select PHP code for the input and save the block.</p>
<p>4. From the main blocks page, click on “configure” for the block you just created. I selected to show this block only for “anonymous user” because I did not need the simplified display after the user has been logged in. The code generates a block that can also be customized to show the site status for authenticated users, but usually the navigation menu does this sufficiently. Enable the block and position it where you like in the display.</p>
<p>5. The rest is basically CSS – setting the image as the background for the login area and the tabs, positioning the text elements and fields. This example is based on a 250px wide column with a two column layout. It includes bold text on the display and overrides the default styling of the Drupal user login form elements.</p>
<p>There is a vertical-alignment fix to standardize the display in IE, and a 1px addition to the lower input field so that the form will align evenly on both ends. Add the following CSS to your theme in style.css, blocks.css, or wherever fits best.</p>
<pre class="brush: css">
#block-block-4 {
color: #fff;
}
#block-block-4 a {
color: #fff;
}
#umain {
font-weight: bold;
height: 127px;
width: 250px;
background: transparent url(&amp;amp;amp;amp;amp;quot;../img/login_bg.jpg&amp;amp;amp;amp;amp;quot;) no-repeat top left;
padding-top: 20px;
vertical-align: middle;
}
#usertabs {
height: 23px;
width: 250px;
background: transparent url(&amp;amp;amp;amp;amp;quot;../img/tabs1.jpg&amp;amp;amp;amp;amp;quot;) no-repeat top left;
}
#usertabs a {
color: #333;
}
.utabs1 {
font-weight: bold;
float: left;
padding-top: 4px;
padding-left: 25px;
}
.utabs2 {
font-weight: bold;
float: right;
color: #333;
padding-top: 4px;
padding-right: 60px;
}
.utabs3 {
font-weight: bold;
float: left;
padding-left: 25px;
padding-top: 4px;
}
#umain #edit-name {
margin-bottom: 5px;
width: 147px;
}
#umain #edit-pass {
margin-bottom: 10px;
width: 148px;
}</pre>
<p>Note: the “block-block-4” value will be contingent on the name of the block that was created to input the custom PHP code of the login form.</p>
<p><strong>IMAGES:</strong></p>
<p>Upload to your theme’s “image” folder (in this case named ‘img’):</p>
<p>Tabs Background image: tabs1.jpg:</p>
<div id="attachment_292" class="wp-caption alignleft" style="width: 260px"><a href="http://webdevnews.net/wp-content/uploads/2008/11/tabs1.jpg"><img class="size-full wp-image-292" title="tabs1" src="http://webdevnews.net/wp-content/uploads/2008/11/tabs1.jpg" alt="tabs1 Styling the Drupal User Login Block   PHP Code & CSS" width="250" height="23" /></a><p class="wp-caption-text">tabs1.jpg</p></div>
<p><br class="saveme" /><br class="saveme" /><br class="saveme" /><br class="saveme" /><br class="saveme" /></p>
<p>Login Background image: login_bg.jpg</p>
<div id="attachment_293" class="wp-caption alignleft" style="width: 260px"><a href="http://webdevnews.net/wp-content/uploads/2008/11/login_bg.jpg"><img class="size-full wp-image-293" title="login_bg" src="http://webdevnews.net/wp-content/uploads/2008/11/login_bg.jpg" alt="login bg Styling the Drupal User Login Block   PHP Code & CSS" width="250" height="127" /></a><p class="wp-caption-text">login_bg.jpg</p></div>
<p><br class="saveme" /><br class="saveme" /><br class="saveme" /><br class="saveme" /><br class="saveme" /><br class="saveme" /><br class="saveme" /><br class="saveme" /><br class="saveme" /><br class="saveme" /><br class="saveme" /></p>
<p>7. To add a custom button, also upload and add this CSS:</p>
<pre class="brush: css">
#umain #edit-submit {
float: right;
margin-right: 20px;
background-color: transparent;
color: #333;
border: none;
font: 9pt/1.5em Arial, Tahoma, Verdana, &amp;amp;amp;amp;amp;quot;Lucida Grande&amp;amp;amp;amp;amp;quot;, sans-serif;
font-weight: bold;
background-image: url(&amp;amp;amp;amp;amp;quot;../img/button1.jpg&amp;amp;amp;amp;amp;quot;);
background-repeat: no-repeat;
height: 24px;
width: 58px;
cursor: pointer;
}
</pre>
<p><strong>BUTTON IMAGE:</strong></p>
<p>button1.jpg</p>
<div id="attachment_294" class="wp-caption alignnone" style="width: 68px"><a href="http://webdevnews.net/wp-content/uploads/2008/11/button1.jpg"><img class="size-full wp-image-294" title="button1" src="http://webdevnews.net/wp-content/uploads/2008/11/button1.jpg" alt="button1 Styling the Drupal User Login Block   PHP Code & CSS" width="58" height="24" /></a><p class="wp-caption-text">button1.jpg</p></div>
<p><strong>FINAL RESULT:</strong></p>
<div id="attachment_295" class="wp-caption alignleft" style="width: 276px"><a href="http://webdevnews.net/wp-content/uploads/2008/11/screenshot-login.jpg"><img class="size-full wp-image-295" title="screenshot-login" src="http://webdevnews.net/wp-content/uploads/2008/11/screenshot-login.jpg" alt="screenshot login Styling the Drupal User Login Block   PHP Code & CSS" width="266" height="165" /></a><p class="wp-caption-text">screenshot-login.jpg</p></div>
<p>Hopefully, this will save some people a lot of time and is also a good base for doing further customization with the background images and CSS.</p>
<p><strong>FURTHER REFERENCES:</strong></p>
<p><a href="http://drupal.org/node/134319" target="_self">http://drupal.org/node/134319</a><br />
<a href="http://drupal.org/node/19855" target="_self">http://drupal.org/node/19855</a><br />
<a href="http://drupal.org/node/92657" target="_self">http://drupal.org/node/92657</a><br />
<a href="http://drupal.org/node/84724" target="_self">http://drupal.org/node/84724</a></p>
<!-- google_ad_section_end --><p>This is a post from <a href="http://webdevnews.net" title="News for Web Developers">Web Dev News</a>, a site brought to you by <a href="http://xavisys.com" title="For all your web development needs">Xavisys Web Development</a>.  <br/><br/><a href="http://webdevnews.net/2008/11/styling-the-drupal-user-login-block-php-code-css/">Styling the Drupal User Login Block &#8211; PHP Code &#038; CSS</a></p>



Share and Enjoy:


	<a rel="nofollow"  href="http://twitter.com/home?status=Styling%20the%20Drupal%20User%20Login%20Block%20-%20PHP%20Code%20%26%20CSS%20-%20http%3A%2F%2Fwebdevnews.net%2F2008%2F11%2Fstyling-the-drupal-user-login-block-php-code-css%2F" title="Twitter"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwebdevnews.net%2F2008%2F11%2Fstyling-the-drupal-user-login-block-php-code-css%2F&amp;title=Styling%20the%20Drupal%20User%20Login%20Block%20-%20PHP%20Code%20%26%20CSS&amp;notes=This%20tutorial%20goes%20through%20the%20steps%20of%20one%20way%20to%20create%20a%20custom%20user%20login%20block%20for%20Drupal.%20Best%20is%20to%20disable%20the%20original%20login%20block%20in%20the%20admin%2Fbuild%2Fblock%20section%2C%20start%20with%20a%20new%20block%20with%20custom%20code%2C%20and%20then%20style%20the%20details%20with%20CSS" title="del.icio.us"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwebdevnews.net%2F2008%2F11%2Fstyling-the-drupal-user-login-block-php-code-css%2F&amp;title=Styling%20the%20Drupal%20User%20Login%20Block%20-%20PHP%20Code%20%26%20CSS" title="StumbleUpon"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwebdevnews.net%2F2008%2F11%2Fstyling-the-drupal-user-login-block-php-code-css%2F&amp;title=Styling%20the%20Drupal%20User%20Login%20Block%20-%20PHP%20Code%20%26%20CSS&amp;bodytext=This%20tutorial%20goes%20through%20the%20steps%20of%20one%20way%20to%20create%20a%20custom%20user%20login%20block%20for%20Drupal.%20Best%20is%20to%20disable%20the%20original%20login%20block%20in%20the%20admin%2Fbuild%2Fblock%20section%2C%20start%20with%20a%20new%20block%20with%20custom%20code%2C%20and%20then%20style%20the%20details%20with%20CSS" title="Digg"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwebdevnews.net%2F2008%2F11%2Fstyling-the-drupal-user-login-block-php-code-css%2F" title="Sphinn"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwebdevnews.net%2F2008%2F11%2Fstyling-the-drupal-user-login-block-php-code-css%2F&amp;t=Styling%20the%20Drupal%20User%20Login%20Block%20-%20PHP%20Code%20%26%20CSS" title="Facebook"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwebdevnews.net%2F2008%2F11%2Fstyling-the-drupal-user-login-block-php-code-css%2F&amp;title=Styling%20the%20Drupal%20User%20Login%20Block%20-%20PHP%20Code%20%26%20CSS&amp;annotation=This%20tutorial%20goes%20through%20the%20steps%20of%20one%20way%20to%20create%20a%20custom%20user%20login%20block%20for%20Drupal.%20Best%20is%20to%20disable%20the%20original%20login%20block%20in%20the%20admin%2Fbuild%2Fblock%20section%2C%20start%20with%20a%20new%20block%20with%20custom%20code%2C%20and%20then%20style%20the%20details%20with%20CSS" title="Google Bookmarks"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://webdevnews.net/2008/11/styling-the-drupal-user-login-block-php-code-css/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>CSS Trick: Turning a background image into a clickable link</title>
		<link>http://webdevnews.net/2007/01/css-trick-turning-a-background-image-into-a-clickable-link/</link>
		<comments>http://webdevnews.net/2007/01/css-trick-turning-a-background-image-into-a-clickable-link/#comments</comments>
		<pubDate>Thu, 11 Jan 2007 18:44:39 +0000</pubDate>
		<dc:creator>Brandon Wood</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.attackr.com/css-trick-turning-a-background-image-into-a-clickable-link/</guid>
		<description><![CDATA[While working on a design for a client&#8217;s site the other day, I had the need to make a background image a clickable link.  Their logo was being used as a background image in the site&#8217;s header, and we wanted it to act as a link to the home page &#8211; like any good [...]<p>This is a post from <a href="http://webdevnews.net" title="News for Web Developers">Web Dev News</a>, a site brought to you by <a href="http://xavisys.com" title="For all your web development needs">Xavisys Web Development</a>.  <br/><br/><a href="http://webdevnews.net/2007/01/css-trick-turning-a-background-image-into-a-clickable-link/">CSS Trick: Turning a background image into a clickable link</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>While working on a design for a client&#8217;s site the other day, I had the need to make a background image a clickable link.  Their logo was being used as a background image in the site&#8217;s header, and we wanted it to act as a link to the home page &#8211; like any good website should.</p>
<p>It&#8217;s simple to turn a regular image into a clickable link, but in some situations, it&#8217;s just not possible to use a regular image &#8211; so how do you turn a background image into a clickable link?  First let&#8217;s take a look at my original markup (I&#8217;ve removed unnecessary elements for sake of simplicity):</p>
<pre class="brush: html">&lt;div id=&quot;header&quot;&gt;&lt;/div&gt;</pre>
<pre class="brush: css">#header {
  background: #fff url(images/header.png) no-repeat;
  height: 101px;
  width: 800px;
}</pre>
<p>So, how can we make our background image a clickable link? It turns out it can be done with a clever CSS trick.  All we have to do is add the link markup between our header div tags, and apply the above markup to the link instead.  All we have to add to the CSS is <em>display: block</em> to force the link to fill the entire space.</p>
<p>To handle browsers that don&#8217;t support CSS (those things are still around?), we should also add a span containing link text that we will hide with our CSS.  Here&#8217;s what we end up with:</p>
<pre class="brush: html">&lt;div id=&quot;header&quot;&gt;&lt;a href=&quot;http://mysite.com&quot;&gt;&lt;span&gt;MySite.com&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</pre>
<pre class="brush: css">#header a {
  background: #fff url(images/header.png) no-repeat;
  display: block;
  height: 101px;
  width: 800px;
}
#header a span {
  visibility: hidden;
}</pre>
<p>And there you have it &#8211; a quick CSS trick that turns your background images into clickable links.</p>
<!-- google_ad_section_end --><p>This is a post from <a href="http://webdevnews.net" title="News for Web Developers">Web Dev News</a>, a site brought to you by <a href="http://xavisys.com" title="For all your web development needs">Xavisys Web Development</a>.  <br/><br/><a href="http://webdevnews.net/2007/01/css-trick-turning-a-background-image-into-a-clickable-link/">CSS Trick: Turning a background image into a clickable link</a></p>



Share and Enjoy:


	<a rel="nofollow"  href="http://twitter.com/home?status=CSS%20Trick%3A%20Turning%20a%20background%20image%20into%20a%20clickable%20link%20-%20http%3A%2F%2Fwebdevnews.net%2F2007%2F01%2Fcss-trick-turning-a-background-image-into-a-clickable-link%2F" title="Twitter"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwebdevnews.net%2F2007%2F01%2Fcss-trick-turning-a-background-image-into-a-clickable-link%2F&amp;title=CSS%20Trick%3A%20Turning%20a%20background%20image%20into%20a%20clickable%20link&amp;notes=While%20working%20on%20a%20design%20for%20a%20client%27s%20site%20the%20other%20day%2C%20I%20had%20the%20need%20to%20make%20a%20background%20image%20a%20clickable%20link.%20%20Their%20logo%20was%20being%20used%20as%20a%20background%20image%20in%20the%20site%27s%20header%2C%20and%20we%20wanted%20it%20to%20act%20as%20a%20link%20to%20the%20home%20page%20-%20like%20" title="del.icio.us"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwebdevnews.net%2F2007%2F01%2Fcss-trick-turning-a-background-image-into-a-clickable-link%2F&amp;title=CSS%20Trick%3A%20Turning%20a%20background%20image%20into%20a%20clickable%20link" title="StumbleUpon"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwebdevnews.net%2F2007%2F01%2Fcss-trick-turning-a-background-image-into-a-clickable-link%2F&amp;title=CSS%20Trick%3A%20Turning%20a%20background%20image%20into%20a%20clickable%20link&amp;bodytext=While%20working%20on%20a%20design%20for%20a%20client%27s%20site%20the%20other%20day%2C%20I%20had%20the%20need%20to%20make%20a%20background%20image%20a%20clickable%20link.%20%20Their%20logo%20was%20being%20used%20as%20a%20background%20image%20in%20the%20site%27s%20header%2C%20and%20we%20wanted%20it%20to%20act%20as%20a%20link%20to%20the%20home%20page%20-%20like%20" title="Digg"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwebdevnews.net%2F2007%2F01%2Fcss-trick-turning-a-background-image-into-a-clickable-link%2F" title="Sphinn"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwebdevnews.net%2F2007%2F01%2Fcss-trick-turning-a-background-image-into-a-clickable-link%2F&amp;t=CSS%20Trick%3A%20Turning%20a%20background%20image%20into%20a%20clickable%20link" title="Facebook"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwebdevnews.net%2F2007%2F01%2Fcss-trick-turning-a-background-image-into-a-clickable-link%2F&amp;title=CSS%20Trick%3A%20Turning%20a%20background%20image%20into%20a%20clickable%20link&amp;annotation=While%20working%20on%20a%20design%20for%20a%20client%27s%20site%20the%20other%20day%2C%20I%20had%20the%20need%20to%20make%20a%20background%20image%20a%20clickable%20link.%20%20Their%20logo%20was%20being%20used%20as%20a%20background%20image%20in%20the%20site%27s%20header%2C%20and%20we%20wanted%20it%20to%20act%20as%20a%20link%20to%20the%20home%20page%20-%20like%20" title="Google Bookmarks"><img src="http://webdevnews.net/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://webdevnews.net/2007/01/css-trick-turning-a-background-image-into-a-clickable-link/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
	</channel>
</rss>
