Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to give inline css in reacts class component

How to give inline css in reacts class component.

I have a css something like this.

{
    font-size: 17px;        
  
font-family: Segoe UI Semibold;
    color: #565656;
    text-shadow: 0 1px 1px white;
}

Now when I am reading this css from the css file this is working fine but my css class is coming from library so writing there is not accessible. So How can I make it inline.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Working

 <div style= {{border :"1px solid #ced4da", overflow : "auto",height : "300px"}}>

Not working

<div style= {{font-size: 17px, font-family: Segoe UI Semibold, color: #565656 ,text-shadow: 0 1px 1px white;}}>
                    

Inline css only apply as camel case so how to over come with this. What is an alternate for this.

>Solution :

You cannot add hyphens in inline-css
so you need to change the div element to

<div style= {{fontSize: "17px", fontFamily: "Segoe UI Semibold", color: "#565656" ,textShadow: "0 1px 1px white"}}>
                
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading