<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Rich Reuter - webdesign</title>
    <link>http://www.richreuter.com/</link>
    <description>Music and Code from the Gem City</description>
    <language>en-us</language>
    <copyright>Rich Reuter</copyright>
    <lastBuildDate>Thu, 09 Oct 2008 23:15:19 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>rich@richreuter.com</managingEditor>
    <webMaster>rich@richreuter.com</webMaster>
    <item>
      <trackback:ping>http://www.richreuter.com/Trackback.aspx?guid=7a8c9161-78f0-4aab-a5cd-80f44a14fe81</trackback:ping>
      <pingback:server>http://www.richreuter.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.richreuter.com/PermaLink,guid,7a8c9161-78f0-4aab-a5cd-80f44a14fe81.aspx</pingback:target>
      <dc:creator>Rich Reuter</dc:creator>
      <wfw:comment>http://www.richreuter.com/CommentView,guid,7a8c9161-78f0-4aab-a5cd-80f44a14fe81.aspx</wfw:comment>
      <wfw:commentRss>http://www.richreuter.com/SyndicationService.asmx/GetEntryCommentsRss?guid=7a8c9161-78f0-4aab-a5cd-80f44a14fe81</wfw:commentRss>
      <title>Good Web Design Practices for ASP.NET Developers</title>
      <guid isPermaLink="false">http://www.richreuter.com/PermaLink,guid,7a8c9161-78f0-4aab-a5cd-80f44a14fe81.aspx</guid>
      <link>http://www.richreuter.com/2008/10/09/GoodWebDesignPracticesForASPNETDevelopers.aspx</link>
      <pubDate>Thu, 09 Oct 2008 23:15:19 GMT</pubDate>
      <description>&lt;p&gt;
This is something that's been floating around in my head for a while, so I thought
I'd write about it. Too often, I've seen a lot of good programmers indulging in really
bad web design practices. In this context, I'm mostly talking about how the HTML,
CSS, and JavaScript are structured and implemented. Not so much designing the look
and feel, but how that look and feel are implemented.
&lt;/p&gt;
&lt;p&gt;
I find that it's particularly bad in the realm of ASP.NET developers (a group of which
I am a member), and part of the blame lies with Microsoft. They tried to make web
development just like Windows application development and provide the same control-based
drag and drop UI experience. It doesn't work generally too well, but that doesn't
stop some developers I've seen from crying foul when they can't use the designer.
I certainly understand why - it's easy to use and generally works ok. But what the
controls generally output isn't optimal HTML. The designer generally output isn't
very clean or valid HTML. Good, cross-browser compatible CSS and HTML generally requires
manual intervention.
&lt;/p&gt;
&lt;p&gt;
So here's a few things that I that I find useful to keep in mind when working on HTML
and CSS.
&lt;/p&gt;
&lt;h4&gt;Don't open the designer
&lt;/h4&gt;
&lt;p&gt;
I know that designers are easy to use. I know that if you are doing Win Forms/WPF,
it's the way to go. But it's different for the web. Different browsers render out
different things and Microsoft has always been primarily concerned only with making
sure it works in IE. So it may look fine in Internet Explorer, but there's a distinct
possibility it's not going to look right in another browser. Plus, the markup that
the Web Controls often emit is less than ideal.
&lt;/p&gt;
&lt;h4&gt;Structure for meaning (don't use tables for layout)
&lt;/h4&gt;
&lt;p&gt;
There's been a &lt;a href='http://www.google.com/search?hl=en&amp;rlz=1C1GGLS_enUS291&amp;q=css+don't+use+tables+for+layouts&amp;btnG=Search'&gt;ton
of stuff written about not using tables for layouts&lt;/a&gt; (and a lot of disagreements
on it), so I won't go into it too much. But - for me - at the heart of the argument
is this - your HTML should reflect what it is. If it's a logical section of content,
use a div. If it's a title, use a header tag. If it's a paragraph, use paragraph tags.
And if it's tabular data, you know what to do...
&lt;/p&gt;
&lt;p&gt;
When it comes to uniquely identifying your elements, use IDs and classes that mean
something, that describe the elements that are being styled. It makes it more difficult
to track down an issue when you look at a CSS file and see an ID like '#p43234_131',
rather than 'header'. Some editors are especially bad about that - I'm looking at
you Dreamweaver.
&lt;/p&gt;
&lt;p&gt;
It's important for a few reasons. First, it's a lot easier to maintain when you can
quickly identify your elements. Also, it makes it easier to parse. Granted, that's
not something that's always done on a regular basis, but you'll be glad if you ever
have to screen scrape your own HTML.
&lt;/p&gt;
&lt;h4&gt;Don't repeat yourself
&lt;/h4&gt;
&lt;p&gt;
Understand how styles cascade and when to apply classes. Put your styles as high up
the tree as possible. If a font is going to be applied to every element on the page,
then apply that style to the body. Again, some tools are bad about this and will put
the same tags in again and again. You want to put the style into a place where it's
going to applied as widely as possible so that you don't have multiple places to manage
that style - so you don't repeat yourself when it's unnecessary. Focus on applying
as much of the styles as you can in the smallest amount of CSS possible. Just as you
group code together so that you can re-use it to in different components in your application,
put your CSS in external files that logically group your styles for reuse.
&lt;/p&gt;
&lt;p&gt;
&lt;a href='http://www.456bereastreet.com/archive/200605/writing_good_html_is_a_craft/'&gt;Writing
good HTML is a craft&lt;/a&gt;. You should structure your HTML as carefully as you would
your code, and you'll have a presentation layer that's maintainable and easier to
manage. You may never be a great graphic designer &lt;a href='http://www.csszengarden.com'&gt;like
some people are&lt;/a&gt;, but you can still create great HTML and CSS.
&lt;/p&gt;
&lt;p&gt;
To close it out, here's a few sites that are good to check out for HTML and CSS
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href='http://meyerweb.com/eric/css/'&gt;Eric Meyer: CSS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href='http://www.456bereastreet.com/'&gt;456 Berea Street&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href='http://www.w3.org/Style/CSS/'&gt;W3C&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href='http://www.zeldman.com'&gt;Zeldman&lt;/a&gt; - &lt;a href='http://www.zeldman.com/externals/#cssmarkup'&gt;Also,
his list of CSS references&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href='http://www.mezzoblue.com/zengarden/resources/'&gt;Mezzoblue CSS Resources&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.richreuter.com/aggbug.ashx?id=7a8c9161-78f0-4aab-a5cd-80f44a14fe81" /&gt;</description>
      <comments>http://www.richreuter.com/CommentView,guid,7a8c9161-78f0-4aab-a5cd-80f44a14fe81.aspx</comments>
      <category>html</category>
      <category>css</category>
      <category>webdesign</category>
    </item>
  </channel>
</rss>