<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Ryan Ternier  : web design</title><link>http://weblogs.asp.net/rternier/archive/tags/web+design/default.aspx</link><description>Tags: web design</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Full Screen web pages and browser resizing - keeping it looking good</title><link>http://weblogs.asp.net/rternier/archive/2007/11/23/full-screen-web-pages-and-browser-resizing-keeping-it-looking-good.aspx</link><pubDate>Fri, 23 Nov 2007 17:17:12 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5319687</guid><dc:creator>rternier</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/rternier/rsscomments.aspx?PostID=5319687</wfw:commentRss><comments>http://weblogs.asp.net/rternier/archive/2007/11/23/full-screen-web-pages-and-browser-resizing-keeping-it-looking-good.aspx#comments</comments><description>&lt;p&gt;I've noticed one thing that really gets some web developers going (and not the good going): Keeping a full screen web site looking good with different browser sizes. Those that know CSS inside-out will also have this problem as sometimes you just can't cut it with pure CSS.&amp;#xA0; This is why many sites us a set width - they have clear control over everything with just CSS. However, those that like to employ full screen web pages need to do a bit more. &lt;/p&gt;  &lt;p&gt;Note* this is only an issue with &amp;lt;div&amp;gt; based layouts. Table based layouts (die die die) don't have this.&amp;#xA0; &lt;/p&gt;  &lt;p&gt;Most Web Applications nowadays are full screen web apps - If they are not you should really re-think your design. I always develop my web apps for 800x600, but always allow them to work at resolutions like 1600x1050 (my resolution).&lt;/p&gt;  &lt;p&gt;I have a simple JavaScript function I use whenever I write full page web apps that have a lot of content areas that I need specifically sized.&amp;#xA0; here's a sample of my script that I am using for a program using mapping. This script runs every 250ms (4 times a second) and resizes my map width/Height and my sidebar height to take in the full height of the browser. My application never has any scrolling - except my right sidebar (overflow:auto;). This allows my application to remain clean of scrollbars and stay as large as possible for those using it.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="border-right: #cccccc 1pt solid; padding-right: 1pt; border-top: #cccccc 1pt solid; padding-left: 1pt; font-size: 11pt; background: #222215; padding-bottom: 1pt; overflow: auto; border-left: #cccccc 1pt solid; width: 86.92%; color: #dfdfbf; padding-top: 1pt; border-bottom: #cccccc 1pt solid; font-family: consolas; height: 774px"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #479445"&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: bold; color: #cccc37"&gt;var&lt;/span&gt; browserWidth = &lt;span style="color: #8acccf"&gt;0&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: bold; color: #cccc37"&gt;var&lt;/span&gt; browserHeight = &lt;span style="color: #8acccf"&gt;0&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: bold; color: #cccc37"&gt;function&lt;/span&gt; getSize() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0; &lt;span style="font-weight: bold; color: #cccc37"&gt;if&lt;/span&gt;( &lt;span style="font-weight: bold; color: #cccc37"&gt;typeof&lt;/span&gt;( window.innerWidth ) == &lt;span style="color: #c89191"&gt;'number'&lt;/span&gt; ) &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #479445"&gt;//Non-IE&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; isIE = &lt;span style="font-weight: bold; color: #cccc37"&gt;false&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; browserWidth = window.innerWidth;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; browserHeight = window.innerHeight;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0; } &lt;span style="font-weight: bold; color: #cccc37"&gt;else&lt;/span&gt; &lt;span style="font-weight: bold; color: #cccc37"&gt;if&lt;/span&gt;( document.documentElement &amp;amp;&amp;amp; ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #479445"&gt;//IE 6+ in 'standards compliant mode'&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; browserWidth = document.documentElement.clientWidth;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; browserHeight = document.documentElement.clientHeight;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0; } &lt;span style="font-weight: bold; color: #cccc37"&gt;else&lt;/span&gt; &lt;span style="font-weight: bold; color: #cccc37"&gt;if&lt;/span&gt;( document.body &amp;amp;&amp;amp; ( document.body.clientWidth || document.body.clientHeight ) ) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; alert(&lt;span style="color: #c89191"&gt;&amp;quot;You are using an outdated browser. Please upgrade to IE7 or FireFox 2.0&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #479445"&gt;//IE 4 compatible&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; browserWidth = document.body.clientWidth;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; browserHeight = document.body.clientHeight;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="font-weight: bold; color: #cccc37"&gt;function&lt;/span&gt; updateMapSize()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #479445"&gt;//IE7 is 21 pixels LESS than FireFox.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #479445"&gt;//Pretty much we want to keep the map to the maximum size alloted.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; getSize();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #479445"&gt;//Side bar is 200px, but we should take some px off of it for padding.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #479445"&gt;//header is 80px hight. take some px off for padding.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="font-weight: bold; color: #cccc37"&gt;var&lt;/span&gt; mapWidth;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="font-weight: bold; color: #cccc37"&gt;if&lt;/span&gt;(document.getElementById(&lt;span style="color: #c89191"&gt;&amp;quot;aToggleSideBar&amp;quot;&lt;/span&gt;).className == &lt;span style="color: #c89191"&gt;&amp;quot;collapse&amp;quot;&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; mapWidth = browserWidth - &lt;span style="color: #8acccf"&gt;290&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="font-weight: bold; color: #cccc37"&gt;else&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; mapWidth = browserWidth - &lt;span style="color: #8acccf"&gt;50&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="font-weight: bold; color: #cccc37"&gt;var&lt;/span&gt; mapHeight = browserHeight - &lt;span style="color: #8acccf"&gt;60&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="font-weight: bold; color: #cccc37"&gt;var&lt;/span&gt; sideBarHeight = browserHeight - &lt;span style="color: #8acccf"&gt;60&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; document.getElementById(&lt;span style="color: #c89191"&gt;&amp;quot;map&amp;quot;&lt;/span&gt;).style.width = mapWidth + &lt;span style="color: #c89191"&gt;&amp;quot;px&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; document.getElementById(&lt;span style="color: #c89191"&gt;&amp;quot;leftSide&amp;quot;&lt;/span&gt;).style.width = mapWidth + &lt;span style="color: #c89191"&gt;&amp;quot;px&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; document.getElementById(&lt;span style="color: #c89191"&gt;&amp;quot;map&amp;quot;&lt;/span&gt;).style.height = mapHeight + &lt;span style="color: #c89191"&gt;&amp;quot;px&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; document.getElementById(&lt;span style="color: #c89191"&gt;&amp;quot;rightSide&amp;quot;&lt;/span&gt;).style.height = sideBarHeight + &lt;span style="color: #c89191"&gt;&amp;quot;px&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; document.getElementById(&lt;span style="color: #c89191"&gt;&amp;quot;sideBar&amp;quot;&lt;/span&gt;).style.height = (sideBarHeight - &lt;span style="color: #8acccf"&gt;50&lt;/span&gt;)+ &lt;span style="color: #c89191"&gt;&amp;quot;px&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; setTimeout(&lt;span style="color: #c89191"&gt;&amp;quot;updateMapSize()&amp;quot;&lt;/span&gt;, &lt;span style="color: #8acccf"&gt;250&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5319687" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/rternier/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://weblogs.asp.net/rternier/archive/tags/web+design/default.aspx">web design</category></item><item><title>Two ASP.NET features that are usually missed or misunderstood...T</title><link>http://weblogs.asp.net/rternier/archive/2007/10/30/two-asp-net-features-that-are-usually-missed-or-misunderstood.aspx</link><pubDate>Tue, 30 Oct 2007 15:47:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:4838357</guid><dc:creator>rternier</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/rternier/rsscomments.aspx?PostID=4838357</wfw:commentRss><comments>http://weblogs.asp.net/rternier/archive/2007/10/30/two-asp-net-features-that-are-usually-missed-or-misunderstood.aspx#comments</comments><description>&lt;p&gt;&lt;b&gt;Enter the Tilde (~)&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Browsing the asp.net forums I notice a lot of people putting the '~' (tilde) character on every control that has some sort src or href.&amp;nbsp; Many think that the tilde character is a regular character that deals with file locations. Much like: /, ../, ../../ etc.&lt;/p&gt;  &lt;p&gt;However, this little angle is actually an ASP.NET character that is a shortcut for"&amp;nbsp;&amp;nbsp; HttpRuntime.AppDomainAppVirtualPath. (say that 10x in a row). This property refers to the virtual application root - not the root of the web server.&amp;nbsp; Remember that a Virtual Directory is in fact an Application (Server 2000 / XP). You'll notice that in Vista that the IIS team has gone the better rout and actually calls them "Applications" while still having the ability to have a virtual directory that functions as a directory.&lt;/p&gt;  &lt;p&gt;So how do we use this character?&lt;/p&gt;  &lt;p&gt;here are some examples.&lt;/p&gt;  &lt;p&gt;If my Folder structure is as follow:    &lt;br&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Website      &lt;ul&gt;       &lt;li&gt;Images &lt;/li&gt;        &lt;li&gt;CSS &lt;/li&gt;        &lt;li&gt;Admin &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I have a master page within my main website, and content pages in my Admin. One thing newer web developers will do is declare an image like:&lt;/p&gt;  &lt;p&gt;&lt;font face="courie"&gt;&amp;lt;img src="Images/MyImage.png" alt="my Image" /&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;That works for everything in the root directory, however once you get into the Admin directory - all images are broken.&amp;nbsp; A way to resolve this is:&lt;/p&gt;  &lt;p&gt;&amp;lt;img src="http://weblogs.asp.net/Images/MyImage.png" alt="my Image" /&amp;gt;&lt;/p&gt;  &lt;p&gt;This can also lead into issues if you have a more complex structure. A quick way to resolve this is:&lt;/p&gt;  &lt;p&gt;&amp;lt;asp:image id="myImage" runat="server" ImageUrl="~/Images/MyImage.png" AlternateText="My Image" /&amp;gt;&lt;/p&gt;  &lt;p&gt;This will always go to the root of your application and then to the Images directory.&amp;nbsp; This is very useful with Hyperlinks when you are working with multiple directories.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Enter the ALT-SHIFT (Really... ALT-SHIFT)&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;I've heard about this but I've always just stored this away in the back of my mind. This little button combo allows you to select VERTICALLY in Visual Studio. &lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/twoASP.NETfeaturesthatareusuallymissedo_7B37/Capture.png" mce_href="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/twoASP.NETfeaturesthatareusuallymissedo_7B37/Capture.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/twoASP.NETfeaturesthatareusuallymissedo_7B37/Capture_thumb.png" id="id" style="border-width: 0px;" alt="Capture" mce_src="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/twoASP.NETfeaturesthatareusuallymissedo_7B37/Capture_thumb.png" border="0" height="181" width="610"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;So, besides the nice little vertical line, what are the uses of this?&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Easy way to remove a single line of characters (say Line numbers from an online post) without having to format a bunch of things &lt;/li&gt;    &lt;li&gt;Easy way to remove comments if you commented out lines (You can use the shortcuts: CTRL E+C to commend and CTRL E+U to uncommented) &lt;/li&gt;    &lt;li&gt;Quickly change values or remove values in XML. &lt;/li&gt;    &lt;li&gt;Many many more. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Needless to say it's a beautiful tool that exists in Visual Studio (not just ASP.NET).&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4838357" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/rternier/archive/tags/ASP.NET+/default.aspx">ASP.NET </category><category domain="http://weblogs.asp.net/rternier/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/rternier/archive/tags/web+design/default.aspx">web design</category></item><item><title>Fancy Button 2.0 (Not A Link button)</title><link>http://weblogs.asp.net/rternier/archive/2007/10/26/fancy-button-2-0-not-a-link-button.aspx</link><pubDate>Fri, 26 Oct 2007 22:18:25 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:4769894</guid><dc:creator>rternier</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/rternier/rsscomments.aspx?PostID=4769894</wfw:commentRss><comments>http://weblogs.asp.net/rternier/archive/2007/10/26/fancy-button-2-0-not-a-link-button.aspx#comments</comments><description>&lt;p&gt;I got a shwack of feedback and comments from my recent post: &lt;a href="http://weblogs.asp.net/rternier/archive/2007/10/25/get-rid-of-regular-buttons-use-link-buttons.aspx" target="_blank"&gt;Get rid of regular buttons, use Link Buttons&lt;/a&gt;.&amp;#xA0; I actually thought my solution was a great one, apparently I was a bit off base. That's not to say that my solution was totally wrong - Yes I'm stubborn... but I do admit that I am &amp;quot;occasionally&amp;quot; wrong... occasionally...&lt;/p&gt;  &lt;p&gt;From the feedback, I decided to make a new &amp;quot;better looking&amp;quot; button. This one is about the same amount of work as the previous, but I believe this one is up to standards - which was the biggest subject from the feedback.&lt;/p&gt;  &lt;p&gt;Another comment I got was regarding users might be confused because it was a link, and not a button. If they look the same, the user will never be able to tell. (I have yet to see a user that looks at the markup of a web application and gets their underwear in a knot because something that is supposed to be an &amp;lt;input /&amp;gt; is an &amp;lt;a /&amp;gt;... though I'd really like to see it&amp;#xA0; :P ).&lt;/p&gt;  &lt;p&gt;So let's look at the markup of this new thing:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="border-right: #cccccc 1pt solid; padding-right: 1pt; border-top: #cccccc 1pt solid; padding-left: 1pt; font-size: 11pt; background: #222215; padding-bottom: 1pt; overflow: auto; border-left: #cccccc 1pt solid; width: 97.58%; color: #dfdfbf; padding-top: 1pt; border-bottom: #cccccc 1pt solid; font-family: consolas; height: 64px"&gt;   &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &amp;lt;&lt;span style="color: #e1795f"&gt;button&lt;/span&gt; &lt;span style="color: #cccc37"&gt;id&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;btnTest&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;runat&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;Server&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;type&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;button&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;class&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;nButton&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;onserverclick&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;btnTest_ServerClick&amp;quot;&lt;/span&gt;&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &amp;lt;&lt;span style="color: #e1795f"&gt;div&lt;/span&gt; &lt;span style="color: #cccc37"&gt;class&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;login&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span style="color: #e1795f"&gt;div&lt;/span&gt;&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &amp;lt;&lt;span style="color: #e1795f"&gt;div&lt;/span&gt;&amp;gt;This is my button&amp;lt;/&lt;span style="color: #e1795f"&gt;div&lt;/span&gt;&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &amp;lt;/&lt;span style="color: #e1795f"&gt;button&lt;/span&gt;&amp;gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;I have changed this to use the &amp;lt;button&amp;gt; element. The &amp;lt;button&amp;gt; element allows you to further style what the button looks like. &lt;/p&gt;  &lt;p&gt;I used &amp;lt;div&amp;gt; elements so I can control the vertical alignment of the text - as well as further styling if needed.&lt;/p&gt;  &lt;p&gt;Here's my CSS:&lt;/p&gt;  &lt;div style="border-right: #cccccc 1pt solid; padding-right: 1pt; border-top: #cccccc 1pt solid; padding-left: 1pt; font-size: 11pt; background: #222215; padding-bottom: 1pt; overflow: auto; border-left: #cccccc 1pt solid; width: 97.62%; color: #dfdfbf; padding-top: 1pt; border-bottom: #cccccc 1pt solid; font-family: consolas; height: 439px"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.nButton&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-color&lt;/span&gt;:#84A1D6;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;border&lt;/span&gt;:solid 2px #415D9B;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;min-width&lt;/span&gt;:70px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;height&lt;/span&gt;:23px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;padding-left&lt;/span&gt;:3px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;vertical-align&lt;/span&gt;:middle;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.nButton:hover&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-color&lt;/span&gt;: #a0bdf2;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.nButton&lt;/span&gt; &lt;span style="color: #e17962"&gt;div&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;float&lt;/span&gt;:left;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.nButton&lt;/span&gt; &lt;span style="color: #e17962"&gt;.login&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;vertical-align&lt;/span&gt;:middle;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-image&lt;/span&gt;:url(Images/save.png);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-repeat&lt;/span&gt;:no-repeat;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-position&lt;/span&gt;:left top;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;width&lt;/span&gt;:16px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;height&lt;/span&gt;:16px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Very similar to my last post.&amp;#xA0; This functions the same, and it has the same functionality as a regular &amp;lt;asp:button /&amp;gt;.&lt;/p&gt;  &lt;p&gt;Now let's see what it looks like: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/FancyButton2.0NotALinkbutton_D6EF/new%20button.png"&gt;&lt;img id="id" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="34" alt="new button" src="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/FancyButton2.0NotALinkbutton_D6EF/new%20button_thumb.png" width="145" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;That made my day... or did it....&amp;#xA0;&amp;#xA0;&amp;#xA0; Here is what I get when I surround ALL my markup with a &amp;lt;button&amp;gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/FancyButton2.0NotALinkbutton_D6EF/big%20button.png"&gt;&lt;img id="id" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="217" alt="big button" src="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/FancyButton2.0NotALinkbutton_D6EF/big%20button_thumb.png" width="506" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now I wonder how many that read this are going to go to their websites and try it out....&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4769894" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/rternier/archive/tags/XHTML/default.aspx">XHTML</category><category domain="http://weblogs.asp.net/rternier/archive/tags/CSS/default.aspx">CSS</category><category domain="http://weblogs.asp.net/rternier/archive/tags/HTML/default.aspx">HTML</category><category domain="http://weblogs.asp.net/rternier/archive/tags/web+design/default.aspx">web design</category></item><item><title>Get rid of regular buttons, use link buttons</title><link>http://weblogs.asp.net/rternier/archive/2007/10/25/get-rid-of-regular-buttons-use-link-buttons.aspx</link><pubDate>Thu, 25 Oct 2007 23:21:22 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:4754236</guid><dc:creator>rternier</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/rternier/rsscomments.aspx?PostID=4754236</wfw:commentRss><comments>http://weblogs.asp.net/rternier/archive/2007/10/25/get-rid-of-regular-buttons-use-link-buttons.aspx#comments</comments><description>&lt;p&gt;For the past 3 years I have been pushing my managers and especially the teams I work with that the web applications we make need to be visually appealing. The graphics designers I know can do amazing things. My friend &lt;a href="http://www.boxdrinks.com/" target="_blank"&gt;Steve Sereda&lt;/a&gt; is an amazing graphics designer and he created some awesome skins for me for the time we worked together. &lt;/p&gt;  &lt;p&gt;I've done a few posts leading up to this one. It all started with my post on &lt;a href="http://weblogs.asp.net/rternier/archive/2007/10/17/updatepanel-firefox-and-the-defaultbutton.aspx" target="_blank"&gt;UpdatePanel, FireFox and the Default Button&lt;/a&gt;, where I talked about how to get the default button working in FireFox. At this point I was in the process of moving all buttons over to fancy LinkButtons. I then wrote about &lt;a href="http://weblogs.asp.net/rternier/archive/2007/10/18/a-table-some-text-and-css-pseudo-classes.aspx" target="_blank"&gt;CSS Pseudo Classes&lt;/a&gt; and their uses (which are many), and finally I finished my last post on &lt;a href="http://weblogs.asp.net/rternier/archive/2007/10/25/a-linkbutton-defaultbutton-updatepanel-and-firefox.aspx" target="_blank"&gt;A LinkButton, DefaultButton, UpdatePanel and FireFox&lt;/a&gt;, where I discuss how to get FireFox to use a LinkButton (Anchor tag) as a default button.&lt;/p&gt;  &lt;p&gt;So let's talk about Buttons. Buttons provide functionality, and 99% of users know when they click on a button that some sort of action is going to happen. Many buttons look like this:&amp;#xA0; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/Getridofregularbuttonsuselinkbuttons_E458/button.png"&gt;&lt;img height="27" alt="button" src="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/Getridofregularbuttonsuselinkbuttons_E458/button_thumb.png" width="190" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now, besides the ugly border my snipping tool puts in, that button isn't that great. But should that matter? Isn't a button there to tell the user that clicking it will invoke some sort of procedure? Correct. By general standards Buttons should invoke functions, while links should be directional. However, who said a button had to be grey and ugly?&lt;/p&gt;  &lt;p&gt;ASP.NET has the LinkButton. It gets rendered as an &amp;lt;a /&amp;gt; (anchor) tag, and because of that we can do something like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/Getridofregularbuttonsuselinkbuttons_E458/3%20buttons_2.png"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="36" alt="3 buttons" src="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/Getridofregularbuttonsuselinkbuttons_E458/3%20buttons_thumb.png" width="337" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Wow, that looks way better than regular buttons. What about this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/Getridofregularbuttonsuselinkbuttons_E458/delete.png"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="134" alt="delete" src="http://weblogs.asp.net/blogs/rternier/WindowsLiveWriter/Getridofregularbuttonsuselinkbuttons_E458/delete_thumb.png" width="312" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I've grown tired of using JavaScript confirm boxes. I've decided to switch to modal windows. (yes yes I know my spacing isn't right....). You can see the nice presentation, and notice the spacing... isn't that amazing?!&lt;/p&gt;  &lt;p&gt;There's a trick to these buttons, and unfortunately you do have to put more work into them. I could make a button like this a userControl/CompositeControl, but for what I need them for, that's too much work.&lt;/p&gt;  &lt;p&gt;Let's look at the markup I use for these buttons. This will give you more clarity when you see the CSS.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="border-right: #cccccc 1pt solid; padding-right: 1pt; border-top: #cccccc 1pt solid; padding-left: 1pt; font-size: 11pt; background: #222215; padding-bottom: 1pt; overflow: auto; border-left: #cccccc 1pt solid; width: 99.58%; color: #dfdfbf; padding-top: 1pt; border-bottom: #cccccc 1pt solid; font-family: consolas; height: 178px"&gt;   &lt;p style="margin: 0px"&gt;&amp;lt;&lt;span style="color: #e1795f"&gt;div&lt;/span&gt; &lt;span style="color: #cccc37"&gt;class&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;button&amp;quot;&lt;/span&gt;&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0; &amp;lt;&lt;span style="color: #e1795f"&gt;asp&lt;/span&gt;:&lt;span style="color: #e1795f"&gt;LinkButton&lt;/span&gt; &lt;span style="color: #cccc37"&gt;ID&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;btnSave&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;runat&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;Server&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;CssClass&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;bSave&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;Text&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;Save User&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;OnClick&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;btnSave_Click&amp;quot;&lt;/span&gt;&amp;#xA0; &lt;span style="color: #cccc37"&gt;ValidationGroup&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;userDetails&amp;quot;&lt;/span&gt;&amp;#xA0; &lt;span style="color: #cccc37"&gt;UseSubmitBehavior&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;false&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;lt;/&lt;span style="color: #e1795f"&gt;div&lt;/span&gt;&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;lt;&lt;span style="color: #e1795f"&gt;div&lt;/span&gt; &lt;span style="color: #cccc37"&gt;class&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;button&amp;quot;&lt;/span&gt;&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &amp;lt;&lt;span style="color: #e1795f"&gt;asp&lt;/span&gt;:&lt;span style="color: #e1795f"&gt;LinkButton&lt;/span&gt; &lt;span style="color: #cccc37"&gt;ID&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;btnCancel&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;runat&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;Server&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;CssClass&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;bCancel&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;Text&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;Cancel&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;OnClick&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;btnCancel_Click&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;CausesValidation&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;False&amp;quot;&lt;/span&gt;&amp;#xA0;&amp;#xA0; &lt;span style="color: #cccc37"&gt;UseSubmitBehavior&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;false&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;lt;/&lt;span style="color: #e1795f"&gt;div&lt;/span&gt;&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;lt;&lt;span style="color: #e1795f"&gt;div&lt;/span&gt; &lt;span style="color: #cccc37"&gt;class&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;button&amp;quot;&lt;/span&gt;&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &amp;lt;&lt;span style="color: #e1795f"&gt;asp&lt;/span&gt;:&lt;span style="color: #e1795f"&gt;LinkButton&lt;/span&gt; &lt;span style="color: #cccc37"&gt;ID&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;btnDeleteUser&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;runat&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;Server&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;CssClass&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;bDelete&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;Text&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;Delete&amp;quot;&lt;/span&gt; &lt;span style="color: #cccc37"&gt;UseSubmitBehavior&lt;/span&gt;=&lt;span style="color: #c89191"&gt;&amp;quot;false&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;lt;/&lt;span style="color: #e1795f"&gt;div&lt;/span&gt;&amp;gt;      &lt;br /&gt;&amp;lt;&lt;span style="color: #e1795f"&gt;div &lt;/span&gt;&lt;span style="color: #cccc37"&gt;class&lt;/span&gt;=&amp;quot;clear&amp;quot;&amp;gt;&amp;lt;/&lt;span style="color: #e1795f"&gt;div&lt;/span&gt;&amp;gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;You see that I have 3 div's, and in each div I have a LinkButton. Under the LinkButtons I have a single div with the &amp;quot;clear&amp;quot; class. My clear class does clear:both;. It clears the floats that all of these div's have. &lt;/p&gt;  &lt;p&gt;Here's the CSS&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="border-right: #cccccc 1pt solid; padding-right: 1pt; border-top: #cccccc 1pt solid; padding-left: 1pt; font-size: 11pt; background: #222215; padding-bottom: 1pt; overflow: auto; border-left: #cccccc 1pt solid; width: 99%; color: #dfdfbf; padding-top: 1pt; border-bottom: #cccccc 1pt solid; font-family: consolas; height: 769px"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.button&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-color&lt;/span&gt;:#84A1D6;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;border&lt;/span&gt;:solid 2px #415D9B;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;margin&lt;/span&gt;:5px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;min-width&lt;/span&gt;:70px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;height&lt;/span&gt;:20px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;float&lt;/span&gt;:left;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;padding-left&lt;/span&gt;:3px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.button&lt;/span&gt; &lt;span style="color: #e17962"&gt;a&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;display&lt;/span&gt;:block;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;padding&lt;/span&gt;:2px 5px 2px 20px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;min-width&lt;/span&gt;:70px;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.button:hover&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-color&lt;/span&gt;: #a0bdf2;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.button&lt;/span&gt; &lt;span style="color: #e17962"&gt;a:active&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;border-top&lt;/span&gt;:solid 1px black;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;/* Button Style */&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.button&lt;/span&gt; &lt;span style="color: #e17962"&gt;a.bLogin&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-image&lt;/span&gt;: url(Images/Login.png);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-position&lt;/span&gt;:left;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-repeat&lt;/span&gt;:no-repeat;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.button&lt;/span&gt; &lt;span style="color: #e17962"&gt;a.bSave&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-image&lt;/span&gt;: url(Images/Save.png);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-position&lt;/span&gt;:left;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-repeat&lt;/span&gt;:no-repeat;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #e17962"&gt;.button&lt;/span&gt; &lt;span style="color: #e17962"&gt;a.bCancel&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-image&lt;/span&gt;: url(Images/Cancel.png);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-position&lt;/span&gt;:left;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #f0dfaf"&gt;background-repeat&lt;/span&gt;:no-repeat;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;You can notice that each .button class is floating left. I need to use Block elements for these buttons so I can apply padding, margin's etc. You cannot do that to an inline element. Seeing they're block, I want them line up, so I float them.&amp;#xA0; You can also see that my &lt;strong&gt;&lt;u&gt;.button a&lt;/u&gt;&lt;/strong&gt; contains the same width as the parent .&lt;strong&gt;&lt;u&gt;button&lt;/u&gt;&lt;/strong&gt;, this is because I want the entire button to be clickable, not just the link portion.&lt;/p&gt;  &lt;p&gt;I am also using pseudo classes for this. You can see the :hover and the :active. This gives my buttons &amp;quot;hover&amp;quot; and &amp;quot;click&amp;quot; styles without having to code any javascript. (IE7 and FF).&lt;/p&gt;  &lt;p&gt;And that is all you need to do.&lt;/p&gt;  &lt;p&gt;Like I said, it's a tiny bit more markup and some small CSS, however, the outcome of this work is well worth it. It gives a whole new presentation to your application.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4754236" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/rternier/archive/tags/ASP.NET+/default.aspx">ASP.NET </category><category domain="http://weblogs.asp.net/rternier/archive/tags/CSS/default.aspx">CSS</category><category domain="http://weblogs.asp.net/rternier/archive/tags/HTML/default.aspx">HTML</category><category domain="http://weblogs.asp.net/rternier/archive/tags/Firefox/default.aspx">Firefox</category><category domain="http://weblogs.asp.net/rternier/archive/tags/web+design/default.aspx">web design</category></item><item><title>A Table, some text and CSS Pseudo Classes</title><link>http://weblogs.asp.net/rternier/archive/2007/10/18/a-table-some-text-and-css-pseudo-classes.aspx</link><pubDate>Thu, 18 Oct 2007 17:17:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:4624166</guid><dc:creator>rternier</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/rternier/rsscomments.aspx?PostID=4624166</wfw:commentRss><comments>http://weblogs.asp.net/rternier/archive/2007/10/18/a-table-some-text-and-css-pseudo-classes.aspx#comments</comments><description>To See this in a &lt;span style="font-weight: bold;"&gt;working&lt;/span&gt; example, please check out my projects at :&lt;a href="http://projects.bicnet.org/CSS/Pseudo%20Classes/TableCssPseudo.htm" mce_href="http://projects.bicnet.org/CSS/Pseudo%20Classes/TableCssPseudo.htm"&gt; bicnet Projects.&lt;/a&gt;&lt;p&gt;I really want to thank the IE7 team for building in more Support for CSS. It allows us web developers to do some pretty cool things with CSS without the use of javaScript. Unfortunately not all the goodies work with IE7 (:after :before) but a lot do.&lt;br&gt;&lt;br&gt;&lt;br&gt;This post is a quick glance at using CSS Pseudo Classes with Tables. In this example I will use a regular HTML table, however this will work with any ASP.NET control that outputs an html &amp;lt;table&amp;gt;.&lt;br&gt;&lt;br&gt;First, if you have no idea what a Pseudo class is please look at &lt;a href="http://www.w3schools.com/css/css_pseudo_classes.asp" mce_href="http://www.w3schools.com/css/css_pseudo_classes.asp"&gt;this page by W3Schools&lt;/a&gt;.&lt;br&gt;&lt;br&gt;Let's start with some CSS:&lt;br&gt;
&lt;/p&gt;&lt;div style="border: 1pt solid rgb(204, 204, 204); padding: 1pt; background: rgb(34, 34, 21) none repeat scroll 0% 50%; overflow: auto; font-family: Consolas; font-size: 11pt; color: rgb(223, 223, 191); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 100%; height: 300px;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;width&lt;/span&gt;:460px;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;td&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;width&lt;/span&gt;:150px;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;td:hover&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;background-color&lt;/span&gt;:Black;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;color&lt;/span&gt;:Yellow;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;tr:hover&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;border&lt;/span&gt;: solid 1px green;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;background-color&lt;/span&gt;:Yellow;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;color&lt;/span&gt;:Maroon;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;thead&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;tr:hover&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;background-color&lt;/span&gt;:ThreeDShadow;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;color&lt;/span&gt;:White;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;td&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;span:hover:after&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;content&lt;/span&gt;: &lt;span style="color: rgb(200, 145, 145);"&gt;"\00BB"&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;td&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;span:hover:before&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;content&lt;/span&gt;:&lt;span style="color: rgb(200, 145, 145);"&gt;"\00AB"&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;.row1&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;border&lt;/span&gt;:solid 1px white;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;.row1:hover&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;background-color&lt;/span&gt;:Aqua;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;color&lt;/span&gt;:Navy;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#Mytable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;.column1:hover&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;background-color&lt;/span&gt;: #1b1b1b;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;color&lt;/span&gt;: Yellow;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;.column2:hover&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;background-color&lt;/span&gt;: #545454;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;color&lt;/span&gt;: Yellow;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;.column3:hover&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;background-color&lt;/span&gt;: #8c8c8c;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;color&lt;/span&gt;: Yellow;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;.row1&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;td:hover:before&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;content&lt;/span&gt;:open-quote;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(225, 121, 98);"&gt;#MyTable&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;.row1&lt;/span&gt; &lt;span style="color: rgb(225, 121, 98);"&gt;td:hover:after&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(240, 223, 175);"&gt;content&lt;/span&gt;:close-quote;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;

&lt;br&gt;&lt;br&gt;You'll notice that the #MyTable is the only declared item that I'm using. This is because CSS can traverse my DOM and apply it's styles to the children based on how I declare it.&lt;br&gt;&lt;br&gt;Let's look at my HTML Markup:&lt;br&gt;&lt;br&gt;
&lt;div style="border: 1pt solid rgb(204, 204, 204); padding: 1pt; background: rgb(34, 34, 21) none repeat scroll 0% 50%; overflow: auto; font-family: Consolas; font-size: 11pt; color: rgb(223, 223, 191); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 100%; height: 300px;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;table&lt;/span&gt; &lt;span style="color: rgb(204, 204, 55);"&gt;id&lt;/span&gt;=&lt;span style="color: rgb(200, 145, 145);"&gt;"MyTable"&lt;/span&gt; &lt;span style="color: rgb(204, 204, 55);"&gt;cellpadding&lt;/span&gt;=&lt;span style="color: rgb(200, 145, 145);"&gt;"0"&lt;/span&gt; &lt;span style="color: rgb(204, 204, 55);"&gt;cellspacing&lt;/span&gt;=&lt;span style="color: rgb(200, 145, 145);"&gt;"0"&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;thead&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 1&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 2&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 3&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;thead&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 1 Row 1&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 2 Row 1&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 3 Row 1&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 1 Row 2&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 2 Row 2&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 3 Row 2&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 1 Row 3&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 2 Row 3&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 3 Row 3&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 1 Row 4&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 2 Row 4&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;Column 3 Row 4&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt; &lt;span style="color: rgb(204, 204, 55);"&gt;class&lt;/span&gt;=&lt;span style="color: rgb(200, 145, 145);"&gt;"row1"&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt; &lt;span style="color: rgb(204, 204, 55);"&gt;class&lt;/span&gt;=&lt;span style="color: rgb(200, 145, 145);"&gt;"column1"&lt;/span&gt;&amp;gt;Column 1 Row 4&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt; &lt;span style="color: rgb(204, 204, 55);"&gt;class&lt;/span&gt;=&lt;span style="color: rgb(200, 145, 145);"&gt;"column2"&lt;/span&gt;&amp;gt;Column 2 Row 4&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt; &lt;span style="color: rgb(204, 204, 55);"&gt;class&lt;/span&gt;=&lt;span style="color: rgb(200, 145, 145);"&gt;"column3"&lt;/span&gt;&amp;gt;Column 3 Row 4&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;span&lt;/span&gt;&amp;gt;Text in Span&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;span&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;span&lt;/span&gt;&amp;gt;Text in Span&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;span&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&amp;lt;&lt;span style="color: rgb(225, 121, 95);"&gt;span&lt;/span&gt;&amp;gt;Text in Span&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;span&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;td&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;tr&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;lt;/&lt;span style="color: rgb(225, 121, 95);"&gt;table&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;

&lt;br&gt;This is a very simple Table. The last row contains text in "span" tags, and the 2nd to last row has class names on the &amp;lt;td&amp;gt; and &amp;lt;tr&amp;gt; elements. Also notice I do not declare those classes in CSS, I don't need to.&lt;br&gt;&lt;br&gt;To See this in a &lt;span style="font-weight: bold;"&gt;working &lt;/span&gt;environment please check out my projects at :&lt;a href="http://projects.bicnet.org/CSS/Pseudo%20Classes/TableCssPseudo.htm" mce_href="http://projects.bicnet.org/CSS/Pseudo%20Classes/TableCssPseudo.htm"&gt; bicnet Projects.&lt;/a&gt;&lt;br&gt;(*Note I don't have time right now to fix a few issues in my projects section. I'll be updating it and fixing a few issues later this week... if my baby isn't born &amp;nbsp;)&lt;/p&gt;&lt;p&gt;&lt;br&gt;Like I said, this is a quick example that shows some cool things you can do with CSS. Sometimes you don't need to purchase those kick ass controls from Telerik, all you need to do is put your head down, look at some cool &lt;a href="http://www.csszengarden.com" mce_href="http://www.csszengarden.com"&gt;examples of sites&lt;/a&gt; and &lt;a href="http://icant.co.uk/csstablegallery/" mce_href="http://icant.co.uk/csstablegallery/"&gt;tables &lt;/a&gt;and then pilfer what you need.&lt;/p&gt;&lt;p&gt;&lt;br&gt;Here's a list for those that wish to learn more about Design and CSS (because I am no expert at design):&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.dezwozhere.com/links.html" target="_blank" mce_href="http://www.dezwozhere.com/links.html"&gt;Holy CSS Zeldman&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cssplay.co.uk/index" target="_blank" mce_href="http://www.cssplay.co.uk/index"&gt;CSS Play&lt;/a&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.csszengarden.com" target="_blank" mce_href="http://www.csszengarden.com"&gt;CSS Zen Garden&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://icant.co.uk/csstablegallery/" target="_blank" mce_href="http://icant.co.uk/csstablegallery/"&gt;CSS Table Gallery&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4624166" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/rternier/archive/tags/CSS/default.aspx">CSS</category><category domain="http://weblogs.asp.net/rternier/archive/tags/HTML/default.aspx">HTML</category><category domain="http://weblogs.asp.net/rternier/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/rternier/archive/tags/web+design/default.aspx">web design</category><category domain="http://weblogs.asp.net/rternier/archive/tags/Tables/default.aspx">Tables</category></item></channel></rss>