<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='docs.xsl'?>
<docs>
<method cat='CSS' type='String' short='Access a style property on the first matched element.' name='css'>
<desc>Access a style property on the first matched element.
This method makes it easy to retrieve a style property value
from the first matched element.</desc>
<params type='String' name='name'>
<desc>The name of the property to access.</desc>
</params>
<examples>
<desc>Retrieves the color style of the first paragraph</desc>
<before>&lt;p style="color:red;"&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").css("color");</code>
<result>"red"</result>
</examples>
<examples>
<desc>Retrieves the font-weight style of the first paragraph.</desc>
<before>&lt;p style="font-weight: bold;"&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").css("font-weight");</code>
<result>"bold"</result>
</examples>
</method><method cat='CSS' type='jQuery' short='Set a key/value object as style properties to all matched elements.' name='css'>
<desc>Set a key/value object as style properties to all matched elements.

This serves as the best way to set a large number of style properties
on all matched elements.</desc>
<params type='Map' name='properties'>
<desc>Key/value pairs to set as style properties.</desc>
</params>
<examples>
<desc>Sets color and background styles to all p elements.</desc>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").css({ color: "red", background: "blue" });</code>
<result>&lt;p style="color:red; background:blue;"&gt;Test Paragraph.&lt;/p&gt;</result>
</examples>
</method><method cat='CSS' type='jQuery' short='Set a single style property to a value, on all matched elements.' name='css'>
<desc>Set a single style property to a value, on all matched elements.
If a number is provided, it is automatically converted into a pixel value.</desc>
<params type='String' name='key'>
<desc>The name of the property to set.</desc>
</params>
<params type='String|Number' name='value'>
<desc>The value to set the property to.</desc>
</params>
<examples>
<desc>Changes the color of all paragraphs to red</desc>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").css("color","red");</code>
<result>&lt;p style="color:red;"&gt;Test Paragraph.&lt;/p&gt;</result>
</examples>
<examples>
<desc>Changes the left of all paragraphs to "30px"</desc>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").css("left",30);</code>
<result>&lt;p style="left:30px;"&gt;Test Paragraph.&lt;/p&gt;</result>
</examples>
</method></docs>
