Step 20: Mobile Styles     When the user views the page on a mobile device, we don't want the label elements to appear to the left of the input elements because that takes up too much horizontal space. We need to adjust our layout to be more vertical. Create a media query for screens with a maximum width of 767 pixels. Inside the media query, add a rule for any label elements inside the form element with the id registration that removes the float, sets the width to 100%, and aligns the text to the left. Add a rule inside the media query for any input element inside the form element with the id registration that removes the float and sets the width to 100%. Because we set specific widths for the input elements that appear on a single row, we need to override those settings in the mobile view. Add a rule inside the media query for the input elements with the ids city, state, and zip inside the form element with the id registration that sets the maximum width to 100%. Add a rule inside the media query for the label elements with class packageLabel inside the form element with the id registration that adds 50% of the current text size to the top and bottom margins, and removes the left and right margins. Add a rule inside the media query for the label element associated with cardType that sets the line height to normal and adds 50% of the current text size to the top margin. Add a rule inside the media query for the fieldset element with the id cardType that sets the width to 100%. Add a rule inside the media query for the element with the id expirationMonth that sets the width to 50% minus 100% of the current text size. Add a rule inside the media query for the element with the id expirationYear that sets the maximum width to 50%. Add a rule inside the media query for the element with the id securityCode that sets the maximum width to 100%. Add a rule inside the media query for the element with the id submitButton that sets the width to 100% and removes the left margin.

New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Patrick M. Carey
Chapter3: Designing A Page Layout: Creating A Website For A Chocolatier
Section3.2: Visual Overview: Page Layout Grids
Problem 3QC
icon
Related questions
Question

Step 20: Mobile Styles

 
 

When the user views the page on a mobile device, we don't want the label elements to appear to the left of the input elements because that takes up too much horizontal space. We need to adjust our layout to be more vertical.

Create a media query for screens with a maximum width of 767 pixels. Inside the media query, add a rule for any label elements inside the form element with the id registration that removes the float, sets the width to 100%, and aligns the text to the left.

Add a rule inside the media query for any input element inside the form element with the id registration that removes the float and sets the width to 100%.

Because we set specific widths for the input elements that appear on a single row, we need to override those settings in the mobile view. Add a rule inside the media query for the input elements with the ids city, state, and zip inside the form element with the id registration that sets the maximum width to 100%.

Add a rule inside the media query for the label elements with class packageLabel inside the form element with the id registration that adds 50% of the current text size to the top and bottom margins, and removes the left and right margins.

Add a rule inside the media query for the label element associated with cardType that sets the line height to normal and adds 50% of the current text size to the top margin.

Add a rule inside the media query for the fieldset element with the id cardType that sets the width to 100%.

Add a rule inside the media query for the element with the id expirationMonth that sets the width to 50% minus 100% of the current text size.

Add a rule inside the media query for the element with the id expirationYear that sets the maximum width to 50%.

Add a rule inside the media query for the element with the id securityCode that sets the maximum width to 100%.

Add a rule inside the media query for the element with the id submitButton that sets the width to 100% and removes the left margin.

AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Knowledge Booster
Properties of CSS
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L