No matter which type of selector we want to use in jQuery – be it CSS, XPath, or custom – we always start with the dollar sign and parentheses: $()
$() Factory Function
Let’s see some more common examples:
A tag name: $(‘p’) gets all paragraphs in the document.
An ID: $(‘#some-id’) gets the single element in the document that has the corresponding some-id ID.
A class: $(‘.some-class’) gets all elements in the document that have a class of some-class.
$(‘#selected-id > li’)
Find each liste item (li) that is a child (>) of an element with an ID of selected-id (#selected-id).
$(‘#selected-id > li:not(.horizontal)’)
Find each list item that do not have a class of horizontal, which is a child of #selected-id.
CSS is very important for Web Standard.
Following is the benefits you will receive if you use CSS.
* Conserves user bandwidth, speeding page load times, especially over dial-up.
* Reduces owner server and bandwidth overhead, thus saving money.
* Reduces design and development time.
* Reduces updating and maintenance time.
* Increases interoperability by adhering to W3C recommendations.
* Increases accessibility by removing some, many, or all presentational elements from markup.
The site must be as usable in nongraphical environments as it is in the best and lates browsers by Netscape, Microsoft, Opera, and others. Its content and basic functions must be available to any browser or device; its layout should work in any reasonably CSS-savvy browser.
Markup must balidate against the XHTML 1.0 Transitional spec and must avoid presentational elements. We are separating structure from presentation.
CSS must validate and should be as compact and as logically arranged as possible.
To help meet our goal of delivering content and basic functions in almost any conceivable browsing environment, the site should strive to be seamlessly accessible.
The site must deliver a recognizably branded look and feel without squandering visitor or server bandwidth on bloated markup, excessively complex scripts, or needless images. The site must not waste resources, but it must possess style.