Cascading Style Sheets Tutorial

Web standardization, XHTML and CSS Cascading Style Sheets relations

  The standard Web page is divided into three separate components: 

  * Structure: HTML, XHTML, XML 

  * Performance: CSS1, CSS2 

  * Acts: ECMAScript, DOM 

  Web standards-has to do with the aesthetic appearance of any guiding principles and precepts, and the appearance of the site do not feel any limitations, they can only make the browser correctly performance of a site created designer to help customers with the market demand and Analysis of users to set goals. 

  Web standards can be achieved: 

  * Graphical browser more accurate control, positioning and layout 

  * Complex interaction behavior 

  * Accessibility 

  * Support multiple browser 

  * The old and new browsers can work 

  * Assurance can work in the future for the Tour 

  * Redesigned website shortened 

  * Support non-traditional devices 

  * Easy for any web site provides suitable for print version 

  * Published in the process re-design documents 

  * HTML conversion to XML based markup language 

  The reasons for the use of web standards: 

  * Enhanced interaction 

  * Enhanced Accessibility 

  * Reduced maintenance workload 

  * Reduce Bandwidth 

  * Reduce costs 

  XHTML is an XML-based markup language, HTML and some seem to imagine, but there are some small but important differences.    Can look at it this way, XHTML is a similar HTML play the role of the XML. 

  Essentially, XHTML is a bridge (transition) technology, combined with a XML (a bit) and the power of HTML (the majority) of the simple. 

  — Jeffery Zeldman 

  XHTML switch to the 10 reasons: 

  * XHTML is the alternative HTML4 markup language standards. 

  * XHTML can be with other XML-based markup language, application procedures and good agreement interactive work. 

  * XHTML better than HTML consistency. 

  * XHTML XHTML1.0 leading to the next version of the bridge 

  * Old browser to adapt to XHTML 

  * XHTML browser preference rather than HTML 

  * XHTML can be good in the wireless equipment, and other user agent. 

  * XHTML is part of the family of Web standards 

  * XHTML performance can help you remove the bad habit of code 

  * XHTML can help you develop calibration markers to test pages work habits 

  XHTML rules: 

  * The correct name space and start DOCTYPE 

  * META content elements of the contents of your statement coding language 

  * Use lowercase letters to write all the elements and attributes names 

  * For all the attribute values quote, attribute to space separated. 

  * All the attributes given to a value 

  * Close all tags 

  * Use closed air space and slash tags 

  * Do not use Notes content "-" 

  * Ensuring that the use <and & that <and &. 

  XHTML1 provided by the three DTD: 

  * Transitional, transition, and the most generous DTD, the only signs of intolerance performance, elements and attributes of garbage DTD 

  * Strict, rigorous, 

  * Frameset, framework, 

  XHTML statement coding method: 

  * XML prolog,    But the browser does not deal with the multi - 

  * Content-Type element insert designated coding language, 

  * Through the web HTTP server on the return of the head set up coding language, w3c recommend this method. 

  Increased generic mechanism structure 

  * DIV SPAN element and the Joint id and class attributes, the structure provides a generic document added to the mechanism. 

  * The definition of a built-in element content (SPAN), and block-level (DIV), but not in the content of the performance of the introduction of other things. 

  * ID attributes similar to the special area code labels, suggesting that the region needs special treatment.    When an ID attribute values used for a special set of CSS, it called CSS selector, id is to create a choice for the most common and easy method. 

  * ID to be named by the letters and underlined the beginning, the beginning of the figures can not be used. 

  ID function 

  * As a style sheet choices, the smallest XHTML pages of documents; 

  * As a hyperlink anchor (anchor) to replace outdated name attribute; 

  * DOM elements cited in the script; 

  * As a statement of the object element names; 

  * Objective processes are usually handled as a tool. 

  # A style sheet is a collection of one or more of a definition of the rules of the pool, these definitions will determine how the selected elements be displayed. 

  # 1 CSS definition consists of two parts: selector and declarations.    The statement is also a pool, set on one pair of elements (), each element ";" has ended, each element is composed of two parts: attributes and values, attributes and values between the ":" separation . 

  # # To the beginning of the selector for the id selector to. Selector for the beginning of the selector. 

  # Number of options for sharing the same statement, then between different choices to a comma-separated. 

  # According to CSS, pages from the mother of an element of succession elements, but some do not support the old browser (such as Netscape 4).    If you do not want to inherit an element of the mother element, the element of the definition can be freely associated attributes. 

  # CSS are not case-sensitive, but when associated with an HTML document, the type and id name is case-sensitive. 

  # In order to facilitate the editing CSS can be some additional space or newline. 

  # Style sheet can be three ways pages role in the show 

  1. Outreach / Import 

  <link Rel="StyleSheet" href="/styles/mystylesheet.css" type="text/css" media="all /> 

  Or 

  <style Type="text/css" media="all"> 
  @ Import "/ styles / mystylesheet.css"; 
  </ Style> 

  Or 

  <style Type="text/css" media="all"> 
  @ Import url ( "/ styles / mystylesheet.css"); 
  </ Style> 

  Notes: @ Import of only 5.0 above browsers support 

  2. Embedded (head position in the embedded XHTML pages) 

  The following is quoted fragment: 
<head>
  <style Type="text/css"> 
  <! – 
…
–>
  </ Style> 
…
  </ Head> 

  Use embedded reasons: 

  * The style sheets are used to this page 

  * Users are still using IE3 

  * Designers constantly revised and style sheet, the need to see immediate results 

  3. Intranet (add in the elements of style attributes) 

  For the entire site designated font: 

  * Body (font-family: "Lucida Grande," Verdana, Lucida, Arial, Helvetica, sans-serif;) 

  * The number of letters from the name of the font to be used quotes including; 

  * If the top of the font did not exist, the use of the rear section of a font. 

  * "Lucida Grande"-Mac OS X, Verdana-Windows, Unix - Lucida, the old windows - Arial, Helvetica - old Unix 

  * The use of redundant solution browser does not support inheritance issues, such as: 

  Body (font-family: Verdana, sans-serif;) P, td, ul, ol, ul, li, dl, dt, dd 

  (Font-family: Verdana, sans-serif;) 

  Disorder will be before the black spots on the replacement for a picture: 

  * Ul.inventory (list-style: disc url (/ path / to / pic.gif) inside;) 

  Color definition: 

  * P (color: red;) 

  * P (color: # ff0000;) 

  * P (color: # f00;) 

  * P (color: rgb (255,0,0);) 

  * P (color: rgb (100%, 0%, 0%);) 

  # Elements of performance in accordance with the contents of the elements to determine the pattern and avoid excessive class, and maintain a simple marker neatly. 

  #: List of the strong, rather than shown as bold italics.    Li strong (Font-style: italic; Font-weight: normal;) 

  # The choice between the two parts, separated by spaces, which can be part of the former general choice, id selector, or category selector. 

  # Modern layout, id selector often in the choice of content, 

  Such as: # sidebar p (font-style: italic; text-align: right; margin-top: 0.5em;) 

   # Or can not appear in the labeling, such as the elements within.  

  Id # selector marked each page element can appear only once, but the one id selector can be used to define multiple content / derived selector definition. 

  Note: new website Taoba (/) on the line 


Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • DZone

Tags: Border Style, css style, css style sheet, div style, List Style Type, style

Releated Posts

  • How to manage the production of web site good css style
  • CSS style sheet: embedded links good or good?
  • Imprint: Use css style settings iframe
  • Frontpage 2000 in the web site CSS style definition
  • CSS primary entry: Style's repeated statements

This entry was posted on Monday, February 11th, 2008 at 12:00 am and is filed under Css+Div Web Design. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« Resource sharing: Learning CSS related resources website

Leave a Reply

  • Categories

    • CSS Properties (491)
    • CSS Tutorial (1154)
    • CSS Tutorial By Examples (1201)
    • Css+Div Web Design (3274)
    • Xhtml and Web Design (1797)
  • Archives

    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
  • Pages

    • About us

Cascading Style Sheets Tutorial