Search

3/25/2009

» Web Developer Resume Screening :: CSS, JavaScript and XHTML Explained

» Web Developer Resume Screening :: CSS, JavaScript and XHTML Explained

Run-in should make the run-in element be the first line of the next sibling block level element, if it is before a block level element that is not floated or absolutely positioned. If the next sibling is positioned or floated, then the run-in element will be a block level element instead of appearing in-line.

IE treats a position like a z-index reset, so you have to declare position of static on the parent element containing the z-indexed elements to have them responsd to z-index correctly.

» XHTML v. HTML, Strict v. Transitional :: CSS, JavaScript and XHTML Explained
The difference between strict and transitional XHTML:
Transitional is a forgiving form of doctype.While you must code cleanly — properly nested lowercase tags — transitional allows deprecated elements and attributes to pass validation. The strict doctype is strict: deprecated elements and attributes will fail to validate under a strict doctype and may well display incorrectly as well.

For example, <p align="left"> and <center> will validate in transitional, but not in strict mode since the align attribute and the <center> element are both deprecated.

In XHTML, the elements need to be coded in a semantic manner. Tables and forms can not be included in paragraphs, but form elements, being inline elements, need to be contained within a semantic block level element, such as a paragraph or table cell.

» XHTML Deprecated Elements and Attributes :: CSS, JavaScript and XHTML Explained
target a

» CSS Best Practices :: CSS, JavaScript and XHTML Explained
* Specify units for non-zero values, but not for zero values.
* Don’t use quotation marks around paths/URLs when setting a background image or loading in an imported file
* Try to avoid applying padding/borders and a fixed width to an element. Rather, apply padding to the parent element.
- Because of IE 6 (and lower) box-model issues, if you apply padding to the parent element instead of the child element, IE will render the same as standards compliant browsers.
* Don’t use anchors, instead use ID’s.
- Less code with multi-purpose code. Instead of using <a name=”anchor”> give an id to the parent of where that anchor would fall. All ID’s need to be unique, but so do the named anchors, so you are actually saving code and avoiding the pitfall of the effects of a a:hover defined for actual links
* Sandbox your style declarations
- Limit the “reach” of style declarations by pre-pending the class name, such as #maincontent p{}.
* Organize your CSS file
- Start with clearing all default values, as mentioned above: this will reduce redundancy. Follow this by global styles. Lastly include section specific styles. For example, declare default element values. Next create sections of code for each section of your document. Next come the content sections which I generally divide into #header, #navigation, #maincontent and #footer. Include all the layout for the various elements for each of these id’s that are site global within each section

» DTD - The Document Type Declaration :: CSS, JavaScript and XHTML Explained

沒有留言: