ReactJs sets css styles and reactjscss styles
I read React Native some time ago, but I feel that development on the opposite side of Android is not mature. there are many functions to be improved, and in the actual use of the process in some modules encountered unknown resistance, and suffering from the lack of so many resources on the Internet. so I plan to release it for a while. Let's look back at ReactJs.
React subverts the traditional thinking of html, and the code is basically written in the <script type = "text/babel"> </script> label. IDEA is used during development. Of course, atom or webstor can also be used. when using IDEA, you must set Javascript Language version to JSX Harmony in the language & Framework in settings. otherwise, the editor may report an error in your correct syntax.
<script src="../js/react.js"></script><script src="../js/react-dom.js"></script><script src="../js/browser.min.js"></script><script src="../js/jquery-1.7.2.min.js"></script>
In the header tag of an html file, the preceding three files can be referenced for react development. However, because jquery's ajax request is convenient, I reference jquery here, of course, you can also encapsulate a method similar to ajax, or use native http requests to interact with the background.
Today we will talk about setting react styles:
<! DOCTYPE html>
As shown in the code above, I think there are three ways to set a style:
1. As shown in the blue font section, write the inline style directly.
2. Define a variable in js Code and call the variable inside the element tag, as shown in red.
3. Set the className of the label, such as the green font section.
Attached below:
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.