Created
August 13, 2022 04:43
-
-
Save SarahElson/80f9159debf107292ac12a82a9273187 to your computer and use it in GitHub Desktop.
How To Style And Write CSS In React
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./styles.css"; | |
export default function App() { | |
return ( | |
<div className='App'> | |
<h1> | |
Hello World | |
<style jsx> | |
{` | |
h1 { | |
color: whitesmoke; | |
background: black; | |
} | |
.App { | |
background: orange; | |
} | |
h2 { | |
color: white; | |
} | |
img { | |
border-radius: 50%; | |
width: 250px; | |
height: 250px; | |
object-fit: contain; | |
} | |
img:hover { | |
object-fit: cover; | |
} | |
`} | |
</style> | |
</h1> | |
<h2>Wondering what’s even more challenging than choosing a JavaScript framework? You guessed it: choosing a CSS-in-JS solution. Why? Because there are more than 40 libraries out there, each of them offers a unique set of features.</h2> | |
<img | |
alt='' | |
src=https://cdn.statically.io/img/austingil.com/f=auto%2Cq=70/wp-content/uploads/JavaScript-Blog-Cover.png' | |
/> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment