Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Check the rendering mode

Quirks mode in IE 6 and IE 7

In IE address line, type in:

javascript:alert(document.compatMode)


And here is the rest of it.

Read more!

hackIE

<!--[if gt IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie7fix.css" media="screen" />

<![endif]-->
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie6fix.css" media="screen" /> 

<![endif]-->


<script language="Javascript" >

    var useragent = navigator.userAgent;
    var bName = (useragent.indexOf('Firefox') > -1) ? 'Firefox' :
navigator.appName;


    if (bName == "Firefox") 
    {
        
        document.writeln('<style> #nav_bar_t6 {padding-left:33px;
padding-right:33px; } #footer {margin-left:18%}</style>');
    }

    if(navigator.userAgent.indexOf ("Netscape")!=-1)
    {
        
        document.writeln('<style> #nav_bar_t4 {WIDTH:
14.2%;padding-left:2px;} #footer {margin-left:18%}</style>');
    }
    
    if(navigator.userAgent.indexOf ("Opera")!=-1)
    {
        document.writeln('<style> #nav_bar_t6 {padding-left:38px;
padding-right:33px;} #footer {margin-left:18%}</style>');
    }
</script>



Read more!
BlueTrip CSS Framework

A full featured and beautiful CSS (Cascading Style Sheets) framework which combined the best of Blueprint, Tripoli (hence the name), Hartija's print stylesheet, 960.gs's simplicity, and Elements' icons, and has now found a life of its own.
What Can BlueTrip Do For You?

BlueTrip gives you a sensible set of styles and a common way to build a website so that you can skip past the grunt work and get right to designing.

Download the package, include the images and stylesheets in your site structure, and get going!

http://bluetrip.org/

BlueTrip CSS Framework

A full featured and beautiful CSS (Cascading Style Sheets) framework which combined the best of Blueprint, Tripoli (hence the name), Hartija's print stylesheet, 960.gs's simplicity, and Elements' icons, and has now found a life of its own.
What Can BlueTrip Do For You?

BlueTrip gives you a sensible set of styles and a common way to build a website so that you can skip past the grunt work and get right to designing.

Download the package, include the images and stylesheets in your site structure, and get going!


Read more!

DTD - The Document Type Declaration

A DTD is a Document Type Definition, also know as DOCTYPE. In a document served as text/html, the DOCTYPE informs the browswer how to interpret the content of the page.

If the the doctype is not declared, the browser assumes you don’t know how to code, and goes into "quirks mode". If you know what you are doing and include a correct XHTML DOCTYPE, your page will be rendered in "standards mode".




A DTD is a Document Type Definition, also know as DOCTYPE. In a document served as text/html, the DOCTYPE informs the browswer how to interpret the content of the page.

If the the doctype is not declared, the browser assumes you don’t know how to code, and goes into "quirks mode". If you know what you are doing and include a correct XHTML DOCTYPE, your page will be rendered in "standards mode".


All of the above declarations will inform the browser to render the browser in standards mode. When authoring document is HTML or XHTML, it is important to Add a Doctype declaration. The declaration must be exact — both in spelling and in case. And, the URL must be included. If not, you risk having your page rendered in quirks mode. A list of the DTD’s and how browsers handle them can be found at http://hsivonen.iki.fi/doctype/

There are other DTD’s, such as for MathML and "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd"> for mobile. A list of valid DTDs is maintained at http://www.w3.org/QA/2002/04/valid-dtd-list.html

The XML declaration for XHTML web pages of is optional. Older browsers such as IE5 for the Mac choke on this. And, if you include it, IE6 renders in quirks mode, but IE7 renders in standards. So, for now, omit it. But, if you do include it, it must be the very first line, before the DTD


Why is quirks mode bad? Ever code a page and have the font inside your data tables be huge? That’s because in quirks mode browsers render td’s based on the browser default, not on the declared body default size. The box model is rendered differently and images as block instead of inline.

Why are DTD’s good? In addition to everything above, a DTD enables you to have valid code. To test validity, a page is compare to the rules for that document type. If you don’t have rules, how do you compare it? The DTD tells the validator what rules to use.

What is the difference between strict and transitional? Transitional allows depreciated tags and attributes to pass validation. The strict doctype is strict: depreciated tags and attributes will fail to validate under a strict doctype and may well display incorrectly as well. See Comparing XHTML and HTML, Strict and Transitional and Deprecated Elements and Attributes.

What does PUBLIC mean? In the above DOCTYPEs, all of them include the term "PUBLIC". If you are creating your own DTD then put your DTD on your sever and include the term "SYSTEM" with the path to your DTD file. On the other hand, if you are using PUBLIC DTD’s, such as those listed above, and the public identifier which starts with -//.

Read more!