![]() |
Cascading Style Sheets![]() ![]() ![]() ![]() ![]()
Style sheet information is also part of the DOM. After defining style sheet or adding an in line style, you can view and alter any of the myriad of attributes that control its appearance.
Unlike Dynamic HTML and the Document Object Model, cascading style sheets exists as a real and accepted standard on the World Wide Web. Style sheets are in their first version accepted by the World Wide Web Consortium, and the standard is referred to as Cascading Style Sheet I (CSS1 ). You use style sheets to control how HTML tags are formatted. The word 11 cascading" means that multiple styles can be used in an individual HTML page, and the browser will follow an order called a cascade to interpret the information. Style Control With Style Sheets The World Wide Web Consortium has released a definitive standard for style sheets, which is now reflected in Microsoft Internet Explorer 3.0 and later, and Netscape Navigator 4.0 and later. There are three primary ways to use style sheets: Inline Style Sheets This approach exploits existing HTML tags within a standard HTML document and adds a specific style to the information controlled by those tags. An example would be controlling the indentation of a single paragraph using the style= "someStyle" attribute within the <P> tag. Another method of achieving this is by combining the <SPAN> tag and the style= "someStyle" attribute. Embedded Style Sheets This method enables the designer to control individual pages by using the <STYLE> tag, along with its companion tag, </STYLE>. This information is placed between the <HTML> tag and the <BODY> tag; the style attributes are inserted within the full <STYLE> container. External (linked) Style Sheets This is a master style sheet stored in an external file. It uses the same syntax of that of the embedded style. The file has an ext ension of css and this file has to be linked to the HTML document which requires those controls. The attribute syntax for embedded and linked style sheets is somewhat different than standard HTML syntax. Attributes are placed within curly brackets, whereas HTML would place an equal (=) sing; a colon (:) is used , and individual, stacked arguments are separated by semicolons rather than commas. Also, several attributes are hyphenated, such as font style and margin left. A style sheet string would look like this: (font style: arial, helvetica; margin left) Still, as with HTML, style sheet syntax is very logical. As you work with the examples in this chapter, you should become quite comfortable with the way style sheets work. When you refer to the style attributes as properties of an object, the hyphen disappears and the first letter of the second word is capitalized. So, font style becomes fontStyle, and text decoration becomes textDecoration Of all the techniques for including style information in a web page, only linking to external style sheets an d,importing style sheets allow the style to cascade across, multiple pages. Imported style information is automatically included in the document, where as externally linked style information will be selected only it previously referenced style information is unavailable.
|
|
Domain NamesDHTML Document Object Model Features of Dynamic HTML HTML Versus DHTML Netscape's Vision of DHTML Microsoft Vision of DHTML Cascading Style Sheets(CSS) Inline Style Sheets Embedded Style for a Page Linked Cascading Style Sheet Text Specific Style AttributesCSS Attributes Assigning Classes Java Script Style Sheets(JSSS) Object Property Functions Methods
Creating Style Sheets with JSSS New JSSS Methods Working Layers Positioning the Layer Using More than One Layer Moving a Layer Around on the Page Events
The mouseOver and mouseOut Events The mouseMove Event The Keyboard Events The mouseDown and mouseUp Events The dragDrop Event Error Event Form Event The Script Tag Changing Text Color Inline Text Attribute Changes Text Dynamically Changing StylesExample of Dynamically Changing Style Dynamically Changing Content HTML Replacement Changing Text Content An Example of HTML Graphics ReplacementWeb DesignWeb HostingE Commerce |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |