topskill.dev
CoursesTracks
0
All courses/CSSCommunity garden request card
Project - Styled Form
1 / 3
← CSS
○CSS Rule Style an Exhibit Card○Write Your First CSS Rule○CSS Selectors Target Exhibit Details○Target Exhibit Details○Apply CSS Three Sources○Apply CSS Three Ways○Specificity Resolve a Style Conflict○Resolve Specificity○Inheritance and the cascade✦Module Quiz
○Color Palette○Color Palette○Background Layer○Background Layer○Type Rhythm○Type Rhythm○Borders and Shadows○Borders and Shadows✦Module Quiz
○Box Model Seed Packet Card○Space a Seed Packet○Display Swap Table Labels○Arrange Swap Table Labels○Positioning Pickup Pin○Pin the Pickup Location○Sizing and Overflow○Size a Seed-Swap Notice○Sticky scroll headings✦Module Quiz
○Advanced Selectors Book Cart Sign○Target a Book Cart Sign○Pseudo-Classes Night Cart States○Style Night Cart States○Pseudo-Elements○Add a Book-Quote Mark✦Module Quiz
○Lantern Market navigation○Lantern Market navigation✦Module Quiz
●Community garden request card○Community garden request card✦Module Quiz
○Flex Direction○Flex Direction○Main-Axis Spacing○Main-Axis Spacing○Cross-Axis Alignment○Cross-Axis Alignment○Wrapping and Flex Items○Wrapping and Flex Items○Flexbox Navigation○Flexbox Navigation✦Module Quiz
○Grid Tracks○Grid Tracks○Grid Gaps○Grid Gaps○Grid Placement○Grid Placement○Responsive Grid○Responsive Grid✦Module Quiz
○River radio schedule○Harbor radio schedule✦Module Quiz
○Field note color system○Field note color system○Transforms○Rotate a Field Note○Resilient styles✦Module Quiz
○Kite festival signal○Garden festival signal✦Module Quiz
○Garden forecast○Harbor forecast○Fluid sizing○Fluid weather bulletin○Images that fit✦Module Quiz
○Seed inventory table○Tool checkout table✦Module Quiz
○Community maker profile○Maker profile sheet✦Module Quiz

Community garden request card

Seed request form

A community garden volunteer needs a reply address for seed requests. This completed card puts the label above the field and shows which control has keyboard focus.

The HTML connects label for="email" to input id="email". Click Contact email: focus moves to the field. A placeholder is only a typing example, so it does not replace that visible label.

In style.css, display: block puts the label and input on separate lines. The input uses width: 100% and box-sizing: border-box, which keeps its padding and border within that width. Its bottom margin creates the gap before the button.

Inspect space and focus

Run the preview. In style.css, change the input's margin-bottom from .75rem to 2rem, then run again. The larger gap should be easy to see. Restore .75rem.

Click blank preview space and press Tab to reach the email input. input:focus draws a dark-orange outline outside the field; outline-offset: 2px leaves a small gap between the outline and border. An outline does not push the nearby controls away. Tab again to the button and check its supplied focus ring.

The form is a visual example. There is no service to receive requests, so you do not need to press Send request. The next exercise leaves the layout in place and asks you to add spacing and field feedback.

Hint 1
1 / 2
HINT 1

Keep the stylesheet linked from the document head.

HINT 2

Change one declaration at a time, then use Run Preview to inspect the result.

Files
  • ⋄index.html
  • ⋄style.css
Loading editor…