Created
August 13, 2022 04:51
-
-
Save SarahElson/fb0af62c8b1da464b4e97620d1bfbf81 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"; | |
import styled from "styled-components"; | |
const Button = styled.a` | |
/* This renders the buttons above... Edit me! */ | |
display: inline-block; | |
border-radius: 3px; | |
padding: 1rem; | |
margin: 0.5rem 1rem; | |
width: 11rem; | |
background: black; | |
text-decoration: none; | |
font-size: 18px; | |
color: white; | |
border: 2px solid white; | |
&:hover{ | |
color:brown; | |
background:yellow; | |
} | |
`; | |
const P = styled.p` | |
font-weight: bold; | |
font-size: 18px; | |
text-align: center; | |
color: purple; | |
`; | |
export default function App() { | |
return ( | |
<div> | |
<P>As a Developer, which one do you use the most?</P> | |
<Button | |
href="https://github.com/styled-components/styled-components" | |
target="_blank" | |
rel="noopener" | |
primary | |
> | |
GitHub | |
</Button> | |
<Button href="/docs">Documentation</Button> | |
<Button href="/docs">Twitter</Button> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment