Net-informations.com
SiteMap  | About    

jQuery css() Method



CSS is the language for describing the presentation of Web pages , including colors, layout, and fonts. It brings style to your web pages by interacting with HTML elements . The separation of HTML from CSS makes it easier to maintain sites, share style sheets across pages, and tailor pages to different environments.

The jQuery css() methods enables you to get the value of a computed style property for the first element in the set of matched elements or set one or more CSS properties for every matched element.

Get styles from the web page

run this source code Try it Yourself

Get CSS style

Full Source

Set styles on the web page

The css(property, value) method makes setting properties of elements quick and easy. This method can take either a property name and value as separate parameters, or a single object of key-value pairs.

run this source code Try it Yourself

Set CSS style

Full Source

Set multiple styles on the web page

Syntax

Apply multiple CSS properties using a single JQuery method CSS( {propertyname1:value1, propertyname2:value2....). You can apply as many properties as you like in a single call. We can define object literal in curly braces ({}) . propertyname and value pair are defined with the help of colon like Key:Value and multiple keys are separated by comma as defined in above code.

run this source code Try it Yourself

Set CSS style

Full Source









net-informations.com (C) 2018    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.