The use of style in react is somewhat different from that used directly in HTML, first, react must be style= "opacity:{this.state.opacity};" This type of writing, second if multiple style formats are as follows, comma split between multiple style
var divstyle = {
color: ' White ',
backgroundimage: ' url (' + Imgurl + ') ',
webkittransition: "All",//Note the Capital ' W ' here
mstransition: ' All '//' Ms ' are the only lowercase vendor prefix
};
But in HTML we usually use it directly, with semicolons in the middle of multiple style;
<div style= "BackgroundColor: #FFFF90; Color: #FFFFFF ">white text2</div>
<!--div tags use the Style property to set the font color-->
<span style= "BackgroundColor: #FFFF90" ><a style= "color: #FF00FF" href= "http://www.baidu.com" >nihao</ A> </span>
The code example gives an example of the color of text in a table and the background color of a text box:
</pre><pre name= "code" class= "HTML" ><! DOCTYPE html>
The final effect figure is as follows: