13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

858 Chapter 34 Building <strong>Web</strong> 2.0 Applications with Ajax<br />

by the browser.The developer will have used a bit of JavaScript that sets the CSS attribute<br />

for visibility to visible or not, depending on the actions of the user’s mouse. In an<br />

Ajax-enabled site, it is likely that the area reserved for Section 1 or Section 2 text will be<br />

filled based on the result of a remote scripting call to the server while the rest of the site<br />

remains static.<br />

The Extensible Hypertext Markup Language, or XHTML, functions similarly to<br />

HTML <strong>and</strong> DHTML in that all three are used to mark up content for display via a<br />

client device (web browser, phone, other h<strong>and</strong>held device) <strong>and</strong> allow for the integration<br />

of CSS for additional control of the presentation.The differences between XHTML <strong>and</strong><br />

HTML include the manner in which XHTML conforms to XML syntax <strong>and</strong> the manner<br />

in which XHTML can be interpreted by XML tools in addition to the st<strong>and</strong>ard<br />

web-browsing tools.<br />

XHTML is written entirely in lowercase for elements (for example, <br />

instead of ) <strong>and</strong> attributes (for example, href instead of HREF).<br />

Additionally, all attribute values must be enclosed in either single or double quotation<br />

marks, <strong>and</strong> all elements must be explicitly closed—either by the end tag in a tag pair or<br />

in singleton elements such as the tag or tag.<br />

For more information on XHTML, see http://www.w3.org/TR/xhtml1/.<br />

Cascading Style Sheets (CSS)<br />

Cascading Style Sheets (CSS) are used to further refine the display of static, dynamic, <strong>and</strong><br />

Ajax-enabled pages. Using CSS allows the developer to change the definition of a tag,<br />

class, or ID within one document (the style sheet) <strong>and</strong> have the changes take effect<br />

immediately in all pages that link to that style sheet.These definitions, or rules, follow a<br />

specific format using selectors, declarations, <strong>and</strong> values.<br />

n Selectors are the names of HTML tags, such as body or h1 (heading level 1).<br />

n Declarations are the style sheet properties themselves, such as background or<br />

font-size.<br />

n Values are given to declarations, such as white or 12pt.<br />

Thus, the following is a style sheet entry that defines the body of a document as white,<br />

<strong>and</strong> all text in the document as a normal weight, 12 point,Verdana, or sans-serif font:<br />

body {<br />

background: white [or #fff or #ffffff];<br />

font-family: Verdana, sans-serif;<br />

font-size: 12pt;<br />

font-weight: normal;<br />

}<br />

These values will be in effect for the page until an element is rendered that has its own<br />

style defined in the style sheet. For instance, when an h1 is encountered, the client will

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!