Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Vue Basics</title>
- <link
- href="https://fonts.googleapis.com/css2?family=Jost:wght@400;700&display=swap"
- rel="stylesheet"
- />
- <link rel="stylesheet" href="styles.css" />
- <script src="https://unpkg.com/vue@next" defer></script>
- <script src="app.js" defer></script>
- </head>
- <body>
- <header>
- <h1>Vue Styling</h1>
- </header>
- <section id="assignment">
- <!-- 1) Fetch the user input and use it as a CSS class -->
- <!-- The entered class should be added to the below paragraph -->
- <input type="text" v-model="userSelectedClass"/>
- <!-- (available classes: "user1", "user2") -->
- <p :class="[userSelectedClass, paragraphVisibilityClass]">
- Style me!
- </p>
- <button @click="toggleParagraphVisibility">Toggle Paragraph</button>
- <!-- 2) Use the "visible" and "hidden" classes to show/ hide the above paragraph -->
- <!-- Clicking the button should toggle between the two options -->
- <!-- 3) Add dynamic inline styling to the below paragraph and let the user enter a background-color -->
- <input type="text" v-model="userSelectedBackgroundColor" />
- <p :style="{backgroundColor: userSelectedBackgroundColor}">Style me inline!</p>
- </section>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement