Skip to content

Commit 07245fc

Browse files
mgoltimmywil
andauthored
Update entries/css.xml
Co-authored-by: Timmy Willison <[email protected]>
1 parent db431f4 commit 07245fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entries/css.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ $( "div" ).on( "click", function() {
147147
<longdesc>
148148
<p>As with the <code>.prop()</code> method, the <code>.css()</code> 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.</p>
149149
<p>Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both <code>.css({ "background-color": "#ffe", "border-left": "5px solid #ccc" })</code> and <code>.css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" })</code>. Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.</p>
150-
<p>In jQuery 3.x or older, when a number is passed as the value, jQuery will convert it to a string and add <code>px</code> to the end of that string. There's one exception: <code>px</code> is not added to keys of <a href="/jQuery.cssNumber/"><code>jQuery.cssNumber</code></a> If the property requires units other than <code>px</code>, convert the value to a string and add the appropriate units before calling the method.</p>
150+
<p>In jQuery 3.x or older, when a number is passed as the value, jQuery will convert it to a string and add <code>px</code> to the end of that string. However, there are exceptions. <code>px</code> is not added to keys of <a href="/jQuery.cssNumber/"><code>jQuery.cssNumber</code></a> If the property requires units other than <code>px</code>, convert the value to a string and add the appropriate units before calling the method.</p>
151151
<p>In jQuery 4.0 or newer, when a number is passed as the value, jQuery will only convert it to a string and add <code>px</code> to the end of that string for a limited set of properties - mostly related to width, height, border, margin &amp; padding; the full list:</p>
152152
<ul>
153153
<li>setting the element position: <code>top</code>, <code>right</code>, <code>bottom</code>, <code>left</code></li>

0 commit comments

Comments
 (0)