Can we get the value from inside a css definition in the code if CSS resource is used?
e.g.
.iv_menu_thumbnail {
display: block;
width: 24px;
height: 24px;
margin: 3px;
float: left;
cursor: pointer;
}`
Can we know via code the value of width
and i want to access from one of my java class?
Thanks in advance
This will get the width of the element if this is what youre asking for. As far as I'm concerned you cannot get non numerical values from a css declaration.
But you can set your own values via jQuery using the
So it would look like this if you want to set a new css value. (or overwrite it)
You can have a variables in your Css Resource file and set the width attribute with that variable, and then access the width varialbe from code.
CssResource
Css Resource file
Java Code
As far as I know, you can only inspect the computed CSS property on an element where this has been applied. Like:
or
Note that the former and the latter differ - the former does not contain the unit of measure, the latter does.