Did I use my jquery wrong? css didn't work.

Mar.01,2021

it should be written as follows:

$('.outer').css({"border":"1px solid green","height":"100px"})

if you want to pass more than one attribute at a time, the parameter of css is an object, as written upstairs
$('.outer'). Css ({"border": "1px solid green", "height": "100px"})

modify a style value. You can pass key,value
$('.outer'). Css ("height", "100px;")

directly.

jquery css W3C usage


< H2 > 1. Error reason < / H2 >

(1) the jQuery CSS operation is not used correctly- css () method

< H2 > II. Css () sets multiple CSS attribute / value pairs < / H2 >

(1) Syntax $(selector). Css ({property:value, property:value,.})

(2) this is the best way to set a large number of style attributes on all matching elements .

(3) Parameter description

< table > < thead > < tr > < th > parameters < / th > < th > description < / th > < / tr > < / thead > < tbody > < tr > < td > {property:value} < / td > < td > required . Specifies the name / value pair object to be set as a style property. This parameter can contain several pairs of CSS attribute name / value . For example, {"color": "red", "font-weight": "bold"} < / td > < / tr > < / tbody > < / table > < H2 > III. Correct writing < / H2 >
$('.outer').css({"border":"1px solid green","height":"100px"})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30be2-2b286.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30be2-2b286.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?