<?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>ProgramimiCOM &#187; CSS</title>
	<atom:link href="http://www.programimi.com/category/tutorials/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.programimi.com</link>
	<description>Programming And Web Resources</description>
	<lastBuildDate>Fri, 19 Mar 2010 21:00:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Web Standards Checklist &#8211; How to make a proper website</title>
		<link>http://www.programimi.com/2008/04/03/a-web-standards-checklist-how-to-make-a-proper-website/</link>
		<comments>http://www.programimi.com/2008/04/03/a-web-standards-checklist-how-to-make-a-proper-website/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 11:14:51 +0000</pubDate>
		<dc:creator>ProCOM</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Authoring]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Resources]]></category>
		<category><![CDATA[checklist]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[web standarts]]></category>

		<guid isPermaLink="false">http://www.programimi.com/?p=983</guid>
		<description><![CDATA[

A web standards checklist
The term web standards can mean different things to different people. For some, it is &#8216;table-free sites&#8217;, for others it is &#8216;using valid code&#8217;. However, web standards are much broader than that. A site built to web standards should adhere to standards (HTML, XHTML, XML, CSS, XSLT, DOM, MathML, SVG etc) and [...]]]></description>
			<content:encoded><![CDATA[<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace aboveboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>
<p><strong>A web standards checklist</strong></p>
<p>The term web standards can mean different things to different people. For some, it is &#8216;table-free sites&#8217;, for others it is &#8216;using valid code&#8217;. However, web standards are much broader than that. A site built to web standards should adhere to standards (HTML, XHTML, XML, CSS, XSLT, DOM, MathML, SVG etc) and pursue best practices (valid code, accessible code, semantically correct code, user-friendly URLs etc).</p>
<p>In other words, a site built to web standards should ideally be lean, clean, CSS-based, accessible, usable and search engine friendly.</p>
<p><strong>About the checklist</strong></p>
<p>This is not an uber-checklist. There are probably many items that could be added. More importantly, it should not be seen as a list of items that must be addressed on every site that you develop. It is simply a guide that can be used:</p>
<p>- to show the breadth of web standards<br />
- as a handy tool for developers during the production phase of websites<br />
- as an aid for developers who are interested in moving towards web standards</p>
<p><strong>The checklist</strong></p>
<p><strong>1.Quality of code</strong><br />
a. Does the site use a correct Doctype?<br />
b. Does the site use a Character set?<br />
c. Does the site use Valid (X)HTML?<br />
d. Does the site use Valid CSS?<br />
e. Does the site use any CSS hacks?<br />
f. Does the site use unnecessary classes or ids?<br />
g. Is the code well structured?<br />
h. Does the site have any broken links?<br />
i. How does the site perform in terms of speed/page size?<br />
j. Does the site have JavaScript errors?</p>
<p><strong>2. Degree of separation between content and presentation</strong><br />
a. Does the site use CSS for all presentation aspects (fonts, colour, padding, borders etc)?<br />
b. Are all decorative images in the CSS, or do they appear in the (X)HTML?</p>
<p><strong>3. Accessibility for users</strong><br />
a. Are &#8220;alt&#8221; attributes used for all descriptive images?<br />
b. Does the site use relative units rather than absolute units for text size?<br />
c. Do any aspects of the layout break if font size is increased?<br />
d. Does the site use visible skip menus?<br />
e. Does the site use accessible forms?<br />
f. Does the site use accessible tables?<br />
g. Is there sufficient colour brightness/contrasts?<br />
h. Is colour alone used for critical information?<br />
i. Is there delayed responsiveness for dropdown menus (for users with reduced motor skills)?<br />
j. Are all links descriptive (for blind users)?</p>
<p><strong>4. Accessibility for devices</strong><br />
a. Does the site work acceptably across modern and older browsers?<br />
b. Is the content accessible with CSS switched off or not supported?<br />
c. Is the content accessible with images switched off or not supported?<br />
d. Does the site work in text browsers such as Lynx?<br />
e. Does the site work well when printed?<br />
f. Does the site work well in Hand Held devices?<br />
g. Does the site include detailed metadata?<br />
h. Does the site work well in a range of browser window sizes?</p>
<p><strong>5. Basic Usability</strong><br />
a. Is there a clear visual hierarchy?<br />
b. Are heading levels easy to distinguish?<br />
c. Does the site have easy to understand navigation?<br />
d. Does the site use consistent navigation?<br />
e. Are links underlined?<br />
f. Does the site use consistent and appropriate language?<br />
g. Do you have a sitemap page and contact page? Are they easy to find?<br />
h. For large sites, is there a search tool?<br />
i. Is there a link to the home page on every page in the site?<br />
j. Are visited links clearly defined with a unique colour?</p>
<p><strong>6. Site management</strong><br />
a. Does the site have a meaningful and helpful 404 error page that works from any depth in the site?<br />
b. Does the site use friendly URLs?<br />
c. Do your URLs work without &#8220;www&#8221;?<br />
d. Does the site have a favicon?</p>
<p><strong>1. Quality of code</strong></p>
<p><strong>1.1 Does the site use a correct Doctype?</strong><br />
A doctype (short for &#8216;document type declaration&#8217;) informs the validator which version of (X)HTML you&#8217;re using, and must appear at the very top of every web page. Doctypes are a key component of compliant web pages: your markup and CSS won&#8217;t validate without them.</p>
<p><code>http://www.alistapart.com/articles/doctype/</code></p>
<p><em>More:</em></p>
<p><code>http://www.w3.org/QA/2002/04/valid-dtd-list.html</code></p>
<p><code>http://css.maxdesign.com.au/listamatic/about-boxmodel.htm</code></p>
<p><code>http://gutfeldt.ch/matthias/articles/doctypeswitch.html</code></p>
<p><strong>1.2 Does the site use a Character set?</strong><br />
If a user agent (eg. a browser) is unable to detect the character encoding used in a Web document, the user may be presented with unreadable text. This information is particularly important for those maintaining and extending a multilingual site, but declaring the character encoding of the document is important for anyone producing XHTML/HTML or CSS.</p>
<p><code>http://www.w3.org/International/tutorials/tutorial-char-enc/</code></p>
<p><em>More:</em></p>
<p><code>http://www.w3.org/International/O-charset.html</code></p>
<p><strong>1.3 Does the site use Valid (X)HTML?</strong><br />
Valid code will render faster than code with errors. Valid code will render better than invalid code. Browsers are becoming more standards compliant, and it is becoming increasingly necessary to write valid and standards compliant HTML.</p>
<p><code>http://www.maxdesign.com.au/presentation/sit2003/06.htm</code></p>
<p><em>More:</em></p>
<p><code>http://validator.w3.org/</code></p>
<p><strong>1.4 Does the site use Valid CSS?</strong><br />
You need to make sure that there aren&#8217;t any errors in either your HTML or your CSS, since mistakes in either place can result in botched document appearance.</p>
<p><code>http://www.meyerweb.com/eric/articles/webrev/199904.html</code></p>
<p><em>More:</em></p>
<p><code>http://jigsaw.w3.org/css-validator/</code></p>
<p><strong>1.5 Does the site use any CSS hacks?</strong><br />
Basically, hacks come down to personal choice, the amount of knowledge you have of workarounds, the specific design you are trying to achieve.</p>
<p><code>http://www.mail-archive.com/wsg@webstandardsgroup.org/msg05823.html</code></p>
<p><em>More:</em></p>
<p><code>http://css-discuss.incutio.com/?page=CssHack</code></p>
<p><code>http://css-discuss.incutio.com/?page=ToHackOrNotToHack</code></p>
<p><code>http://centricle.com/ref/css/filters/</code></p>
<p><strong>1.6 Does the site use unnecessary classes or ids?</strong><br />
I&#8217;ve noticed that developers learning new skills often end up with good CSS but poor XHTML. Specifically, the HTML code tends to be full of unnecessary divs and ids. This results in fairly meaningless HTML and bloated style sheets.</p>
<p><code>http://www.clagnut.com/blog/228/</code></p>
<p><strong>1.7 Is the code well structured?</strong><br />
Semantically correct markup uses html elements for their given purpose. Well structured HTML has semantic meaning for a wide range of user agents (browsers without style sheets, text browsers, PDAs, search engines etc.)</p>
<p><code>http://www.maxdesign.com.au/presentation/benefits/index04.htm</code></p>
<p><em>More:</em></p>
<p><code>http://www.w3.org/2003/12/semantic-extractor.html</code></p>
<p><strong>1.8 Does the site have any broken links?</strong><br />
Broken links can frustrate users and potentially drive customers away. Broken links can also keep search engines from properly indexing your site.</p>
<p><em>More:</em></p>
<p><code>http://validator.w3.org/checklink</code></p>
<p><strong>1.9 How does the site perform in terms of speed/page size?</strong><br />
Don&#8217;t make me wait&#8230; That&#8217;s the message users give us in survey after survey. Even broadband users can suffer the slow-loading blues.</p>
<p><code>http://www.websiteoptimization.com/speed/</code></p>
<p><strong>1.10 Does the site have JavaScript errors?</strong><br />
Internet Explore for Windows allows you to turn on a debugger that will pop up a new window and let you know there are javascript errors on your site. This is available under &#8216;Internet Options&#8217; on the Advanced tab. Uncheck &#8216;Disable script debugging&#8217;.</p>
<p><strong>2. Degree of separation between content and presentation</strong></p>
<p><strong>2.1 Does the site use CSS for all presentation aspects (fonts, colour, padding, borders etc)?</strong><br />
Use style sheets to control layout and presentation.</p>
<p><code>http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-style-sheets</code></p>
<p><strong>2.2 Are all decorative images in the CSS, or do they appear in the (X)HTML?</strong><br />
The aim for web developers is to remove all presentation from the html code, leaving it clean and semantically correct.</p>
<p><code>http://www.maxdesign.com.au/presentation/benefits/index07.htm</code></p>
<p><strong>3. Accessibility for users</strong></p>
<p><strong>3.1 Are &#8220;alt&#8221; attributes used for all descriptive images?</strong><br />
Provide a text equivalent for every non-text element</p>
<p><code>http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-text-equivalent</code></p>
<p><strong>3.2 Does the site use relative units rather than absolute units for text size?</strong><br />
Use relative rather than absolute units in markup language attribute values and style sheet property values&#8217;.</p>
<p><code>http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-relative-units</code></p>
<p><em>More:</em></p>
<p><code>http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-relative-units</code></p>
<p><code>http://www.clagnut.com/blog/348/</code></p>
<p><strong>3.3 Do any aspects of the layout break if font size is increased?</strong><br />
Try this simple test. Look at your website in a browser that supports easy incrementation of font size. Now increase your browser&#8217;s font size. And again. And again&#8230; Look at your site. Does the page layout still hold together? It is dangerous for developers to assume that everyone browses using default font sizes.</p>
<p><strong> 3.4 Does the site use visible skip menus?</strong></p>
<p>A method shall be provided that permits users to skip repetitive navigation links.</p>
<p><code>http://www.section508.gov/index.cfm?FuseAction=Content&amp;ID=12</code></p>
<p>Group related links, identify the group (for user agents), and, until user agents do so, provide a way to bypass the group.</p>
<p><code>http://www.w3.org/TR/WCAG10-TECHS/#tech-group-links</code></p>
<p>&#8230;blind visitors are not the only ones inconvenienced by too many links in a navigation area. Recall that a mobility-impaired person with poor adaptive technology might be stuck tabbing through that morass.</p>
<p><code>http://joeclark.org/book/sashay/serialization/Chapter08.html#h4-2020</code></p>
<p><em>More:</em></p>
<p><code>http://www.niehs.nih.gov/websmith/508/o.htm</code></p>
<p><strong>3.5 Does the site use accessible forms?</strong><br />
Forms aren&#8217;t the easiest of things to use for people with disabilities. Navigating around a page with written content is one thing, hopping between form fields and inputting information is another.</p>
<p><code>http://www.htmldog.com/guides/htmladvanced/forms/</code></p>
<p><em>More:</em></p>
<p><code>http://www.webstandards.org/learn/tutorials/accessible-forms/01-accessible-forms.html</code></p>
<p><code>http://www.accessify.com/tools-and-wizards/accessible-form-builder.asp</code></p>
<p><code>http://accessify.com/tutorials/better-accessible-forms.asp</code></p>
<p><strong>3.6 Does the site use accessible tables?</strong><br />
For data tables, identify row and column headers&#8230; For data tables that have two or more logical levels of row or column headers, use markup to associate data cells and header cells.</p>
<p><code>http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-table-headers</code></p>
<p><em>More:</em></p>
<p><code>http://www.bcc.ctc.edu/webpublishing/ada/resources/tables.asp</code></p>
<p><code>http://www.accessify.com/tools-and-wizards/accessible-table-builder_step1.asp</code></p>
<p><code>http://www.webaim.org/techniques/tables/</code></p>
<p><strong>3.7 Is there sufficient colour brightness/contrasts?</strong><br />
Ensure that foreground and background colour combinations provide sufficient contrast when viewed by someone having colour deficits.</p>
<p><code>http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-colour-contrast</code></p>
<p><em>More:</em></p>
<p><code>http://www.juicystudio.com/services/colourcontrast.asp</code></p>
<p><strong>3.8 Is colour alone used for critical information?</strong><br />
Ensure that all information conveyed with colour is also available without colour, for example from context or markup.</p>
<p><code>http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-colour-convey</code></p>
<p>There are basically three types of colour deficiency; Deuteranope (a form of red/green colour deficit), Protanope (another form of red/green colour deficit) and Tritanope (a blue/yellow deficit- very rare).</p>
<p><em>More:</em></p>
<p><code>http://colourfilter.wickline.org/</code></p>
<p><code>http://www.toledo-bend.com/colourblind/Ishihara.html</code></p>
<p><code>http://www.vischeck.com/vischeck/vischeckURL.php</code></p>
<p><strong>3.9 Is there delayed responsiveness for dropdown menus?</strong><br />
Users with reduced motor skills may find dropdown menus hard to use if responsiveness is set too fast.</p>
<p><strong>3.10 Are all links descriptive?</strong><br />
Link text should be meaningful enough to make sense when read out of context &#8211; either on its own or as part of a sequence of links. Link text should also be terse.</p>
<p><code>http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-meaningful-links</code></p>
<p><strong>4. Accessibility for devices.</strong></p>
<p><strong>4.1 Does the site work acceptably across modern and older browsers?</strong></p>
<p>Before starting to build a CSS-based layout, you should decide which browsers to support and to what level you intend to support them.</p>
<p><code>http://www.maxdesign.com.au/presentation/process/index_step01.cfm</code></p>
<p><strong>4.2 Is the content accessible with CSS switched off or not supported?</strong><br />
Some people may visit your site with either a browser that does not support CSS or a browser with CSS switched off. In content is structured well, this will not be an issue.</p>
<p><strong>4.3 Is the content accessible with images switched off or not supported?</strong><br />
Some people browse websites with images switched off &#8211; especially people on very slow connections. Content should still be accessible for these people.</p>
<p><strong>4.4 Does the site work in text browsers such as Lynx?</strong><br />
This is like a combination of images and CSS switched off. A text-based browser will rely on well structured content to provide meaning.</p>
<p><em>More:</em></p>
<p><code>http://www.delorie.com/web/lynxview</code></p>
<p><strong>4.5 Does the site work well when printed?</strong><br />
You can take any (X)HTML document and simply style it for print, without having to touch the markup.</p>
<p><code>http://www.alistapart.com/articles/goingtoprint/</code></p>
<p><em>More:</em></p>
<p><code>http://www.d.umn.edu/itss/support/Training/Online/webdesign/css.html#print</code></p>
<p><strong>4.6 Does the site work well in Hand Held devices?</strong><br />
This is a hard one to deal with until hand held devices consistently support their correct media type. However, some layouts work better in current hand-held devices. The importance of supporting hand held devices will depend on target audiences.</p>
<p><strong>4.7 Does the site include detailed metadata?</strong><br />
Metadata is machine understandable information for the web</p>
<p><code>http://www.w3.org/Metadata/</code></p>
<p>Metadata is structured information that is created specifically to describe another resource. In other words, metadata is &#8216;data about data&#8217;.</p>
<p><strong>4.8 Does the site work well in a range of browser window sizes?</strong><br />
It is a common assumption amongst developers that average screen sizes are increasing. Some developers assume that the average screen size is now 1024px wide. But what about users with smaller screens and users with hand held devices? Are they part of your target audience and are they being disadvantaged?</p>
<p><strong>5. Basic Usability</strong><br />
<strong> 5.1 Is there a clear visual hierarchy?</strong><br />
Organise and prioritise the contents of a page by using size, prominence and content relationships.</p>
<p><code>http://www.great-web-design-tips.com/web-site-design/165.html</code></p>
<p><strong>5.2 Are heading levels easy to distinguish?</strong><br />
Use header elements to convey document structure and use them according to specification.</p>
<p><code>http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-logical-headings</code></p>
<p><strong>5.3 Is the site&#8217;s navigation easy to understand?</strong><br />
Your navigation system should give your visitor a clue as to what page of the site they are currently on and where they can go next.</p>
<p><code>http://www.1stsitefree.com/design_nav.htm</code></p>
<p><strong>5.4 Is the site&#8217;s navigation consistent?</strong><br />
If each page on your site has a consistent style of presentation, visitors will find it easier to navigate between pages and find information</p>
<p><code>http://www.juicystudio.com/tutorial/accessibility/navigation.asp</code></p>
<p><strong>5.5 Does the site use consistent and appropriate language?</strong><br />
The use of clear and simple language promotes effective communication. Trying to come across as articulate can be as difficult to read as poorly written grammar, especially if the language used isn&#8217;t the visitor&#8217;s primary language.</p>
<p><code>http://www.juicystudio.com/tutorial/accessibility/clear.asp</code></p>
<p><strong>5.6 Does the site have a sitemap page and contact page? Are they easy to find?</strong><br />
Most site maps fail to convey multiple levels of the site&#8217;s information architecture. In usability tests, users often overlook site maps or can&#8217;t find them. Complexity is also a problem: a map should be a map, not a navigational challenge of its own.</p>
<p><code>http://www.useit.com/alertbox/20020106.html</code></p>
<p><strong>5.7 For large sites, is there a search tool?</strong><br />
While search tools are not needed on smaller sites, and some people will not ever use them, site-specific search tools allow users a choice of navigation options.</p>
<p><strong>5.8 Is there a link to the home page on every page in the site?</strong><br />
Some users like to go back to a site&#8217;s home page after navigating to content within a site. The home page becomes a base camp for these users, allowing them to regroup before exploring new content.</p>
<p><strong>5.9 Are links underlined?</strong><br />
To maximise the perceived affordance of clickability, colour and underline the link text. Users shouldn&#8217;t have to guess or scrub the page to find out where they can click.</p>
<p><code>http://www.useit.com/alertbox/20040510.html</code></p>
<p><strong>5.10 Are visited links clearly defined?</strong><br />
Most important, knowing which pages they&#8217;ve already visited frees users from unintentionally revisiting the same pages over and over again.</p>
<p><code>http://www.useit.com/alertbox/20040503.html</code></p>
<p><strong>6. Site management</strong></p>
<p><strong>6.1 Does the site have a meaningful and helpful 404 error page that works from any depth in the site?</strong><br />
You&#8217;ve requested a page &#8211; either by typing a URL directly into the address bar or clicking on an out-of-date link and you&#8217;ve found yourself in the middle of cyberspace nowhere. A user-friendly website will give you a helping hand while many others will simply do nothing, relying on the browser&#8217;s built-in ability to explain what the problem is.</p>
<p><code>http://www.alistapart.com/articles/perfect404/</code></p>
<p><strong>6.2 Does the site use friendly URLs?</strong><br />
Most search engines (with a few exceptions &#8211; namely Google) will not index any pages that have a question mark or other character (like an ampersand or equals sign) in the URL&#8230; what good is a site if no one can find it?</p>
<p><code>http://www.sitepoint.com/article/search-engine-friendly-urls</code></p>
<p>One of the worst elements of the web from a user interface standpoint is the URL. However, if they&#8217;re short, logical, and self-correcting, URLs can be acceptably usable</p>
<p><code>http://www.merges.net/theory/20010305.html</code></p>
<p><em>More:</em></p>
<p><code>http://www.sitepoint.com/article/search-engine-friendly-urls</code></p>
<p><code>http://www.websitegoodies.com/article/32</code></p>
<p><code>http://www.merges.net/theory/20010305.html</code></p>
<p><strong>6.3 Does the site&#8217;s URL work without &#8220;www&#8221;?</strong><br />
While this is not critical, and in some cases is not even possible, it is always good to give people the choice of both options. If a user types your domain name without the www and gets no site, this could disadvantage both the user and you.</p>
<p><strong> 6.4 Does the site have a favicon?</strong></p>
<p>A Favicon is a multi-resolution image included on nearly all professionally developed sites. The Favicon allows the webmaster to further promote their site, and to create a more customized appearance within a visitor&#8217;s browser.</p>
<p><code>http://www.favicon.com/</code></p>
<p>Favicons are definitely not critical. However, if they are not present, they can cause 404 errors in your logs (site statistics). Browsers like IE will request them from the server when a site is bookmarked. If a favicon isn&#8217;t available, a 404 error may be generated. Therefore, having a favicon could cut down on favicon specific 404 errors. The same is true of a &#8216;robots.txt&#8217; file.</p>

<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace belowboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.programimi.com/2008/04/03/a-web-standards-checklist-how-to-make-a-proper-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Web Page Fonts Consistent and Uniform</title>
		<link>http://www.programimi.com/2008/03/24/making-web-page-fonts-consistent-and-uniform/</link>
		<comments>http://www.programimi.com/2008/03/24/making-web-page-fonts-consistent-and-uniform/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 09:37:25 +0000</pubDate>
		<dc:creator>ProCOM</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Authoring]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[big]]></category>
		<category><![CDATA[consistent]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[small]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[uniform]]></category>
		<category><![CDATA[WEB]]></category>

		<guid isPermaLink="false">http://www.programimi.com/2008/03/24/making-web-page-fonts-consistent-and-uniform/</guid>
		<description><![CDATA[

Is it disturbing to you when every other Web page you visit has a different font size?. One web page&#8217;s font is too small, and another web page&#8217;s fonts are too big&#8230; Well here&#8217;s a way to fix that and set each web page&#8217;s fonts to just the size you want.
In Internet Explorer, select: Tools-Internet [...]]]></description>
			<content:encoded><![CDATA[<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace aboveboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>
<p>Is it disturbing to you when every other Web page you visit has a different font size?. One web page&#8217;s font is too small, and another web page&#8217;s fonts are too big&#8230; Well here&#8217;s a way to fix that and set each web page&#8217;s fonts to just the size you want.</p>
<p>In Internet Explorer, select: Tools-Internet Options, choose the General tab, click the Accessibility button, and check Ignore font sizes specified on Web pages (the wording varies depending on your IE version).</p>
<p>In Netscape 6 and 7, choose Edit-Preferences, select Fonts (double-click Appearance if you don&#8217;t see &#8216;Fonts&#8217; listed), and then either check Use my default fonts or uncheck Allow documents to use other fonts, depending on your version (the wording of these choices also varies).</p>
<p>Now all Web page fonts should be of uniform size on all pages.</p>

<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace belowboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.programimi.com/2008/03/24/making-web-page-fonts-consistent-and-uniform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>55 Reasons to Design in XHTML-CSS</title>
		<link>http://www.programimi.com/2007/09/14/55-reasons-to-design-in-xhtml-css/</link>
		<comments>http://www.programimi.com/2007/09/14/55-reasons-to-design-in-xhtml-css/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 23:00:59 +0000</pubDate>
		<dc:creator>ProCOM</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Opinions]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WEB]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Resources]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.programimi.com/2007/09/14/55-reasons-to-design-in-xhtml-css/</guid>
		<description><![CDATA[

In no particular order 55 reasons for me to do “tableless” websites using valid XHTML for markup, CSS for layout and Flash sparingly, only as an ingredient. By tableless I mean avoiding tables (or a tagsoup of unnecessary divs substituting table trs and tds) for layout purposes and aiming towards as semantic markup as possible. [...]]]></description>
			<content:encoded><![CDATA[<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace aboveboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>
<p class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">In no particular order 55 reasons for me to do “tableless” websites using valid XHTML for markup, CSS for layout and Flash sparingly, only as an ingredient. By tableless I mean avoiding tables (or a tagsoup of unnecessary divs substituting table trs and tds) for layout purposes and aiming towards as semantic markup as possible. Some of the reasons are “over HTML&#8221;, some “over Flash full monty” and some over both. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">I know this topic has been discussed a plenty, I just needed to reaffirm myself :)</p>
<p>Here we go:<o:p></o:p></span></p>
<ol start="1" type="1">
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You can get free links from      showcase sites like </span><span style="font-size: 10pt"><a href="http://www.csszengarden.com/"><span style="color: blue">zengarden</span></a></span><span style="font-size: 10pt">, </span><span style="font-size: 10pt"><a href="http://www.stylegala.com/"><span style="color: blue">stylegala</span></a></span><span style="font-size: 10pt">, </span><span style="font-size: 10pt"><a href="http://www.cssimport.com/"><span style="color: blue">cssimport</span></a></span><span style="font-size: 10pt"> or </span><span style="font-size: 10pt"><a href="http://www.cssbeauty.com/"><span style="color: blue">cssbeauty</span></a></span><span style="font-size: 10pt"><o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You don’t have to spend extra      thought and time deciding on styling the mark up of your document (upper-      or lowercase, quotes or no quotes on attributes)<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You don’t need to spend extra      thought on which tags should be closed and which can (or should) be left open<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You “help” the search engines to      deliver more relevant content using semantic markup<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You can save in bandwidth costs      and visitors will see them faster by making slimmer pages<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">It’s going to be easier for you to      switch to XHTML 2.0 which will give you more semantic tools<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Once you’ve practised enough,      coding pages becomes a whole lot simpler and faster than any table/tr/td      tagsoup<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">When the coding is faster you can      spend more time on thinking about the user experience<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Thinking about semantics of a      document helps you to make design and information architecture decisions<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You can quickly make a dummy site      to test your sites information architecture and append a look and feel      later with only minor code changes<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You can do the design after most      of the backend is done which will help your client (or boss) to think      realistically about how much work is still needed<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">It’s possible to link directly to      your content pages (compared to Flash)<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">browser controls like text-size      and back and forward buttons work (compared to Flash)<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Redesigns and realigns over the      whole site are simpler<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">it’s simpler to make small last      minute changes to your designs<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Clean markup makes it easier or      even unnecessary to build a CMS<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Clean markup makes it easier for      another developer to jump on board<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You can make the backend almost      totally independently from the frontend design, by completely different      person<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You have plenty of ways to play      with the markup trying to optimize for search engines, without affecting      visible layout<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You have total control on print      layouts of your pages<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Your sites are automatically      accessible to all kinds of browsers<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Promoting web standards will help      your work in the future, not having to code differently to each browser<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">With all elemets closed you mark      up look cleaner<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Well-formed code ensures your site      works in more browsers<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Well-formed code would help      browser coders to spend more time on useful features than rendering      engines that try to understand borken code<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Your website will work in future      browsers<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Your website works in mobile (and      other new) devices<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You learn the basics of XML which      has many other uses<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">CSS files are saved in browser      cache for fast retrieval and less bandwidth use<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Your documents are easy to convert      back and forth another format using XSLT<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Thinking semantics makes you think      more about the content<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Learning semantics makes you      appreciate organization and write your other documents (even emails) in      more organized way<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You can write new technologies in      your CV or portfolio<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Modern browsers render a valid document      faster<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You feel better about yourself      when you are making sites “the right way”<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">They are doing it: </span><span style="font-size: 10pt"><a href="http://www.simplebits.com/"><span style="color: blue">Dan Cederholm</span></a></span><span style="font-size: 10pt">, </span><span style="font-size: 10pt"><a href="http://www.zeldman.com/"><span style="color: blue">Jeffrey      Zeldman</span></a></span><span style="font-size: 10pt">, </span><span style="font-size: 10pt"><a href="http://www.jasonsantamaria.com/"><span style="color: blue">Jason Santa Maria</span></a></span><span style="font-size: 10pt">, </span><span style="font-size: 10pt"><a href="http://www.shauninman.com/"><span style="color: blue">Shaun      Inman</span></a></span><span style="font-size: 10pt">, </span><span style="font-size: 10pt"><a href="http://www.cameronmoll.com/"><span style="color: blue">Cameron Moll</span></a></span><span style="font-size: 10pt">, </span><span style="font-size: 10pt"><a href="http://www.stopdesign.com/"><span style="color: blue">Douglas      Bowman</span></a></span><span style="font-size: 10pt">, </span><span style="font-size: 10pt"><a href="http://www.mezzoblue.com/"><span style="color: blue">Dave Shea</span></a></span><span style="font-size: 10pt">…<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You will belong in a      “movement&#8221;, make good contacts etc.<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You learn to appreciate newer      browsers which makes for more competition and later for better browsers<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Blink tag is gone<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Strict coding makes you learn to      see mistakes quicker<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You can aim to making some money      writing a book about it<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">There are more job opportunities      if you know these new ways<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You learn better to understand how      a browser works<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You can use hacks and techniques      with cool names like “be nice to Opera”<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">you start to care more about      metadata, document and character types<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">With more people making slimmer      pages, the amount of data moving in the whole web will be smaller and all      connections faster<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">XHTML has a cooler name than HTML<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">There are more people thinking      about the advantages and disadvantages and coding tricks of XHTML which      makes for a bigger learning forum<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">You can use basically same markup      template for many different websites<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Learning to read and write it fast      makes it possible to use cheaper tools (notepad)<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Google knows this: <o:p></o:p></span>
<ul type="circle">
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">4,380,000 xhtml better than html       &gt; 4,370,000 html better than xhtml<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">206 “xhtml is better than html”       &gt; 87 “html is better than xhtml”<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">2,130,000 xhtml sucks &lt;       10,300,000 html sucks<o:p></o:p></span></li>
</ul>
</li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">When all browsers start to      understand the correct MIME-type (xml), you don’t have to convert all your      websites from html, just to switch to correct MIME<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">By more people using xhtml you      ensure that in the future IE will need to understand the correct MIME-type<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">Accessibility is enforced with      requiring Alt attribute for images<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: normal"><span style="font-size: 10pt">There just aren’t this many      reasons to use HTML or entirely Flash instead<o:p></o:p></span></li>
</ol>

<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace belowboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.programimi.com/2007/09/14/55-reasons-to-design-in-xhtml-css/feed/</wfw:commentRss>
		<slash:comments>59</slash:comments>
		</item>
		<item>
		<title>Ten more CSS tricks you may not know</title>
		<link>http://www.programimi.com/2007/09/12/ten-more-css-tricks-you-may-not-know/</link>
		<comments>http://www.programimi.com/2007/09/12/ten-more-css-tricks-you-may-not-know/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 02:15:52 +0000</pubDate>
		<dc:creator>ProCOM</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WEB]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.programimi.com/2007/09/12/ten-more-css-tricks-you-may-not-know/</guid>
		<description><![CDATA[

Ten CSS Tricks You May Not Know has proven to be such a success that we decided it was time to offer you ten more CSS tricks that you may not know.
1. Block vs. inline level elements
Nearly all HTML elements are either block or inline elements. The characteristics of block elements include:

Always begin on a [...]]]></description>
			<content:encoded><![CDATA[<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace aboveboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>
<p><a href="http://www.programimi.com/2007/09/04/quick-tips-ten-css-tricks-you-may-not-know/" target="_blank"><strong>Ten CSS Tricks You May Not Know</strong></a> has proven to be such a success that we decided it was time to offer you ten more CSS tricks that you may not know.</p>
<h2>1. Block vs. inline level elements</h2>
<p>Nearly all HTML elements are either block or inline elements. <strong>The characteristics of block elements</strong> include:</p>
<ul>
<li>Always begin on a new line</li>
<li>Height, line-height and top and bottom margins can be manipulated</li>
<li>Width defaults to 100% of their containing element, unless a width is specified</li>
</ul>
<p>Examples of block elements include <code>&lt;div&gt;</code>, <code>&lt;p&gt;</code>, <code>&lt;h1&gt;</code>, <code>&lt;form&gt;</code>, <code>&lt;ul&gt;</code> and <code>&lt;li&gt;</code>. <strong>Inline elements</strong> on the other hand have the <strong>opposite characteristics</strong>:</p>
<ul>
<li>Begin on the same line</li>
<li>Height, line-height and top and bottom margins can&#8217;t be changed</li>
<li>Width is as long as the text/image and can&#8217;t be manipulated</li>
</ul>
<p>Examples of inline elements include <code>&lt;span&gt;</code>, <code>&lt;a&gt;</code>, <code>&lt;label&gt;</code>, <code>&lt;input&gt;</code>, <code>&lt;img&gt;</code>, <code>&lt;strong&gt;</code> and <code>&lt;em&gt;</code>.</p>
<p>To change an element&#8217;s status you can use <code>display: inline</code> or <code>display: block</code>. But what&#8217;s the point of changing an element from being block to inline, or vice-versa? Well, at first it may seem like you might hardly ever use this, but in actual fact this is a very powerful technique, which you can use any time you want to:</p>
<ul>
<li>Have an inline element start on a new line</li>
<li>Have a block element start on the same line</li>
<li>Control the width of an inline element (particularly useful for navigation links)</li>
<li>Manipulate the height of an inline element</li>
<li>Set a background colour as wide as the text for block elements, without having to specify a width</li>
</ul>
<h2>2. Another box model hack alternative</h2>
<p>The <a href="http://tantek.com/CSS/Examples/boxmodelhack.html">box model hack</a> is used to fix a rendering problem in pre-<acronym title="Internet Explorer">IE</acronym> 6 browsers on <acronym title="Personal Computer">PC</acronym>, where by the border and padding are <em>included</em> in the width of an element, as opposed to <em>added on</em>. A number of <acronym title="Cascading Stylesheets">CSS</acronym>-based solutions have been put forward to remedy this, so here&#8217;s another one which we really like:</p>
<p><code>padding: 2em;<br />
border: 1em solid green;<br />
width: 20em;<br />
width/**/:/**/ 14em; 			</code></p>
<p>The first width command is read by all browsers; the second by all browsers <em>except</em> <acronym title="Internet Explorer">IE</acronym>5.x on <acronym title="Personal Computer">PC</acronym>. Because the <strong>second command comes second it takes precedence over the first</strong> &#8211; any command that comes second will always override a preceding command. So, how does all this work?</p>
<p>By placing empty comment tags (/**/) before the colons, <acronym title="Internet Explorer">IE</acronym>5.0 will ignore the command. Likewise, by placing these empty comment tags after the colon, <acronym title="Internet Explorer">IE</acronym>5.5 will ignore the command. By using these two rules in conjunction with each other, we can hide the command from all of <acronym title="Internet Explorer">IE</acronym>5.x.</p>
<h2>3. Minimum width for a page</h2>
<p>A very handy <acronym title="Cascading Stylesheets">CSS</acronym> command that exists is the <code>min-width</code> command, whereby you can specify a minimum width for any element. This can be particularly useful for specifying a minimum width for a page.</p>
<p>Unfortunately, <acronym title="Internet Explorer">IE</acronym> doesn&#8217;t understand this command, so we&#8217;ll need to come up with a new way of making this work in this browser. First, we&#8217;ll insert a <code>&lt;div&gt;</code> under the <code>&lt;body&gt;</code> tag, as we <strong>can&#8217;t assign a minimum width to the <code>&lt;body&gt;</code></strong>:</p>
<p><code> 				&lt;body&gt;<br />
&lt;div id="container"&gt; 			</code></p>
<p>Next we create our <acronym title="Cascading Stylesheets">CSS</acronym> commands, so as to create a minimum width of 600px:</p>
<p><code> 				#container<br />
{<br />
min-width: 600px;<br />
width:expression(document.body.clientWidth &lt; 600? "600px": "auto" );<br />
} 			</code></p>
<p>The first command is the regular minimum width command; the second is a short JavaScript command that only <acronym title="Internet Explorer">IE</acronym> understands. Do note though, this command will cause your <acronym title="Cascading Stylesheets">CSS</acronym> document to invalidate so you may prefer to insert it into the head of each <acronym title="Hypertext Markup Language">HTML</acronym> document to get round this.</p>
<p>You might also want to combine this minimum width with a maximum width:</p>
<p><code> 				#container<br />
{<br />
min-width: 600px;<br />
max-width: 1200px;<br />
width:expression(document.body.clientWidth &lt; 600? "600px" : document.body.clientWidth &gt; 1200? "1200px" : "auto");<br />
} 			</code></p>
<h2>4. <acronym title="Internet Explorer">IE</acronym> and width &amp; height issues</h2>
<p><acronym title="Internet Explorer">IE</acronym> has a rather strange way of doing things. It doesn&#8217;t understand the <code>min-width</code> and <code>min-height</code> commands, but instead interprets <code>width</code> and <code>height</code> as <code>min-width</code> and <code>min-height</code> &#8211; go figure!</p>
<p>This can cause problems, because we may need boxes to be resizable should more text need to go in them or should the user resize text. If we only use the <code>width</code> and <code>height</code> commands on a box then non-<acronym title="Internet Explorer">IE</acronym> browsers won&#8217;t allow the box to resize. If we only use the <code>min-width</code> and <code>min-height</code> commands though then we can&#8217;t control the width or height in <acronym title="Internet Explorer">IE</acronym>!</p>
<p>This can be especially problematic when using <strong>background images</strong>. If you&#8217;re using a background image that&#8217;s 80px wide and 35px high, then you&#8217;ll want to make sure that the default size for a box using this image is exactly 80 x 35px. However, if users resize the text then the box size will need to expand gracefully.</p>
<p>To <strong>resolve this problem</strong>, you can use the following code for a box with <code>class="box"</code>:</p>
<p><code> 				.box<br />
{<br />
width: 80px;<br />
height: 35px;<br />
}</code></p>
<p>html&gt;body .box<br />
{<br />
width: auto;<br />
height: auto;<br />
min-width: 80px;<br />
min-height: 35px;<br />
}</p>
<p>All browsers will read through the first <acronym title="Cascading Stylesheets">CSS</acronym> rule but <acronym title="Internet Explorer">IE</acronym> will ignore the second rule because it makes use of the <a href="http://meyerweb.com/eric/articles/webrev/200006b.html">child selector command</a>. Non-<acronym title="Internet Explorer">IE</acronym> browsers will read through the second one and will override the values from the first rule because this <acronym title="Cascading Stylesheets">CSS</acronym> rule is more specific, and <strong><acronym title="Cascading Stylesheets">CSS</acronym> rules that are more specific always override those that are less specific</strong>.</p>
<h2>5. Text-transform command</h2>
<p>One of the lesser known, but really useful <acronym title="Cascading Stylesheets">CSS</acronym> commands is the <code>text-transform</code> command. Three of the more common values for this rule are: <code>text-transform: uppercase</code>, <code>text-transform: lowercase</code> and <code>text-transform: capitalize</code>. The first rule turns all characters into capital letters, the second turns them all into small letters, and the third makes the first letter of each word capitals.</p>
<p>This command is incredibly useful to help <strong>ensure consistency in style across an entire website</strong>, particularly if there a number of content editors. Say for example your style guide dictates that words in headings must always begin with capital letters. To ensure that this is always the case, use <code>text-transform: capitalize</code>. Even if site editors forget about the capitalisation, their mistake won&#8217;t show up on the website.</p>
<p>It&#8217;s also preferable to <strong>use <code>text-transform: uppercase</code> to capitalise words</strong>, as screen readers may pronounce shorter words in capital letters as acronyms. A great example of this is ‘CONTACT US’, which is pronounced as ‘contact U S’ by some screen readers.</p>
<h2>6. Disappearing text or images in <acronym title="Internet Explorer">IE</acronym>?</h2>
<p><acronym title="Internet Explorer">IE</acronym> has a very strange bug where text or background images sometimes disappears from sight. These items are still actually there, and if you highlight everything on screen or hit refresh they&#8217;ll often re-appear. Kind of strange, huh?</p>
<p>This problem mostly occurs on background images and on text next to a floated element. To <strong>remedy the problem</strong>, simply insert <code>position: relative</code> into the CSS command for the disappearing element, and for some bizarre reason that&#8217;ll usually fix the problem. If this doesn&#8217;t work (it sometimes doesn&#8217;t), assign a width to the offending element in the CSS and that should fix the problem.</p>
<h2>7. Invisible text</h2>
<p>Sometime you may actually want to make text invisible. Invisible text can be especially <strong>useful for screen reader users</strong>, perhaps to assign a label to a form item or insert a heading ahead of a section. Don&#8217;t want to change the visual appearance by inserting these? Make them invisible and no one using a visual browser knows that they&#8217;re there.</p>
<p>You may also want to make text invisible if using a <strong>print or handheld <acronym title="Cascading Stylesheets">CSS</acronym></strong> file, as some information may not need to be displayed on either of these mediums (see below for more on this).</p>
<p>To make text invisible you can use <code>display: none</code> &#8211; easy! This works fine for hiding text from handhelds (if <acronym title="Cascading Stylesheets">CSS</acronym> is supported) and printed web pages, but isn&#8217;t so great for many screen readers. Screen readers are now becoming too clever for their own good, and some will actually ignore the any text that has the rule <code>display: none</code> assigned to it.</p>
<p>For screen readers users therefore, a new approach is needed: <code>position: absolute; left: -9000px</code>. This basically takes the text and positions it 9000px to the left of the left edge of the screen, essentially making it invisible.</p>
<h2>8. <acronym title="Cascading Stylesheets">CSS</acronym> document for handhelds</h2>
<p>A separate <acronym title="Cascading Stylesheets">CSS</acronym> document can be created for <acronym title="Personal Digital Assistant">PDA</acronym>s and mobile phones, and only activated when one of these devices is being used to access your site. More and more websites are creating separate <a href="http://www.alistapart.com/articles/goingtoprint/"><acronym title="Cascading Stylesheets">CSS</acronym> documents for printing</a>, so web pages automatically become print-friendly when users choose to print them. You can also do the same for handheld devices.</p>
<p>The following command is used to call up the <acronym title="Cascading Stylesheets">CSS</acronym> document for handhelds:</p>
<p><code> 				&lt;link type="text/css" rel="stylesheet" href="handheldstyle.css" <strong>media="handheld"</strong> /&gt; 			</code></p>
<p><acronym title="Cascading Stylesheets">CSS</acronym> commands in the handheld <acronym title="Cascading Stylesheets">CSS</acronym> file override any equivalent commands in the main <acronym title="Cascading Stylesheets">CSS</acronym> document. So, what commands should you place in this file?</p>
<p>Ideally, you want handheld web users to <strong>avoid having to scroll across</strong>. To test this, open up your website in a regular browser window and resize it to 150px in width. Then, open up your main <acronym title="Cascading Stylesheets">CSS</acronym> file and insert some new commands at the very bottom of the document. The commands you place here should adjust the layout of the website so that it doesn&#8217;t require horizontal scrolling at a 150px width. Then, open up a new document, cut and paste these new commands over, and save it as handheldstyle.css (or whatever name you want to give it).</p>
<p>What your website offers to handheld web users should be quite different to what it offers on traditional web browsers, as the user experience is quite different. For further information, a book such as <a href="http://www.amazon.com/gp/product/0470844469?ie=UTF8&amp;tag=besbl00-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0470844469" target="_blank">Handheld Usability</a> is a great read.</p>
<h2>9. 3-d push button effect</h2>
<p>Back in the early days of the web, 3-d buttons that appeared to become pushed in when moused over were all the rage. At that time, this could only be achieved through images and JavaScript, but now with the advent of <acronym title="Cascading Stylesheets">CSS</acronym> we can go all retro and re-create the desired effect:</p>
<p>The <strong>main <acronym title="Cascading Stylesheets">CSS</acronym> commands</strong>  you&#8217;ll need are:</p>
<p><code> 				a 				{<br />
display: block;<br />
border: 1px solid;<br />
border-color: #aaa #000 #000 #aaa;<br />
width: 8em;<br />
background: #fc0;<br />
}</code></p>
<p>a:hover<br />
{<br />
position: relative;<br />
top: 1px;<br />
left: 1px;<br />
border-color: #000 #aaa #aaa #000;<br />
}</p>
<p>Aside from these commands, you can insert any other commands to achieve the desired presentation effect &#8211; the only limit is your imagination!</p>
<h2>10. Same navigation code on every page</h2>
<p>Most websites highlight the navigation item of the user&#8217;s location in the website, to help users orientate themselves. This is a fundamental requirement for basic usability, but can be a pain as you&#8217;ll need to tweak the <acronym title="Hypertext Markup Language">HTML</acronym> code behind the navigation for each and every page. So can we have the best of both worlds? Is it possible to have the <strong>navigation highlighted on every page, without having to tweak the <acronym title="Hypertext Markup Language">HTML</acronym> code</strong> on each and every page? Of course it is&#8230;</p>
<p>First of all, you&#8217;ll need to assign a class to each navigation item:</p>
<p><code> 				&lt;ul&gt;<br />
&lt;li&gt;&lt;a href="#" <strong>class="home"</strong>&gt;Home&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="#" <strong>class="about"</strong>&gt;About us&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="#" <strong>class="contact"</strong>&gt;Contact us&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
</code></p>
<p>You&#8217;ll then need to <strong>insert an <code>id</code> into the <code>&lt;body&gt;</code></strong> tag. The <code>id</code> should be representative of where users are in the site and should change when users move to a different site section. When in ‘Home’ it should read <code>&lt;body id="home"&gt;</code>, in ‘About Us’ it should be <code>&lt;body id="about"&gt;</code> and in ‘Contact Us’ <code>&lt;body id="contact"&gt;</code>.</p>
<p>Next, you create a new <acronym title="Cascading Stylesheets">CSS</acronym> rule:</p>
<p><code> 				#home .home, #about .about, #contact .contact<br />
{<br />
<em>commands for highlighted navigation go here</em><br />
} 			</code></p>
<p>This basically creates a rule that only takes effect when <code>class="home"</code> is contained within <code>id="home"</code>, and when <code>class="about"</code> is in <code>id="about"</code> and <code>class="contact"</code> is in <code>id="contact"</code>. These situations will only occur when the user is in the appropriate site section, seamlessly creating our highlighted navigation item.</p>

<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace belowboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.programimi.com/2007/09/12/ten-more-css-tricks-you-may-not-know/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Explorer &amp; CSS issues</title>
		<link>http://www.programimi.com/2007/09/12/internet-explorer-css-issues/</link>
		<comments>http://www.programimi.com/2007/09/12/internet-explorer-css-issues/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 23:02:31 +0000</pubDate>
		<dc:creator>ProCOM</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WEB]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.programimi.com/2007/09/12/internet-explorer-css-issues/</guid>
		<description><![CDATA[

Trying to get CSS-based websites to look the same across all browsers can often be difficult. Many of the problems however lie with Internet Explorer implementing CSS commands differently to other, more standards compliant browsers. All is not lost, however, as many of the differences you see across browsers are caused by the same Internet [...]]]></description>
			<content:encoded><![CDATA[<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace aboveboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>
<p>Trying to get <acronym title="Cascading Stylesheets">CSS</acronym>-based websites to look the same across all browsers can often be difficult. Many of the problems however lie with Internet Explorer implementing <acronym title="Cascading Stylesheets">CSS</acronym> commands differently to other, more standards compliant browsers. All is not lost, however, as many of the differences you see across browsers are caused by the same Internet Explorer <acronym title="Cascading Stylesheets">CSS</acronym> issues&#8230;</p>
<h2>1. Page elements are narrower in Internet Explorer</h2>
<p>Perhaps the most famous <acronym title="Internet Explorer">IE</acronym> and <acronym title="Cascading Stylesheets">CSS</acronym> problem is Internet Explorer&#8217;s <strong>misinterpretation of the <acronym title="Cascading Stylesheets">CSS</acronym> box model</strong>, which can cause page elements to be narrower in <acronym title="Internet Explorer">IE</acronym>. Every <acronym title="Hypertext Markup Language">HTML</acronym> element is essentially a box, the width of which is the total of its margin, border, padding and content area. Imagine the following <acronym title="Cascading Stylesheets">CSS</acronym> rule:</p>
<p><code> 				div {<br />
margin: 5em;<br />
padding: 4em;<br />
border: 1em solid green;<br />
width: 30em<br />
} 			</code></p>
<p>This means that each <code>div</code> is 50em wide in total. This amount is made up of a 30em wide content area, and a 4em padding, 1em border and 5em (invisible) margin on both the left and right sides.</p>
<p>In <acronym title="Internet Explorer">IE</acronym> however, the <strong>border and padding are included in the width</strong> of the content, as opposed to added on. In <acronym title="Internet Explorer">IE</acronym> therefore, the width of the content is only 20em (30em less 5em padding and border on either side), and the total width of the <code>div</code> is just 40em.<br />
This <acronym title="Cascading Stylesheets">CSS</acronym> box model problem occurs in <acronym title="Internet Explorer">IE</acronym>5.x, and can occur in <acronym title="Internet Explorer">IE</acronym>6, depending on how you declare the <strong><acronym title="International Organization for Standardization">ISO</acronym> value</strong> in the <acronym title="Hypertext Markup Language">HTML</acronym> code. There are two ways of doing this:</p>
<ul>
<li><code>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;</code></li>
<li><code>&lt;meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /&gt;</code></li>
</ul>
<p>The first command is placed on the very first line of the <acronym title="Hypertext Markup Language">HTML</acronym> document and the second can be placed anywhere within the <code>&lt;head&gt;</code>. In order for <acronym title="eXtensible Hypertext Markup Language">XHTML</acronym> pages to validate it&#8217;s compulsory to use one of these commands. The <acronym title="Worldwide Web Consortium">W3C</acronym> recommends using the first command as the second will be phased out in the future.</p>
<p>By using the first command however, Internet Explorer 6 will render the <acronym title="Cascading Stylesheets">CSS</acronym> box model incorrectly, just like in version 5 browsers. To fix the box model problem, you&#8217;ll need to insert a <acronym title="Cascading Stylesheets">CSS</acronym> hack to send <strong>different width values to different browsers</strong>. The <acronym title="Cascading Stylesheets">CSS</acronym> hack you use will depend on which <acronym title="International Organization for Standardization">ISO</acronym> value you use, and therefore which versions of <acronym title="Internet Explorer">IE</acronym> are rendering the box model incorrectly.</p>
<p>To <strong>fix up only <acronym title="Internet Explorer">IE</acronym>5.x</strong>, use the following <acronym title="Cascading Stylesheets">CSS</acronym> commands:</p>
<p><code> 				div {<br />
margin: 5em;<br />
padding: 4em;<br />
border: 1em solid green;<br />
<strong>width/**/:/**/ 40em;</strong><br />
width: 30em<br />
} 			</code></p>
<p>To fix up <strong>all versions of <acronym title="Internet Explorer">IE</acronym></strong>, use these <acronym title="Cascading Stylesheets">CSS</acronym> commands:</p>
<p><code> 				div {<br />
margin: 5em;<br />
padding: 4em;<br />
border: 1em solid green;<br />
<strong>width: 40em</strong><br />
}<br />
<strong>html&gt;body</strong> div {<br />
width: 30em<br />
} 			</code></p>
<p>(See the article, <a href="http://www.programimi.com/2007/09/04/css-hacks-browser-detection/" target="_blank">CSS hacks &amp; browser detection</a> for more on these hacks.)</p>
<h2>2. Text spilling out of its container in non-<acronym title="Internet Explorer">IE</acronym> browsers</h2>
<p>Internet Explorer, unlike other browsers, will expand borders and background colours so text doesn&#8217;t spill out of its containing element.</p>
<p>If you&#8217;re going to view this in Internet Explorer, the box should look fine. In all other browsers the text is spilling out of the right-hand side of the box. The box has been assigned <code>class="box"</code> and has the following <acronym title="Cascading Stylesheets">CSS</acronym> commands assigned to it:<code> 				.box {<br />
width: 40px;<br />
border: 2px solid #781351;<br />
padding: 3px;<br />
background: #d7b9c9;<br />
white-space: nowrap<br />
} 			</code></p>
<p>Non-<acronym title="Internet Explorer">IE</acronym> browsers will adhere to the <code>width: 40px</code> <acronym title="Cascading Stylesheets">CSS</acronym> command, which is why the box doesn&#8217;t expand in these browsers. <strong><acronym title="Internet Explorer">IE</acronym> instead interprets <code>width</code> as <code>min-width</code></strong>, and therefore expands the box to fit the text (the same applies with <code>height</code> and <code>min-height</code>).</p>
<p>To ensure the text doesn&#8217;t spill out of the box in all browsers, you&#8217;ll need to use the following <acronym title="Cascading Stylesheets">CSS</acronym> rule, in addition to the first one:</p>
<p><code> 				html&gt;body .box<br />
{<br />
width: auto;<br />
min-width: 40px<br />
} 			</code></p>
<p><acronym title="Internet Explorer">IE</acronym> will ignore this <acronym title="Cascading Stylesheets">CSS</acronym> command, as the command has <code>html&gt;body</code> at the front of it (see the article, <a href="http://www.programimi.com/2007/09/04/css-hacks-browser-detection/" target="_blank">CSS hacks &amp; browser detection</a> for more on this). As such, this <acronym title="Cascading Stylesheets">CSS</acronym> command is only for non-<acronym title="Internet Explorer">IE</acronym> browsers. The first <acronym title="Cascading Stylesheets">CSS</acronym> rule, <code>width: auto</code>, cancels out the original <code>width</code> rule. The second command, <code>min-width: 40px</code> then assigns a minimum width to the box, so the box will always expand to fit the text.</p>
<p class="clear">Check out the box again (you won&#8217;t see any difference in Internet Explorer, so open this up in another browser to see the change); Much better!</p>
<h2>3. Disappearing background images</h2>
<p><acronym title="Internet Explorer">IE</acronym> has a very freaky bug where it likes to make background images (and sometimes even text &#8211; particularly if there are floated elements around) disappear. This often happens when you <strong>scroll up and down</strong> on a web page and you can usually make the background re-appear by refreshing the page.</p>
<p>Obviously you won&#8217;t want your site visitors to have to refresh a page to see a background image in full! A freaky solution to this freaky problem is to insert the <acronym title="Cascading Stylesheets">CSS</acronym> command, <code>position: relative</code> into the <acronym title="Cascading Stylesheets">CSS</acronym> rule containing the background image:</p>
<p><code> 				.foo {<br />
background: url(filename.jpg);<br />
<strong>position: relative</strong><br />
} 			</code></p>
<p>Occasionally this won&#8217;t work, so <strong>another solution</strong> is to assign a width or a height to the element with the background image. You may not want to assign a height or width, so a solution is to assign a height of 1% for Internet Explorer. Because <acronym title="Internet Explorer">IE</acronym> interprets <code>height</code> as <code>min-height</code> (see point 2 above) this <acronym title="Cascading Stylesheets">CSS</acronym> rule won&#8217;t affect the appearance:</p>
<p><code> 				.foo {<br />
background: url(filename.jpg);<br />
<strong>height: 1%</strong><br />
}<br />
html&gt;body .foo {<br />
<strong>height: auto</strong><br />
} 			</code></p>
<p>The <code>height: 1%</code> <acronym title="Cascading Stylesheets">CSS</acronym> command is cancelled out by the <code>height: auto</code> <acronym title="Cascading Stylesheets">CSS</acronym> command. Internet Explorer doesn&#8217;t understand <code>html&gt;body</code>, so by inserting this in front of the second <acronym title="Cascading Stylesheets">CSS</acronym> rule this whole <acronym title="Cascading Stylesheets">CSS</acronym> rule is ignored by <acronym title="Internet Explorer">IE</acronym>.</p>
<h2>4. Widths only working on <acronym title="Internet Explorer">IE</acronym></h2>
<p>Every HTML element is either a block or an inline element. Examples of block elements include <code>&lt;div&gt;</code>, <code>&lt;p&gt;</code>, <code>&lt;h1&gt;</code>, <code>&lt;form&gt;</code> and <code>&lt;li&gt;</code>. Example of inline elements include <code>&lt;span&gt;</code>, <code>&lt;a&gt;</code>, <code>&lt;label&gt;</code>, <code>&lt;strong&gt;</code> and <code>&lt;em&gt;</code>.</p>
<p>One of the characteristics of inline elements is that you <strong>can&#8217;t change the width of an inline element</strong>. The following <acronym title="Cascading Stylesheets">CSS</acronym> rule shouldn&#8217;t, in theory, work:</p>
<p><code> 				span {<br />
width: 100px<br />
} 			</code></p>
<p>This <acronym title="Cascading Stylesheets">CSS</acronym> rule won&#8217;t work, except in Internet Explorer where each span will now have a width of 100px. In every other browser however, the width of the span will simply be the width of the number of characters contained in the element. <strong>The solution? Make the span a block level element</strong>:</p>
<p><code> 				span {<br />
width: 100px;<br />
<strong>display: block</strong><br />
} 			</code></p>
<p>(Turning the span into a block element will make the <code>width</code> command work in every browser, but it will also make the span begin on a new line. To combat this, you could assign <code>float: left</code> to the span.)</p>
<h2>5. Unstyled version of web page appearing in <acronym title="Internet Explorer">IE</acronym></h2>
<p>When your website loads up in Internet Explorer, does an <strong>unstyled version of the page appear for a second or two</strong>, before the styled version kicks in this? If so, your website may be suffering from what&#8217;s known as the <a href="http://www.bluerobot.com/web/css/fouc.asp">Flash Of Unstyled Content</a> (or FOUC).</p>
<p>If you&#8217;re using the @import directive (e.g. <code>&lt;style type="text/css"&gt;@import "styles.css";&lt;/style&gt;</code>) to call up your <acronym title="Cascading Stylesheets">CSS</acronym> file then this phenomenon may be happening on your website in <acronym title="Internet Explorer">IE</acronym>. It&#8217;s weird, there&#8217;s no logical explanation for it, but this problem obviously needs to be fixed.</p>
<p>The simple <strong>solution</strong> to this illogical problem is an equally illogical solution &#8211; insert either a link or a script element into the header:</p>
<ul>
<li><code>&lt;script type="text/javascript" src="scripts.js"&gt;&lt;/script&gt;</code></li>
<li><code>&lt;link rel="stylesheet" href="styles.css" type="text/css" media="print" /&gt;</code></li>
</ul>
<p>It doesn&#8217;t matter which one you insert (or even if you insert both). If you provide a print stylesheet, using the link element to reference it (as indicated in the example above), then you&#8217;ll never see the <acronym title="Flash Of Unstyled Content">FOUC</acronym> phenomenon.</p>
<h2>6. Fixed width web page not sitting in centre of window</h2>
<p>Got a fixed width website and can&#8217;t get it to centrally align in the window in Internet Explorer? Or you can get it to centrally align in <acronym title="Internet Explorer">IE</acronym> but not in any other browser? Fear not, it&#8217;s not your fault! Unfortunately, the correct way of centrally aligning content through <acronym title="Cascading Stylesheets">CSS</acronym> doesn&#8217;t actually work in <acronym title="Internet Explorer">IE</acronym>:</p>
<p><code> 				#container {<br />
width: 770px;<br />
margin: 0 auto<br />
} 			</code></p>
<p>The second command, <code>margin: 0 auto</code>, basically gives our containing element an automatic margin on the left and right, thereby positioning the containing element in the centre of the browser window.</p>
<p><acronym title="Internet Explorer">IE</acronym> however, will need slightly different commands to make this work:</p>
<p><code> 				body {<br />
<strong>text-align: center</strong><br />
}<br />
#container {<br />
width: 770px;<br />
margin: 0 auto;<br />
<strong>text-align: left</strong><br />
} 			</code></p>
<p>This will then centrally align the container in <acronym title="Internet Explorer">IE</acronym> too. To prevent the text from centrally aligning too, we insert <code>text-align: left</code> into the container div.</p>
<p>&#8212;</p>
<p><em>This article was written by Trenton Moss. Trenton&#8217;s crazy about web usability and accessibility &#8211; so crazy that he went and started his own web usability and accessibility consultancy to help make the Internet a better place for everyone. He knows an awful lot about the Disability Discrimination Act and spends much of his time working on the world&#8217;s most accessible CMS. </em></p>

<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace belowboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.programimi.com/2007/09/12/internet-explorer-css-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS shorthand properties</title>
		<link>http://www.programimi.com/2007/09/05/css-shorthand-properties/</link>
		<comments>http://www.programimi.com/2007/09/05/css-shorthand-properties/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 12:00:49 +0000</pubDate>
		<dc:creator>ProCOM</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WEB]]></category>

		<guid isPermaLink="false">http://www.programimi.com/2007/09/05/css-shorthand-properties/</guid>
		<description><![CDATA[

One of the main advantages of using CSS is the large reduction in web page download time. To style text, you used to have to use the &#60;font&#62; tag over and over again. You probably also laid out your site with tables, nested tables and spacer gifs. Now all that presentational information can be placed [...]]]></description>
			<content:encoded><![CDATA[<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace aboveboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>
<p>One of the main advantages of using <acronym title="Cascading Stylesheets">CSS</acronym> is the large reduction in web page download time. To style text, you used to have to use the <code>&lt;font&gt;</code> tag over and over again. You probably also laid out your site with tables, nested tables and spacer gifs. Now all that presentational information can be placed in one <acronym title="Cascading Stylesheets">CSS</acronym> document, with each command listed just once.</p>
<p>But why stop there? By using <acronym title="Cascading Stylesheets">CSS</acronym> shorthand properties you can reduce the size of your <acronym title="Cascading Stylesheets">CSS</acronym> document even more.</p>
<h2>Font</h2>
<p>Use:</p>
<p><code>font: 1em/1.5em bold italic serif</code></p>
<p>&#8230;instead of</p>
<p><code> 				font-size: 1em;<br />
line-height: 1.5em;<br />
font-weight: bold;<br />
font-style: italic;<br />
font-family: serif 			</code></p>
<p>This <acronym title="Cascading Stylesheets">CSS</acronym> shorthand property will only work if you&#8217;re specifying both the <code>font-size</code> and the <code>font-family</code> &#8211; omit either and the <acronym title="Cascading Stylesheets">CSS</acronym> rule will be completely ignored. Also, if you don&#8217;t specify the <code>font-weight</code>, <code>font-style</code>, or <code>font-varient</code> then these values will automatically default to a value of <code>normal</code>, so do bear this in mind too.</p>
<h2>Background</h2>
<p>Use:</p>
<p><code>background: #fff url(image.gif) no-repeat top left</code></p>
<p>&#8230;instead of</p>
<p><code> 				background-color: #fff;<br />
background-image: url(image.gif);<br />
background-repeat: no-repeat;<br />
background-position: top left; 			</code></p>
<p>Omit any of these commands from the background <acronym title="Cascading Stylesheets">CSS</acronym> shorthand property, and the browser will use the default values. If you leave out the <code>background-position</code> command then any background image will be place in the top-left of the container and then repeated both horizontally and vertically.</p>
<h2>Lists</h2>
<p>Use:</p>
<p><code>list-style: disc outside url(image.gif)</code></p>
<p>&#8230;instead of</p>
<p><code> 				list-style: #fff;<br />
list-style-type: disc;<br />
list-style-position: outside;<br />
list-style-image: url(image.gif) 			</code></p>
<p>Leave out any of these  <acronym title="Cascading Stylesheets">CSS</acronym> commands from the shorthand rule, and the browser will use the default values for each, namely <code>disc</code>, <code>outside</code> and <code>none</code> (i.e. no images) respectively.</p>
<h2>Margin &amp; padding</h2>
<p>There are a number of different <acronym title="Cascading Stylesheets">CSS</acronym> shorthand commands for margin and padding, depending on how many of the sides of the containing element have the same <code>margin</code> or <code>padding</code> values:</p>
<h3>Four different values</h3>
<p>Use:</p>
<p><code>margin: 2px 1px 3px 4px (<em>top, right, bottom, left</em>)</code></p>
<p>&#8230;instead of</p>
<p><code> 				margin-top: 2px;<br />
margin-right: 1px;<br />
margin-bottom: 3px;<br />
margin-left: 4px 			</code></p>
<h3>Three different values</h3>
<p>Use:</p>
<p><code>margin: 5em 1em 3em (<em>top, right and left, bottom</em>)</code></p>
<p>&#8230;instead of</p>
<p><code> 				margin-top: 5em;<br />
margin-right: 1em;<br />
margin-bottom: 3em;<br />
margin-left: 1em 			</code></p>
<h3>Two different values</h3>
<p>Use:</p>
<p><code>margin: 5% 1% (<em>top and bottom, right and left</em>)</code></p>
<p>&#8230;instead of</p>
<p><code> 				margin-top: 5%;<br />
margin-right: 1%;<br />
margin-bottom: 5%;<br />
margin-left: 1% 			</code></p>
<h3>One different value</h3>
<p>Use:</p>
<p><code>margin: 0 (<em>top, bottom, right and left</em>)</code></p>
<p>&#8230;instead of</p>
<p><code> 				margin-top: 0;<br />
margin-right: 0;<br />
margin-bottom: 0;<br />
margin-left: 0 			</code></p>
<p>The above rules also apply to <code>padding</code> and <code>border</code> (see below for more on <code>border</code>).</p>
<h2>Border</h2>
<p>Use:</p>
<p><code>border: 1px black solid</code></p>
<p>&#8230;instead of</p>
<p><code> 				border-width: 1px;<br />
border-color: black;<br />
border-style: solid 			</code></p>
<p>Use:</p>
<p><code>border-right: 1px black solid</code></p>
<p>&#8230;instead of</p>
<p><code> 				border-right-width: 1px;<br />
border-right-color: black;<br />
border-right-style: solid 			</code></p>
<p>(You can substitute right with <code>top</code>, <code>bottom</code> or <code>left</code>.)</p>
<p>The above <acronym title="Cascading Stylesheets">CSS</acronym> shorthand rules can be conveniently combined with the shorthand rules used by margin and padding. Take a look at the following box:</p>
<p><img src="http://www.webcredible.co.uk/i/s.gif" alt="Blank image, with light blue top and left borders, and dark blue bottom and right borders. The top and left borders are slightly thicker" style="border-style: solid; border-color: rgb(204, 204, 255) rgb(51, 51, 102) rgb(51, 51, 102) rgb(204, 204, 255); border-width: 10px 8px 8px 10px; background: #f4f4f4 none repeat scroll 0% 50%; width: 100px; height: 30px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial" /></p>
<p>These borders can be achieved with the following <acronym title="Cascading Stylesheets">CSS</acronym> command:</p>
<p><code> 				border: 8px solid #336;<br />
border-left: 10px solid #ccf;<br />
border-top: 10px solid #ccf 			</code></p>
<p>You can achieve exactly the same effect by using:</p>
<p><code> 				border: 8px solid #336;<br />
border-width: 10px 8px 8px 10px<br />
border-color: #ccf #336 #336 #ccf 			</code></p>
<h2>Conclusion</h2>
<p><acronym title="Cascading Stylesheets">CSS</acronym> shorthand properties are great! They&#8217;re a great way to reduce the amount of code contained in a <acronym title="Cascading Stylesheets">CSS</acronym> document, allowing for faster download times and easier editing. Now who can argue with that?</p>
<p>&#8212;</p>
<p><em>This article was written by Trenton Moss. Trenton&#8217;s crazy about web usability and accessibility &#8211; so crazy that he went and started his own web usability and accessibility consultancy to help make the Internet a better place for everyone. He knows an awful lot about the Disability Discrimination Act and spends much of his time working on the world&#8217;s most accessible CMS. </em></p>

<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace belowboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.programimi.com/2007/09/05/css-shorthand-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tips &#8211; Ten CSS Tricks You May Not Know</title>
		<link>http://www.programimi.com/2007/09/04/quick-tips-ten-css-tricks-you-may-not-know/</link>
		<comments>http://www.programimi.com/2007/09/04/quick-tips-ten-css-tricks-you-may-not-know/#comments</comments>
		<pubDate>Tue, 04 Sep 2007 00:08:01 +0000</pubDate>
		<dc:creator>ProCOM</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WEB]]></category>

		<guid isPermaLink="false">http://www.programimi.com/2007/09/04/quick-tips-ten-css-tricks-you-may-not-know/</guid>
		<description><![CDATA[

1. CSS font shorthand rule
When styling fonts with CSS you may be doing this:
 				font-weight: bold;
font-style: italic;
font-variant: small-caps;
font-size: 1em;
line-height: 1.5em;
font-family: verdana,sans-serif 			
There&#8217;s no need though as you can use this CSS shorthand property:
font: bold italic small-caps 1em/1.5em verdana,sans-serif
Much better! Just a few of words of warning: This CSS shorthand version will only work if you&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace aboveboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>
<h2>1. <acronym title="Cascading Stylesheets">CSS</acronym> font shorthand rule</h2>
<p>When styling fonts with <acronym title="Cascading Stylesheets">CSS</acronym> you may be doing this:</p>
<p><code> 				font-weight: bold;<br />
font-style: italic;<br />
font-variant: small-caps;<br />
font-size: 1em;<br />
line-height: 1.5em;<br />
font-family: verdana,sans-serif 			</code></p>
<p>There&#8217;s no need though as you can use this <acronym title="Cascading Stylesheets">CSS</acronym> shorthand property:</p>
<p><code>font: bold italic small-caps 1em/1.5em verdana,sans-serif</code></p>
<p>Much better! Just a few of <strong>words of warning</strong>: This <acronym title="Cascading Stylesheets">CSS</acronym> shorthand version will only work if you&#8217;re specifying both the <code>font-size</code> and the <code>font-family</code>. The <code>font-family</code> command must always be at the very end of this shorthand command, and <code>font-size</code> must come directly before this. Also, if you don&#8217;t specify the <code>font-weight</code>, <code>font-style</code>, or <code>font-variant</code> then these values will automatically default to a value of <code>normal</code>, so do bear this in mind too.</p>
<h2>2. Two classes together</h2>
<p>Usually attributes are assigned just one class, but this doesn&#8217;t mean that that&#8217;s all you&#8217;re allowed. In reality, <strong>you can assign as many classes as you like</strong>! For example:</p>
<p><code>&lt;p class="text side"&gt;...&lt;/p&gt;</code></p>
<p>Using these two classes together (separated by a space, not with a comma) means that <strong>the paragraph calls up the rules assigned to both <code>text</code> and <code>side</code></strong>. If any rules overlap between the two classes then the class which is below the other in the <acronym title="Cascading Stylesheets">CSS</acronym> document will take precedence.</p>
<h2>3. <acronym title="Cascading Stylesheets">CSS</acronym> border default value</h2>
<p>When writing a border rule you&#8217;ll usually specify the colour, width and style (in any order). For example, <code>border: 3px solid #000</code> will give you a black solid border, 3px thick. However <strong>the only required value here is the border style</strong>.</p>
<p>If you were to write just <code>border: solid</code> then the defaults for that border will be used. But what defaults? Well, the default width for a border is medium (equivalent to about 3 to 4px) and the default colour is that of the text colour within that border. If either of these are what you want for the border then you can leave them out of the <acronym title="Cascading Stylesheets">CSS</acronym> rule!</p>
<h2>4. <acronym title="Cascading Stylesheets">CSS</acronym> document for printing</h2>
<p>Lots of web pages have a link to a print-friendly version. What many of them don&#8217;t realise is that there&#8217;s no need because you can set up a <strong>second <acronym title="Cascading Stylesheets">CSS</acronym> document</strong> to be called up when a user prints the page.</p>
<p>So, your page header should contains links to two <acronym title="Cascading Stylesheets">CSS</acronym> documents, one for the screen, and one for printing:</p>
<p><code> 				&lt;link type="text/css" rel="stylesheet" href="stylesheet.css" <strong>media="screen"</strong> /&gt;<br />
&lt;link type="text/css" rel="stylesheet" href="printstyle.css" <strong>media="print"</strong> /&gt; 			</code></p>
<p>The first line of code calls up the <acronym title="Cascading Stylesheets">CSS</acronym> for the screen (notice the inclusion of <code>media="screen"</code>) and the second line calls up the <acronym title="Cascading Stylesheets">CSS</acronym> for the printable version (using <code>media="print"</code>).</p>
<p>So, what commands should you put in this second <acronym title="Cascading Stylesheets">CSS</acronym> document? To work it out, open a blank document and save it as <code>printstyle.css</code>. Next, point the screen  <acronym title="Cascading Stylesheets">CSS</acronym> command to this document so that the command reads: <code>&lt;link type="text/css" rel="stylesheet" <strong>href="printstyle.css"</strong> media="screen" /&gt;</code>.</p>
<p>Now just keep entering <acronym title="Cascading Stylesheets">CSS</acronym> commands until the display on the screen matches how you want the printed version to look. You&#8217;ll certainly want to make use of the <strong><code>display: none</code> command for navigation, decorative images and non-essential items</strong>. For more advice on this, read <a href="http://www.meyerweb.com/eric/articles/webrev/200001.html">Print Different</a>, which also mentions the other media for which you can specify <acronym title="Cascading Stylesheets">CSS</acronym> files.</p>
<h2>5. Image replacement technique</h2>
<p>It&#8217;s always advisable to use regular <acronym title="Hypertext Markup Language">HTML</acronym> markup to display text, as opposed to an image. Doing so allows for a faster download speed and has accessibility benefits. However, if you&#8217;ve absolutely got your heart set on using a certain font and your site visitors are unlikely to have that font on their computers, then really you&#8217;ve got no choice but to use an image.</p>
<p>Say for example, you wanted the top heading of each page to be ‘Buy widgets’, as you&#8217;re a widget seller and you&#8217;d like to be found for this phrase in the search engines. You&#8217;re pretty set on it being an <strong>obscure font so you need to use an image</strong>:</p>
<p><code>&lt;h1&gt;&lt;img src="widget-image.gif" alt="Buy widgets" /&gt;&lt;/h1&gt;</code></p>
<p>This is OK but there&#8217;s strong evidence to suggest that search engines don&#8217;t assign as much importance to alt text as they do real text (because so many webmasters use the alt text to cram in keywords). So, an alternative would be:</p>
<p><code>&lt;h1&gt;Buy widgets&lt;/h1&gt;</code></p>
<p>Now, this obviously won&#8217;t use your obscure font. To fix this problem place these commands in your <acronym title="Cascading Stylesheets">CSS</acronym> document:</p>
<p><code> 				h1<br />
{<br />
background: url(widget-image.gif) no-repeat;<br />
height: image height<br />
text-indent: -2000px<br />
} 			</code></p>
<p>Be sure to change &#8220;image height&#8221; to whatever the height of the image is (e.g. 85px)! The image, with your fancy font, will now display and the regular text will be safely out of the way, positioned 2000px to the left of the screen thanks to our <acronym title="Cascading Stylesheets">CSS</acronym> rule. Please note, this can cause <strong>accessibility issues</strong> as any user with images turned off won&#8217;t be able to see the text.</p>
<h2>6. <acronym title="Cascading Stylesheets">CSS</acronym> box model hack alternative</h2>
<p>The <a href="http://tantek.com/CSS/Examples/boxmodelhack.html">box model hack</a> is used to fix a rendering problem in pre-<acronym title="Internet Explorer">IE</acronym> 6 browsers on <acronym title="Personal Computer">PC</acronym>, where by the border and padding are <em>included</em> in the width of an element, as opposed to <em>added on</em>. For example, when specifying the dimensions of a container you might use the following <acronym title="Cascading Stylesheets">CSS</acronym> rule:</p>
<p><code> 				#box<br />
{<br />
width: 100px;<br />
border: 5px;<br />
padding: 20px<br />
} 			</code></p>
<p>This <acronym title="Cascading Stylesheets">CSS</acronym> rule would be applied to:</p>
<p><code>&lt;div id="box"&gt;...&lt;/div&gt;</code></p>
<p>This means that the total width of the box is 150px (100px width + two 5px borders + two 20px paddings) in all browsers except pre-<acronym title="Internet Explorer">IE</acronym> 6 versions on <acronym title="Personal Computer">PC</acronym>. In these browsers the total width would be just 100px, with the padding and border widths being incorporated into this width. The <strong>box model hack</strong> can be used to fix this, but this <strong>can get really messy</strong>.</p>
<p>A simple alternative is to use this <acronym title="Cascading Stylesheets">CSS</acronym>:</p>
<p><code> 				#box<br />
{<br />
width: 150px<br />
}</code></p>
<p>#box div<br />
{<br />
border: 5px;<br />
padding: 20px<br />
}</p>
<p>And the new <acronym title="Hypertext Markup Language">HTML</acronym> would be:</p>
<p><code>&lt;div id="box"&gt;<strong>&lt;div&gt;</strong>...<strong>&lt;/div&gt;</strong>&lt;/div&gt;</code></p>
<p>Perfect! Now the box width will always be 150px, regardless of the browser!</p>
<h2>7. Centre aligning a block element</h2>
<p>Say you wanted to have a fixed width layout website, and the content floated in the middle of the screen. You can use the following <acronym title="Cascading Stylesheets">CSS</acronym> command:</p>
<p><code> 				#content<br />
{<br />
width: 700px;<br />
margin: 0 auto<br />
} 			</code></p>
<p>You would then enclose <code>&lt;div id="content"&gt;</code> around every item in the body of the <acronym title="Hypertext Markup Language">HTML</acronym> document and it&#8217;ll be given an automatic margin on both its left and right, ensuring that it&#8217;s always placed in the centre of the screen. Simple&#8230; well not quite &#8211; we&#8217;ve still got the pre-<acronym title="Internet Explorer">IE</acronym> 6 versions on <acronym title="Personal Computer">PC</acronym> to worry about, as these browsers won&#8217;t centre align the element with this <acronym title="Cascading Stylesheets">CSS</acronym> command. You&#8217;ll have to change the <acronym title="Cascading Stylesheets">CSS</acronym> rules:</p>
<p><code> 				body<br />
{<br />
<strong>text-align: center</strong><br />
}</code></p>
<p>#content<br />
{<br />
<strong>text-align: left;</strong><br />
width: 700px;<br />
margin: 0 auto<br />
}</p>
<p>This will then centre align the main content, but it&#8217;ll also centre align the text! To offset the second, probably undesired, effect we inserted <code>text-align: left</code> into the content div.</p>
<h2>8. Vertically aligning with <acronym title="Cascading Stylesheets">CSS</acronym></h2>
<p><strong>Vertically aligning with tables</strong> was a doddle. To make cell content line up in the middle of a cell you would use <code>vertical-align: middle</code>. This <strong>doesn&#8217;t really work with a <acronym title="Cascading Stylesheets">CSS</acronym> layout</strong>. Say you have a navigation menu item whose height is assigned 2em and you insert this vertical align command into the <acronym title="Cascading Stylesheets">CSS</acronym> rule. It basically won&#8217;t make a difference and the text will be pushed to the top of the box.</p>
<p>Hmmm&#8230; not the desired effect. The solution? <strong>Specify the line height to be the same as the height of the box</strong> itself in the <acronym title="Cascading Stylesheets">CSS</acronym>. In this instance, the box is 2em high, so we would insert <code>line-height: 2em</code> into the <acronym title="Cascading Stylesheets">CSS</acronym> rule and the text now floats in the middle of the box &#8211; perfect!</p>
<h2>9. <acronym title="Cascading Stylesheets">CSS</acronym> positioning within a container</h2>
<p>One of the best things about <acronym title="Cascading Stylesheets">CSS</acronym> is that you can position an object absolutely anywhere you want in the document. It&#8217;s also possible (and often desirable) to position objects within a container. It&#8217;s simple to do too. Simply assign the following <acronym title="Cascading Stylesheets">CSS</acronym> rule to the container:</p>
<p><code> 				#container<br />
{<br />
position: relative<br />
} 			</code></p>
<p>Now any element within this container will be positioned relative to it. Say you had this <acronym title="Hypertext Markup Language">HTML</acronym> structure:</p>
<p><code>&lt;div id="container"&gt;&lt;div id="navigation"&gt;...&lt;/div&gt;&lt;/div&gt;</code></p>
<p>To position the navigation exactly 30px from the left and 5px from the top of the container box, you could use these <acronym title="Cascading Stylesheets">CSS</acronym> commands:</p>
<p><code> 				#navigation<br />
{<br />
position: absolute;<br />
left: 30px;<br />
top: 5px<br />
} 			</code></p>
<p>Perfect! In this particular example, you could of course also use <code>margin: 5px 0 0 30px</code>, but there are some cases where it&#8217;s preferable to use positioning.</p>
<h2>10. Background colour running to the screen bottom</h2>
<p>One of the disadvantages of <acronym title="Cascading Stylesheets">CSS</acronym> is its inability to be controlled vertically, causing one particular problem which a table layout doesn&#8217;t suffer from. Say you have a column running down the left side of the page, which contains site navigation. The page has a white background, but you want this <strong>left column to have a blue background</strong>. Simple, you assign it the appropriate <acronym title="Cascading Stylesheets">CSS</acronym> rule:</p>
<p><code> 				#navigation<br />
{<br />
background: blue;<br />
width: 150px<br />
} 			</code></p>
<p>Just one problem though: Because the navigation items don&#8217;t continue all the way to the bottom of the screen, neither does the background colour. The <strong>blue background colour is being cut off half way down the page</strong>, ruining your great design. What can you do!?</p>
<p>Unfortunately one of the only solutions to this is to cheat, and assign the body a background image of exactly the same colour and width as the left column. You would use this <acronym title="Cascading Stylesheets">CSS</acronym> command:</p>
<p><code> 				body<br />
{<br />
background: url(blue-image.gif) 0 0 repeat-y<br />
} 			</code></p>
<p><strong>This image</strong> that you place in the background should be <strong>exactly 150px wide</strong> and the <strong>same blue colour</strong> as the background of the left column. The disadvantage of using this method is that you can&#8217;t express the left column in terms of em, as if the user resizes text and the column expands, it&#8217;s background colour won&#8217;t.</p>
<p>Using this method the left column will have to be expressed in px if you want it to have a different background colour to the rest of the page.</p>
<p>&#8212;</p>
<p><em>This article was written by Trenton Moss. Trenton&#8217;s crazy about web usability and accessibility &#8211; so crazy that he went and started his own web usability and accessibility consultancy to help make the Internet a better place for everyone. He knows an awful lot about the Disability Discrimination Act and spends much of his time working on the world&#8217;s most accessible CMS.</em></p>

<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace belowboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.programimi.com/2007/09/04/quick-tips-ten-css-tricks-you-may-not-know/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Print stylesheet &#8211; the definitive guide</title>
		<link>http://www.programimi.com/2007/09/04/print-stylesheet-the-definitive-guide/</link>
		<comments>http://www.programimi.com/2007/09/04/print-stylesheet-the-definitive-guide/#comments</comments>
		<pubDate>Mon, 03 Sep 2007 23:47:39 +0000</pubDate>
		<dc:creator>ProCOM</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WEB]]></category>

		<guid isPermaLink="false">http://www.programimi.com/2007/09/04/print-stylesheet-the-definitive-guide/</guid>
		<description><![CDATA[

A print stylesheet formats a web page so when printed, it automatically prints in a user-friendly format. Print stylesheets have been around for a number of years and have been written about a lot. Yet so few websites implement them, meaning we&#8217;re left with web pages that frustratingly don&#8217;t properly print on to paper.
It&#8217;s remarkable [...]]]></description>
			<content:encoded><![CDATA[<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace aboveboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>
<p>A print stylesheet formats a web page so when printed, it automatically prints in a user-friendly format. Print stylesheets have been around for a number of years and have been written about a lot. Yet so few websites implement them, meaning we&#8217;re left with web pages that frustratingly don&#8217;t properly print on to paper.</p>
<p>It&#8217;s remarkable that so few websites use print stylesheets as:</p>
<ul>
<li>Print stylesheets enormously <strong>improve usability</strong>, especially for pages with a lot of content (such as this one!)</li>
<li>They&#8217;re phenomenally quick and <strong>easy to set up</strong></li>
</ul>
<p>Some websites do offer a link to a print-friendly version of the page, but this of course needs to be set up and maintained. It also requires that users notice this link on the screen, and then use it ahead of the regular way they print pages (e.g. by selecting the print button at the top of the screen). Print-friendly versions are however useful when printing a number of web pages at the same time such as an article that spans on to several web pages.</p>
<p><strong>How to set up your print stylesheet</strong></p>
<p>A print stylesheet works in much the same way as a regular stylesheet, except it only gets called up when the page is printed. To make it work, the following needs to be inserted into the top of every web page:</p>
<p><code>&lt;link rel="stylesheet" href="print.css" type="text/css" <strong>media="print"</strong> /&gt;</code></p>
<p>The file, <code>print.css</code> is the print stylesheet, and the <code>media="print"</code> command means that this CSS file only gets called up when web pages are printed. (There are many different media you can use for stylesheets, such as for handheld, TV, projection etc. &#8211; see a <a href="http://www.w3.org/TR/REC-CSS2/media.html">full list of media types</a> for more.)</p>
<p><strong>What to put in your print stylesheet</strong></p>
<p>The CSS commands in the print stylesheet essentially <strong>override the CSS commands in the main stylesheet</strong>. As such, the only commands you need to put in the print stylesheet are ones to override the CSS commands in the main stylesheet. This means you don&#8217;t need to repeat any colour or branding CSS commands as they&#8217;ll already be taken from the main stylesheet.</p>
<p>Generally speaking, you&#8217;ll want your print stylesheet to make the following happen when users hit that print button:</p>
<p><strong>Remove unwanted items</strong></p>
<p>Usually it&#8217;s just your organisation logo and page content that you&#8217;ll want to appear on the printed version of the web page. You&#8217;ll normally want to <strong>remove the header, left column and right column</strong>. You may also want to remove the footer (or some of it) from the printed version, unless it contains your contact details.</p>
<p>There may be certain isolated items you&#8217;d prefer weren&#8217;t printed so you can simply assign these <code>class="noprint"</code> in the HTML. To get rid of these items, along with the header and navigation (assuming these are assigned <code>&lt;div id="header"&gt;</code> and <code>&lt;div id="nav"&gt;</code>) use the <code>display: none</code> command:</p>
<p><code>#header, #nav, .noprint {display: none;}</code></p>
<p>You may also want to remove certain images and adverts, especially animated images as these won&#8217;t make sense when printed.</p>
<p><strong>Format the page</strong></p>
<p>There&#8217;s nothing worse than printing off a web page to find the last few words of each line cut off. It&#8217;s also annoying (and a waste of paper) when the left and right columns are left in, leaving a very narrow space for the content so the web page prints on to 15 pieces of paper.</p>
<p>Generally speaking, the three CSS commands you&#8217;ll need are:</p>
<p><code>width: 100%; margin: 0; float: none;</code></p>
<p>These commands should be applied to any containing elements (<code>&lt;div&gt;</code>s for a CSS layout and <code>&lt;table&gt;</code>s for table layouts) to ensure the <strong>content spans the full width of the paper</strong>. So, the full CSS command would perhaps be something like:</p>
<p><code>#container, #container2, #content {width: 100%; margin: 0; float: none;}</code></p>
<p><strong>Change the font?</strong></p>
<p>Some print stylesheets do change the font size (often to 12pt) but this <strong>isn&#8217;t generally a very good idea</strong>. If users increase text size on the screen then the text will print in this larger font size&#8230; unless you specify a fixed font size in the print stylesheet.</p>
<p>Other print stylesheets change the font family to a serif font (such as Times New Roman) as this is slightly easier to read from print. Whether you choose to do this or not is up to you as users may be a bit surprised to see a different font printed out.</p>
<p>Do also bear in mind that background images and colours don&#8217;t print out by default. As such, you may wish to change the colour of text in a light colour so it has a reasonable colour contrast without its background.</p>
<p><strong>Links</strong></p>
<p>Print-outs are often in black and white so do make sure that links have a decent colour contrast. If not, assign links a slightly darker colour in the print out. For example:</p>
<p><code>a:link, a:visited {color: #781351}</code></p>
<p>For bonus usability you could include a footnote on the page <strong>listing all the URLs from that page</strong>, with each link referencing its URL underneath with a number. It&#8217;s otherwise impossible to know where a link is pointing to when reading a print out from a web page. See this <a href="http://www.programimi.com/2007/09/04/print-stylesheet-the-definitive-guide/print/" target="_blank">working example</a> and find out how to do this by reading this <a href="http://alistapart.com/articles/improvingprint">Improving link display for print</a> article.</p>
<p><strong>Making the print stylesheet</strong></p>
<p>When making the print stylesheet place the print CSS commands into the bottom of your main CSS file. As you keep adding more commands check how your web pages look on the computer screen (don&#8217;t do this on a live website!). Keep adding commands until you&#8217;re happy with the appearance, then cut these commands out of the main CSS file and paste into the print stylesheet.</p>
<p>To summarise, your print stylesheet may look similar to this:</p>
<p><code> 			/* Remove unwanted elements */<br />
#header, #nav, .noprint<br />
{<br />
display: none;<br />
}</code></p>
<p>/* Ensure the content spans the full width */<br />
#container, #container2, #content<br />
{<br />
width: 100%; margin: 0; float: none;<br />
}</p>
<p>/* Change text colour to black (useful for light text on a dark background) */<br />
.lighttext<br />
{<br />
color: #000<br />
}</p>
<p>/* Improve colour contrast of links */<br />
a:link, a:visited<br />
{<br />
color: #781351<br />
}<br />
You&#8217;ve now got a print stylesheet! For something this quick and easy to set up that improves usability as much as it does, you&#8217;d be mad not to use one!</p>
<p>&#8212;</p>
<p><em>This article was written by Trenton Moss. Trenton&#8217;s crazy about web usability and accessibility &#8211; so crazy that he went and started his own web usability and accessibility consultancy to help make the Internet a better place for everyone. He knows an awful lot about the Disability Discrimination Act and spends much of his time working on the world&#8217;s most accessible CMS. </em></p>

<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace belowboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.programimi.com/2007/09/04/print-stylesheet-the-definitive-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS hacks &amp; browser detection</title>
		<link>http://www.programimi.com/2007/09/04/css-hacks-browser-detection/</link>
		<comments>http://www.programimi.com/2007/09/04/css-hacks-browser-detection/#comments</comments>
		<pubDate>Mon, 03 Sep 2007 23:31:03 +0000</pubDate>
		<dc:creator>ProCOM</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WEB]]></category>

		<guid isPermaLink="false">http://www.programimi.com/2007/09/04/css-hacks-browser-detection/</guid>
		<description><![CDATA[

More and more web developers are ditching tables and coming round to the idea of using CSS to control the layout of their site. With the many benefits of using CSS, such as quicker download time, improved accessibility and easier site management, why not?
The problem with CSS
Historically the main problem with using CSS has been [...]]]></description>
			<content:encoded><![CDATA[<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace aboveboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>
<p>More and more web developers are ditching tables and coming round to the idea of using CSS to control the layout of their site. With the many benefits of using CSS, such as quicker download time, improved accessibility and easier site management, why not?</p>
<p><strong>The problem with CSS</strong></p>
<p>Historically the main problem with using CSS has been lack of browser support. This is no longer the case as version 5 browsers, which all have good support for CSS, now account for over 99% of browsers in use.</p>
<p>Instead, the problem is that <strong>browsers can sometimes interpret CSS commands in different ways</strong>, causing developers to throw their arms up in the air and switch back to pixel-perfect table layouts. Fear not though, as you learn more about CSS you&#8217;ll gradually start to understand the different browser interpretations and realise that there aren&#8217;t really that many.</p>
<p><strong>How browser detection using CSS hacks works</strong></p>
<p>The way browser detection using <acronym title="Cascading Stylesheets">CSS</acronym> hacks works is to send one <acronym title="Cascading Stylesheets">CSS</acronym> rule to the browser(s) you&#8217;re trying to trick, and then send a second <acronym title="Cascading Stylesheets">CSS</acronym> rule to the other browsers, overriding this first command. If you have two <acronym title="Cascading Stylesheets">CSS</acronym> rules with identical selectors then <strong>the second <acronym title="Cascading Stylesheets">CSS</acronym> rule will always take precedence</strong>.</p>
<p>Say for example you wanted the space between your header area and the content to have a gap of 25px in Internet Explorer, or <acronym title="Internet Explorer">IE</acronym> as it&#8217;s affectionately known. This gap looks good in <acronym title="Internet Explorer">IE</acronym> but in Firefox, Opera and Safari the gap is huge and a 10px gap looks far better. To achieve this <strong>perfect look in all these browsers</strong> you would need the following two <acronym title="Cascading Stylesheets">CSS</acronym> rules:</p>
<p><code> 				#header {margin-bottom: 25px;}<br />
#header {margin-bottom: 10px;} 			</code></p>
<p>The <strong>first command is intended for <acronym title="Internet Explorer">IE</acronym>, the second for all other browsers</strong>. How does this work? Well, it won&#8217;t at the moment because <em>all</em> browsers can understand <em>both</em> <acronym title="Cascading Stylesheets">CSS</acronym> rules so will use the second <acronym title="Cascading Stylesheets">CSS</acronym> rule because it comes after the first one.</p>
<p>By inserting a <acronym title="Cascading Stylesheets">CSS</acronym> hack we can perform our browser detection by hiding the second <acronym title="Cascading Stylesheets">CSS</acronym> rule from <acronym title="Internet Explorer">IE</acronym>. This means that <acronym title="Internet Explorer">IE</acronym> won&#8217;t even know it exists and will therefore use the first <acronym title="Cascading Stylesheets">CSS</acronym> rule. How do we do this? Read on and find out!</p>
<p><strong>Browser detection for Internet Explorer</strong></p>
<p>To send different <acronym title="Cascading Stylesheets">CSS</acronym> rules to <acronym title="Internet Explorer">IE</acronym>, we can use the <strong>child selector command</strong> which <acronym title="Internet Explorer">IE</acronym> can&#8217;t understand. The child selector command involves two elements, one of which is the child of the other. So, <code>html&gt;body</code> refers to the child, <code>body</code>, contained within the parent, <code>html</code>.</p>
<p>Using the example of the header margin, our <acronym title="Cascading Stylesheets">CSS</acronym> command would be:</p>
<p><code> 				#header {margin-bottom: 3em;}<br />
<strong>html&gt;body</strong> #header {margin-bottom: 1em;} 			</code></p>
<p><acronym title="Internet Explorer">IE</acronym> can&#8217;t understand the second <acronym title="Cascading Stylesheets">CSS</acronym> rule due to the <code>html&gt;body</code> <acronym title="Cascading Stylesheets">CSS</acronym> command so will ignore it and use the first rule. All other browsers will use the second rule.</p>
<p><strong>Browser detection for Internet Explorer 5</strong></p>
<p>It may seem strange at first to send different <acronym title="Cascading Stylesheets">CSS</acronym> rules to different versions of a browser, but in the case of <acronym title="Internet Explorer">IE</acronym>5 it&#8217;s very necessary. This is due to <acronym title="Internet Explorer">IE</acronym>5&#8217;s misinterpretation of the box model. When specifying the width of an element in <acronym title="Cascading Stylesheets">CSS</acronym>, padding and borders aren&#8217;t included in this value. <acronym title="Internet Explorer">IE</acronym>5 however, incoporates these values into the width value causing <strong>element widths to become smaller in this browser</strong>.</p>
<p>The following <acronym title="Cascading Stylesheets">CSS</acronym> rule would result in a width of 10em for all browsers, except <acronym title="Internet Explorer">IE</acronym>5 which would give it a width of just 5em (<acronym title="Internet Explorer">IE</acronym>5 would incorporate two sets of padding and border, on both the left and right, when calculating the width):</p>
<p><code>#header {padding: 2em; border: 0.5em; width: 10em;}</code></p>
<p>The <strong>solution to this problem</strong>? Perform browser detection and send a different <acronym title="Cascading Stylesheets">CSS</acronym> rule to <acronym title="Internet Explorer">IE</acronym>5:</p>
<p><code> 				#header {padding: 2em; border: 0.5em; <strong>width: 15em; width/**/:/**/ 10em;</strong>} 			</code></p>
<p><acronym title="Internet Explorer">IE</acronym>5 will use the first width value of 15em, 5em of which will be taken up by the two sets of padding and border (one each for the left and for the right). This would ultimately give the element a width of 10em in <acronym title="Internet Explorer">IE</acronym>5.</p>
<p>The 15em value will then be <strong>overridden by the second width value of 10em by all browsers except <acronym title="Internet Explorer">IE</acronym>5</strong>, which for some reason can&#8217;t understand <acronym title="Cascading Stylesheets">CSS</acronym> commands with empty comment tags either side of the colons. It doesn&#8217;t look pretty but it does work!</p>
<p><strong>Browser detection for Internet Explorer on the Mac</strong></p>
<p>Quite simply, <acronym title="Internet Explorer">IE</acronym> on the Mac does strange things with <acronym title="Cascading Stylesheets">CSS</acronym>. The browser&#8217;s become somewhat obsolete as Microsoft aren&#8217;t going to be bringing out an updated version. As such, many web developers code their <acronym title="Cascading Stylesheets">CSS</acronym>-driven sites so that the site works in <acronym title="Internet Explorer">IE</acronym>/Mac, although it <strong>may not offer the same level of advanced functionality or design</strong>. Provided <acronym title="Internet Explorer">IE</acronym>/Mac users can access all areas of the site this is seen as a suitable way of doing things.</p>
<p>To hide a command using the <a href="http://www.sam-i-am.com/work/sandbox/css/mac_ie5_hack.html" target="_blank">IE/Mac CSS hack</a> is simple, and involves wrapping a set of dashes and stars around as many CSS rules as you like:</p>
<p><code> 				<strong>/* Hide from IE-Mac \*/</strong><br />
#header {margin-bottom: 3em;}<br />
#footer {margin-top: 1.5em;}<br />
/* End hide */ 			</code></p>
<p><acronym title="Internet Explorer">IE</acronym>/Mac will simply ignore all these commands. This <acronym title="Cascading Stylesheets">CSS</acronym> hack can actually be quite useful if there&#8217;s a certain area of the site not working properly in <acronym title="Internet Explorer">IE</acronym>/Mac. If that section isn&#8217;t fundamental to being able to use the site, you can simply hide it from <acronym title="Internet Explorer">IE</acronym>/Mac like so:</p>
<p><code> 				#noiemac {display: none}</p>
<p>/* Hide from IE-Mac \*/<br />
#noiemac {display: block;}<br />
/* End hide */ 			</code></p>
<p>The first <acronym title="Cascading Stylesheets">CSS</acronym> rule hides the entire section assigned the noiemac id (i.e. <code>&lt;div id="noiemac"&gt;</code>). The second <acronym title="Cascading Stylesheets">CSS</acronym> rule, which <acronym title="Internet Explorer">IE</acronym>/Mac can&#8217;t see, displays this section.</p>
<p><strong>Browser detection for IE 4 and Netscape 4</strong></p>
<p>Version 4 browsers have limited and somewhat erratic support for <acronym title="Cascading Stylesheets">CSS</acronym>. Making a <acronym title="Cascading Stylesheets">CSS</acronym> layout in these browsers, whose market share has now slipped well below 1%, can be extremely challenging. It&#8217;s become common practice nowadays to completely hide the <acronym title="Cascading Stylesheets">CSS</acronym> file from version 4 and earlier browsers. This can be achieved using the @import directive to call up the <acronym title="Cascading Stylesheets">CSS</acronym> document:</p>
<p><code>&lt;style type="text/css"&gt;@import "styles.css";&lt;/style&gt;</code></p>
<p><strong>Version 4 (and earlier) browsers will display a non-styled version of the site</strong> as they can&#8217;t understand this @import directive.</p>
<p><strong>Checking your site in the different browsers</strong></p>
<p>At the time of writing, the major Internet browsers include <acronym title="Internet Explorer">IE</acronym>5, <acronym title="Internet Explorer">IE</acronym>6, Firefox, Opera and Safari. (Check out <a href="http://www.thecounter.com/stats/">TheCounter.com</a> for up-to-date browser statistics.) You can download all these browsers, and a number of more obscure ones, at the <a href="http://browsers.evolt.org/">Evolt browser archive</a>.</p>
<p>Ideally you should check your site in all these browsers, on <strong>both <acronym title="Personal Computer">PC</acronym> and Mac</strong> (except <acronym title="Internet Explorer">IE</acronym>6 and Safari, which are only available on <acronym title="Personal Computer">PC</acronym> and Mac respectively). If you don&#8217;t have access to a Mac you can get a screenshot of your site on Safari by running it through Dan Vine&#8217;s <a href="http://www.danvine.com/icapture/">iCapture</a> or you can pay to use <a href="http://www.browsercam.com/">Browsercam</a> which offers a more extensive screen capturing service.</p>
<p><strong>Conclusion</strong></p>
<p>On the whole, modern browsers have very good support for <acronym title="Cascading Stylesheets">CSS</acronym> &#8211; certainly good enough for you to be using <acronym title="Cascading Stylesheets">CSS</acronym> to control layout and presentation. Sometimes however, certain page elements will appear differently in different browsers. Don&#8217;t worry too much if you don&#8217;t know the reason why &#8211; if you can fix it up with these <acronym title="Cascading Stylesheets">CSS</acronym> hacks then your web pages should look great across all browsers!</p>
<p>&#8212;</p>
<p><em>This article was written by Trenton Moss. Trenton&#8217;s crazy about web usability and accessibility &#8211; so crazy that he went and started his own <a href="http://www.webcredible.co.uk/">web usability and accessibility consultancy</a> to help make the Internet a better place for everyone. He knows an awful lot about the <a href="http://www.webcredible.co.uk/user-friendly-resources/web-accessibility/uk-website-legal-requirements.shtml">Disability Discrimination Act</a> and spends much of his time working on the world&#8217;s most <a href="http://www.webcredible.co.uk/services/accessible-cms.shtml">accessible <acronym title="Content management system">CMS</acronym></a>. </em></p>

<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace belowboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.programimi.com/2007/09/04/css-hacks-browser-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Resources Digest</title>
		<link>http://www.programimi.com/2007/08/31/css-resources-digest/</link>
		<comments>http://www.programimi.com/2007/08/31/css-resources-digest/#comments</comments>
		<pubDate>Fri, 31 Aug 2007 10:46:02 +0000</pubDate>
		<dc:creator>ProCOM</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Digest Dump]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WEB]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Resources]]></category>

		<guid isPermaLink="false">http://www.programimi.com/2007/08/31/css-resources-digest/</guid>
		<description><![CDATA[

Specs, primers, validators, stuff like that
The CSShark Answers FAQs — Martina Kosloff has compiled a pretty good FAQ on CSS. Worth your time.
css/edge — From the mind of Eric Meyer comes this great little site pushing CSS to the edge. It is, in his words: &#8220;intended, first and foremost, to be as relentlessly creative with [...]]]></description>
			<content:encoded><![CDATA[<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace aboveboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>
<p>Specs, primers, validators, stuff like that</p>
<p><a href="http://www.mako4css.com/" class="sitelinksorange">The CSShark Answers FAQs</a> — Martina Kosloff has compiled a pretty good FAQ on CSS. Worth your time.</p>
<p><a href="http://www.meyerweb.com/eric/css/edge/" class="sitelinksorange">css/edge</a> — From the mind of Eric Meyer comes this great little site pushing CSS to the edge. It is, in his words: &#8220;intended, first and foremost, to be as relentlessly creative with CSS as we have been practical all these years. It does <strong>not</strong> exist to present or explain safe cross-browser techniques; in fact, almost the opposite. The goal here is to find ways to make CSS live up to its fullest potential, with only minimal regard to browser limitations.&#8221;</p>
<p><a href="http://www.websitetips.com/css/index.shtml" class="sitelinksorange">websitetips.com CSS section</a> — Literally a ton of links to CSS resources from all over. A better set of links than this one by far.</p>
<p><a href="http://style.webreview.com/" class="sitelinksorange">Style Sheet Reference Guide</a> from webreview.com. — Eric Meyer&#8217;s excellent resource, including the justly famous browser compatibility charts. It&#8217;s a bit dated (I wish it included Opera 5 and more of CSS2) but still an excellent resource.</p>
<p><a href="http://www.w3schools.com/css/" class="sitelinksorange">CSS School</a> from w3schools.com. — A whole lot of information, references, and examples.</p>
<p><a href="http://www.w3.org/TR/REC-CSS1" class="sitelinksorange">Cascading Style Sheets, level 1 Recommendation</a> from the Web Design Group. — This is the spec (really a rec) folks; can be very helpful if you learn how to read it.</p>
<p><a href="http://jigsaw.w3.org/css-validator/" class="sitelinksorange">W3C CSS Validation Service</a> — Download a CSS validating app, give it a URL, or cut and paste your CSS here for the ultimate in CSS Validation services.</p>
<p><a href="http://www.bluerobot.com/web/layouts/" class="sitelinksorange">The Layout Reservoir</a> from BlueRobot. — A resource much like this page with beautiful CSS layouts for you to steal.</p>
<p><a href="http://style.cleverchimp.com/" class="sitelinksorange">Agitprop</a> — Todd Fahrner&#8217;s collection of CSS writings, tests, and treatises. Good stuff.</p>
<p><a href="http://css.nu/" class="sitelinksorange">CSS Pointers Group</a> — A great resource full of information and links to other resources on CSS. Some of it is a bit dated (but what isn&#8217;t in today&#8217;s modern age?), and they are all <a href="http://www.css.nu/examples/css-columns.html" class="sitelinksorange">down on multi column layouts</a>, but still a must visit.</p>
<p><a href="http://www.meyerweb.com/eric/css/" class="sitelinksorange">Eric Meyer&#8217;s CSS work</a> — The author of the O&#8217;Reilly CSS Definitive Guide, Eric has done an amazing amount of writing and work on CSS. One highlight: his frame set views of the W3C&#8217;s <a href="http://www.meyerweb.com/eric/css/references/index.html" class="sitelinksorange">CSS references</a>.</p>

<!-- Chitika|Premium - WordPress Plugin --><div class="chitika-adspace belowboth"><script type="text/javascript"><!--
ch_client = "procom";
ch_type = "mpu";
ch_width = 550;
ch_height = 120;
ch_color_bg = "";
ch_color_title = "8F0222";
ch_color_site_link = "8F0222";
ch_color_text = "";
ch_non_contextual = 4;
ch_vertical = "premium";
ch_font_title = "";
ch_font_text = "";
ch_sid = "procom";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.programimi.com/2007/08/31/css-resources-digest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
