sb_payment_txt.html <!DOCTYPE html> <html lang=\"en\"> <head> <!-- New Perspecti
ID: 3734490 • Letter: S
Question
sb_payment_txt.html
<!DOCTYPE html>
<html lang="en">
<head>
<!--
New Perspectives on HTML5 and CSS3, 7th Edition
Tutorial 7
Case Problem 2
Spice Bowl Payment Form
Author:
Date:
Filename: sb_payment.html
-->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Spice Bowl Payment Form</title>
<link href="sb_reset.css" rel="stylesheet" />
<link href="sb_styles.css" rel="stylesheet" />
</head>
<body>
<header>
<img src="sb_logo.png" alt="The Spice Bowl" />
<nav> <a id="navicon" href="#"><img src="sb_navicon.png" alt="" /></a>
<ul>
<li><a href="#">Spices</a></li>
<li><a href="#">Recipes</a></li>
<li><a href="#">My Cart</a></li>
<li><a href="#">My Account</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
</header>
<section>
<h1>Payment Form</h1>
<aside>
<h1>Menu Ideas</h1>
<h2>Salt-Roasted Pecans</h2>
<ul>
<li>2 cups pecans</li>
<li>3 Tbs. butter, melted</li>
<li>1 1/4 tsp. fine sea salt</li>
</ul>
<p>Preheat oven to 325°. Toss pecans and butter together;
add salt and toss again. Spread in a single layer on a baking
sheet. Bake about 15 minutes. Cook on baking sheet.
</p>
<h2>Dried Beef Sticks</h2>
<ul>
<li>5 lbs. ground chuck</li>
<li>5 Tbs. quick salt</li>
<li>3 tsp. mustard seed</li>
<li>2 tsp. granulated garlic</li>
<li>2 tsp. cracked pepper</li>
<li>1 Tbs. hickory smoked salt</li>
<li>1 Tbs. liquid smoke</li>
</ul>
<p>Mix beef and season. Place in a large covered container
for three days.
On third day, shape beef into sticks, and bake at 150° for
8 hours (turn half-way through).
</p>
</aside>
</section>
<footer>
<nav>
<ul>
<li class="newgroup"><a href="#">Home</a></li>
<li><a href="#">Keyword Search</a></li>
<li class="newgroup"><a href="#">Spices</a></li>
<li><a href="#">Seasonings</a></li>
<li><a href="#">Blends</a></li>
<li><a href="#">Salts & Peppers</a></li>
<li><a href="#">Popcorn Seasonings</a></li>
<li><a href="#">Dip Mixes</a></li>
<li><a href="#">Bulk Spices</a></li>
<li><a href="#">Extracts</a></li>
<li><a href="#">Flavorings</a></li>
<li class="newgroup"><a href="#">Spice Jars</a></li>
<li><a href="#">Spice Jar Labels</a></li>
<li><a href="#">Spice Sets</a></li>
<li><a href="#">Mortar & Pestles</a></li>
<li class="newgroup"><a href="#">Cookbooks</a></li>
<li><a href="#">Online Recipes</a></li>
<li><a href="#">Forums</a></li>
<li class="newgroup"><a href="#">My Account</a></li>
<li><a href="#">Checkout</a></li>
<li><a href="#">Order History</a></li>
<li><a href="#">Shipping Info</a></li>
<li class="newgroup"><a href="#">Tech Support</a></li>
<li><a href="#">Hours</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
</footer>
</body>
</html>
sb_validate_txt.css
/*
New Perspectives on HTML and CSS, 7th Edition
Tutorial 7
Case Problem 2
Spice Bowl Payment Form Validation Style Sheet
Author:
Date:
Filename: sb_validate.css
*/
/* Validation Styles */
sb_styles.css
@charset "utf-8";
/*
New Perspectives on HTML and CSS
Tutorial 7
Case Problem 2
Spice Bowl General Style Sheet
Filename: sb_styles.css
*/
/* HTML and Body styles */
html {
background: url(sb_back.png) center center/cover fixed no-repeat;
font-family: Verdana, Geneva, sans-serif;
height: 100%;
}
body {
background-color: rgba(255, 255, 255, 0.4);
border-left: 1px solid white;
border-right: 1px solid white;
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
position: relative;
margin: 0px auto;
min-width: 320px;
max-width: 1020px;
width: 100%;
}
/* Header styles */
header > img {
width: 50%;
}
header {
background: rgba(234, 145, 29, 0.5);
width: 100%;
}
/* Navigation list styles */
a#navicon {
display: none;
}
header nav ul li {
font-size: 1.2em;
line-height: 2.3em;
height: 2.3em;
padding: 0px 10px;
}
header nav {
background-color: rgba(51, 51, 51, 0.35);
clear: both;
width: 100%;
}
header nav ul li a {
color: white;
display: block;
width: 100%;
}
header nav ul li a:hover {
color: rgb(249, 209, 17);
text-shadow: rgb(51, 51, 51) 0px 0px 5px;
}
a#navicon {
display: none;
}
/* Section Styles */
section {
background-color: rgba(255, 255, 255, 0.8);
width: 100%;
padding: 40px;
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
}
section > h1 {
font-size: 2.2em;
color: rgb(206, 141, 56);
letter-spacing: 0.2em;
font-weight: normal;
text-shadow: rgba(255, 255, 255, 0.8) 3px 3px 0px;
flex: 0 0 100%;
}
section form {
-webkit-flex: 3 1 4800px;
flex: 3 1 480px;
margin-top: 25px;
margin-right: 20px;
}
section aside {
color: rgb(206, 141, 56);
-webkit-flex: 1 3 161px;
flex: 1 3 161px;
margin-top: 25px;
font-size: 0.8em;
padding: 0px 15px;
}
section aside h1 {
font-size: 1.5em;
line-height: 1.5em;
}
section aside h2 {
font-size: 1.2em;
margin: 10px 0px 5px;
}
section aside ul {
border-top: 1px solid rgb(206, 141, 56);
border-bottom: 1px solid rgb(206, 141, 56);
margin: 0px 0px 10px 10px;
}
/* Footer Styles */
footer {
width: 100%;
}
footer nav {
background: rgba(184, 85, 0, 0.35);
-moz-column-width: 200px;
-webkit-column-width: 200px;
column-width: 200px;
-moz-column-gap: 25px;
-webkit-column-gap: 25px;
column-gap: 25px;
padding: 20px 40px;
}
footer li.newgroup {
margin-top: 12px;
}
footer a {
display: block;
color: white;
text-decoration: none;
font-size: 0.9em;
}
footer a:hover {
text-decoration: underline;
}
/* ===============================
Mobile Styles: 0px to 640px
===============================
*/
@media only screen and (max-width: 640px) {
aside {
display: none;
}
a#navicon {
display: block;
}
header > img {
width: 100%;
}
header nav ul {
display: none;
}
header nav ul li {
font-size: 1em;
line-height: 1.3em;
height: 1.3em;
}
section > h1 {
line-height: 1.2em;
}
a#navicon:hover+ul, header nav ul:hover {
display: block;
}
}
/* =============================================
Tablet and Desktop Styles: greater than 640px
=============================================
*/
@media only screen and (min-width: 641px) {
body header nav ul {
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row nowrap;
flex-flow: row nowrap;
-webkit-justify-content: center;
justify-content: center;
}
body header nav ul li {
-webkit-flex: 0 1 auto;
flex: 0 1 auto;
}
}
sb_reset.css
@charset "utf-8";
/*
New Perspectives on HTML5 and CSS3, 7th Edition
Tutorial 7
Case Problem 2
Spice Bowl Reset Style Sheet
Filename: sb_reset.css
*/
/* Basic styles to be used with all devices and under all conditions */
article, aside, figcaption, figure,
footer, header, main, nav, section {
display: block;
}
address, article, aside, blockquote, body, cite,
div, dl, dt, dd, em, figcaption, figure, footer,
h1, h2, h3, h4, h5, h6, header, html, img,
li, main, nav, nav a, ol, p, section, span, ul,
table, tr, td, th, col, colgroup {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
background: transparent;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* Set the default page element styles */
body {
line-height: 1.2em;
}
ul, ol {
list-style: none;
}
nav ul {
list-style: none;
list-style-image: none;
}
nav a {
text-decoration: none;
}
sb_forms.css
/*
New Perspectives on HTML and CSS, 7th Edition
Tutorial 7
Case Problem 2
Spice Bowl Forms Style Sheet
Filename: sb_forms.css
*/
/* Login Form Layout Styles */
form#login {
float: right;
}
form#login input {
margin: 10px;
}
/* Form Layout Styles */
form#payment {
background-color: rgba(206, 141, 56, 0.1);
}
fieldset {
border: none;
}
legend {
background-color: rgba(206, 141, 56, 0.7);
color: rgba(255, 255, 255, 0.7);
font-size: 0.9em;
border-radius: 10px;
margin-bottom: 10px;
padding: 8px;
width: 100%;
}
/* Input and Label Styles */
label {
display: block;
float: left;
clear: left;
font-size: 0.9em;
margin-bottom: 10px;
margin-right: 10px;
width: 180px;
text-align: right;
}
form#payment input, form#payment select {
display: block;
float: left;
}
/* Radio Button Styles */
label.cardLabel {
display: inline-block;
float: none;
width: auto;
}
label.cardLabel img {
border: 1px solid rgb(181, 181, 181);
box-shadow: rgb(51, 51, 51) 0px 0px 10px;
}
input[type='radio'] {
width: auto;
float: none;
clear: none;
margin-right: 15px;
}
/* Submit Button Styles */
button {
background: transparent;
border: none;
display: block;
margin: 5px auto;
}
Explanation / Answer
I have modified the given html based on the requirement that given in the question. I couldn't get the script and sb_regex.txt so i couldn't do the regex validation.
And please place the images with the same name in root folder where the html file located. In my case i have added the images with the same name as given.
Below is the Altered HTML Code
************************sb_payment.html HTML**********************
<!DOCTYPE html>
<html lang="en">
<head>
<!--
New Perspectives on HTML5 and CSS3, 7th Edition
Tutorial 7
Case Problem 2
Spice Bowl Payment Form
Author:
Date:
Filename: sb_payment.html
-->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Spice Bowl Payment Form</title>
<link href="sb_reset.css" rel="stylesheet" />
<link href="sb_styles.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="sb_forms.css">
<link rel="stylesheet" type="text/css" href="sb_validate.css">
</head>
<body>
<header>
<img src="sb_logo.png" alt="The Spice Bowl" />
<form action="http://example.com/sb/login" method="post">
<input type="text" name="userBox" placeholder="username"/>
<input type="text" name="pwdBox" placeholder="password">
</form>
<nav> <a id="navicon" href="#"><img src="sb_navicon.png" alt="" /></a>
<ul>
<li><a href="#">Spices</a></li>
<li><a href="#">Recipes</a></li>
<li><a href="#">My Cart</a></li>
<li><a href="#">My Account</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
</header>
<section>
<h1>Payment Form</h1>
<form action="http://example.com/sb/payment" id="payment" method="post">
<fieldset id="billing">
<legend>Billing Information (Required)</legend>
<label>First Name</label><input id="firstBox" type="text" required/>
<label>Last Name</label><input id="lastBox" type="text" required/>
<label>Street Address</label><input id="streetBox" type="text" required/>
<label>Street Address (2)</label><input id="streetBox2" type="text"/>
<label>City</label><input id="cityBox" type="text" required/>
<label>State</label><input list="stateBox" required/>
<label>Zip/Postal Code</label><input pattern="^d{5}(-d{4})?$" id="zipBox" type="text"/>
<label>Country</label><input id="countryBox" type="text" value="United States" required/>
<label>Phone</label><input id="phoneBox" type="text" required/>
<datalist id="stateBox">
<option value="State 1">
<option value="State 2">
<option value="State 3">
<option value="State 4">
<option value="State 5">
</datalist>
</fieldset>
<fieldset id="creditCard">
<legend>Credit Card (Required)</legend>
<fieldset>
<label class="cardLabel"><input type="radio" name="cCard" value="amex"/><img src="sb_amex.png" alt="" /></label>
<label class="cardLabel"><input type="radio" name="cCard" value="discover"/><img src="sb_discover.png" alt="" /></label>
<label class="cardLabel"><input type="radio" name="cCard" value="master"/><img src="sb_master.png" alt="" /></label>
<label class="cardLabel"><input type="radio" name="cCard" value="visa"/><img src="sb_visa.png" alt="" /></label><br/>
<label>Credit Card Number</label><input id="cardBox" type="text" required/>
<label>Expiration Date</label><input list="monthList" type="text" required/><input list="yearList" type="text" required/>
<label>CSC</label><input id="cscBox" type="text" maxlength="3" required/>
<datalist id="monthList">
<option value="--Month--">
<option value="Frebruary (02)">
<option value="March (03)">
<option value="April (04)">
<option value="May (05)">
<option value="June (06)">
<option value="July (07)">
<option value="August (08)">
<option value="September (09)">
<option value="October (10)">
<option value="November (11)">
<option value="December (12)">
</datalist>
<datalist id="yearList">
<option value="--Year--">
<option value="2017">
<option value="2018">
<option value="2019">
<option value="2020">
<option value="2021">
</datalist>
</fieldset>
</fieldset>
<button><img src="sb_button.png" alt="next" /></button>
</form>
<aside>
<h1>Menu Ideas</h1>
<h2>Salt-Roasted Pecans</h2>
<ul>
<li>2 cups pecans</li>
<li>3 Tbs. butter, melted</li>
<li>1 1/4 tsp. fine sea salt</li>
</ul>
<p>Preheat oven to 325°. Toss pecans and butter together;
add salt and toss again. Spread in a single layer on a baking
sheet. Bake about 15 minutes. Cook on baking sheet.
</p>
<h2>Dried Beef Sticks</h2>
<ul>
<li>5 lbs. ground chuck</li>
<li>5 Tbs. quick salt</li>
<li>3 tsp. mustard seed</li>
<li>2 tsp. granulated garlic</li>
<li>2 tsp. cracked pepper</li>
<li>1 Tbs. hickory smoked salt</li>
<li>1 Tbs. liquid smoke</li>
</ul>
<p>Mix beef and season. Place in a large covered container
for three days.
On third day, shape beef into sticks, and bake at 150° for
8 hours (turn half-way through).
</p>
</aside>
</section>
<footer>
<nav>
<ul>
<li class="newgroup"><a href="#">Home</a></li>
<li><a href="#">Keyword Search</a></li>
<li class="newgroup"><a href="#">Spices</a></li>
<li><a href="#">Seasonings</a></li>
<li><a href="#">Blends</a></li>
<li><a href="#">Salts & Peppers</a></li>
<li><a href="#">Popcorn Seasonings</a></li>
<li><a href="#">Dip Mixes</a></li>
<li><a href="#">Bulk Spices</a></li>
<li><a href="#">Extracts</a></li>
<li><a href="#">Flavorings</a></li>
<li class="newgroup"><a href="#">Spice Jars</a></li>
<li><a href="#">Spice Jar Labels</a></li>
<li><a href="#">Spice Sets</a></li>
<li><a href="#">Mortar & Pestles</a></li>
<li class="newgroup"><a href="#">Cookbooks</a></li>
<li><a href="#">Online Recipes</a></li>
<li><a href="#">Forums</a></li>
<li class="newgroup"><a href="#">My Account</a></li>
<li><a href="#">Checkout</a></li>
<li><a href="#">Order History</a></li>
<li><a href="#">Shipping Info</a></li>
<li class="newgroup"><a href="#">Tech Support</a></li>
<li><a href="#">Hours</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
</footer>
</body>
</html>
************************END*********************************
And below is the css file sb_validate.css
******************sb_validate.css****************
/*
New Perspectives on HTML and CSS, 7th Edition
Tutorial 7
Case Problem 2
Spice Bowl Payment Form Validation Style Sheet
Author:
Date:
Filename: sb_validate.css
*/
/* Validation Styles */
input:not([type="radio"]):focus {
background-color: rgb(255,218,165);
}
input:not([value=""]):focus:invalid {
background-color: rgb(255,255,215);
}
input:not([value=""]):focus:valid {
background-color: rgb(255,245,215);
}
********************END*********************
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.