Complete the code to add a scoped style that makes the paragraph text red.
<script>
// No script needed here
</script>
<style>
p { color: [1]; }
</style>
<p>This text should be red.</p>The style color red makes the paragraph text red. In Svelte, styles are scoped by default, so this style applies only to this component.
Complete the code to add a scoped style that makes the heading text blue.
<style>
h1 { color: [1]; }
</style>
<h1>Blue heading</h1>The color blue makes the heading text blue. Svelte automatically scopes styles to this component, so only this heading is affected.
Fix the error in the scoped style to make the button background green.
<style>
button { background-color: [1]; }
</style>
<button>Click me</button>The background color green will make the button's background green. Svelte scopes this style to the button in this component only.
Fill both blanks to style the div with a red border and padding of 1rem.
<style>
div {
border: [1];
padding: [2];
}
</style>
<div>Styled box</div>The border 1px solid red creates a thin red border. The padding 1rem adds space inside the box. Both styles are scoped to this div only.
Fill all three blanks to create a scoped style that makes the heading text green, the paragraph text gray, and adds margin of 2rem to the section.
<style>
h2 { color: [1]; }
p { color: [2]; }
section { margin: [3]; }
</style>
<section>
<h2>Green heading</h2>
<p>Gray paragraph</p>
</section>The heading color green and paragraph color gray style the texts accordingly. The section margin 2rem adds space around the section. All styles are scoped to this component.