In: Computer Science
can someone make me a shopping cart for me ?
i need to make a shopping cart ,but i have no idea about how to do this
i have made 3 line of items , this is one of the pruduct line
line 1
-------------------------------------
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.div1 {
border: 2px outset red;
background-color: lightblue;
text-align: center;
}
</style>
</head>
<!-- body -->
<body style="background-color:silver; "class="main-layout position_head">
<!-- loader -->
</li>
</ul>
</section>
</nav>
</section>
</header>
<!-- end header inner -->
<!-- end header -->
<!-- Our Glasses section -->
<section class="glasses">
<section class="container">
<section class="row">
<section class="titlepage">
<center><h2>Our Glasses</h2></center>
<marquee width="100%" direction="left" height="100px">
<p style="color:blue;">In this glasses shop, you can find the glasses you want,this is a galsses shop ,and can buy glasses.
</p>
</section>
<section class="container-fluid">
<section class="row">
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img src="images/glass1.png" alt="#"/></figure>
<h3><span class="blu">$</span>50</h3>
<p>Sunglasses</p>
<p>Sunglasses1 ,this sun glass can use to do something 1 Works on myopia</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img src="images/glass2.png" alt="#"/></figure>
<h3><span class="blu">$</span>50</h3>
<p>Sunglasses</p>
<p>Sunglasses1 ,this sun glass can use to do something 1 Works on myopia introduction </p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img src="images/glass3.png" alt="#"/></figure>
<h3><span class="blu">$</span>50</h3>
<p>Sunglasses</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img src="images/glass4.png" alt="#"/></figure>
<h3><span class="blu">$</span>50</h3>
<p>Sunglasses</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img src="images/glass5.png" alt="#"/></figure>
<h3><span class="blu">$</span>50</h3>
<p>Sunglasses</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img src="images/glass6.png" alt="#"/></figure>
<h3><span class="blu">$</span>50</h3>
<p>Sunglasses</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img src="images/glass7.png" alt="#"/></figure>
<h3><span class="blu">$</span>50</h3>
<p>Sunglasses</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img src="images/glass8.png" alt="#"/></figure>
<h3><span class="blu">$</span>50</h3>
<p>Sunglasses</p>
</section>
</section>
<section class="col-md-12">
<a class="read_more" href="#">Read More</a>
</section>
</section>
</section>
</section>
<!-- end Our Glasses section -->
<!-- footer -->
<footer>
<section class="footer">
<section class="container">
<section class="row">
<ul class="location_icon">
<li><a href="#"><i class="fa fa-map-marker" aria-hidden="true"></i></a><br> Location</li>
<li><a href="#"><i class="fa fa-phone" aria-hidden="true"></i></a><br> +01 1234567890</li>
<li><a href="#"><i class="fa fa-envelope" aria-hidden="true"></i></a><br> [email protected]</li>
</ul>
</section>
</footer>
<!-- end footer -->
</body>
</html>
---------------
the line 2 and line 3 have almose the same code ,but only different for the items .
so ,i wantto make a order cart ,html and a css
can someone help me on this and give me some explain ?
thanks.
Your code was very
badly written, I've improved at some areas to make it
good.
HTML FILE
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.div1 {
border: 2px outset red;
background-color: lightblue;
text-align: center;
}
</style>
<script>
function maxLengthCheck(object) {
if (object.value.length > object.maxLength)
object.value = object.value.slice(0, object.maxLength)
}
function isNumeric (evt) {
var theEvent = evt || window.event;
var key = theEvent.keyCode || theEvent.which;
key = String.fromCharCode (key);
var regex = /[0-9]|\./;
if ( !regex.test(key) ) {
theEvent.returnValue = false;
if(theEvent.preventDefault) theEvent.preventDefault();
}
}
function orderfunction(){
alert("Thank you for ordering from my website!!!");
}
function cancelfunction(){
alert("Thank you for your time");
}
</script>
</head>
<!-- body -->
<body style="background-color:silver; "class="main-layout position_head">
<!-- loader -->
</li>
</ul>
</section>
</nav>
</section>
</header>
<!-- end header inner -->
<!-- end header -->
<!-- Our Glasses section -->
<section class="glasses">
<section class="container">
<section class="row">
<section class="titlepage">
<center>
<h2>Our Glasses</h2>
</center>
<marquee width="100%" direction="left" height="100px">
<p style="color:blue;">In this glasses shop, you can find the glasses you want,this is a galsses shop ,and can buy glasses.
</p>
</marquee>
</section>
<section class="container-fluid">
<section class="row">
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img width="200px" height="100px" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcST_xwzDU6FVnqY1R7Yn7jBIiRcClElTQLv3g&usqp=CAU" /></figure>
<h3><span class="blu">$</span>50</h3>
<select name="dropdownbox">
<option value="value1">value1</option>
<option value="value2">value2</option>
<option value="value3">value3</option>
</select>
<br/><input name="myInput_DRS"
onkeypress="return isNumeric(event)"
oninput="maxLengthCheck(this)"
type = "number"
maxlength = "3"
min = "1"
max = "999" />
<p>Sunglasses</p>
<p>Sunglasses1 ,this sun glass can use to do something 1 Works on myopia</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img width="200px" height="100px" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcST_xwzDU6FVnqY1R7Yn7jBIiRcClElTQLv3g&usqp=CAU" /></figure>
<h3><span class="blu">$</span>50</h3>
<select name="dropdownbox">
<option value="value1">value1</option>
<option value="value2">value2</option>
<option value="value3">value3</option>
</select>
<br/><input name="myInput_DRS"
onkeypress="return isNumeric(event)"
oninput="maxLengthCheck(this)"
type = "number"
maxlength = "3"
min = "1"
max = "999" />
<p>Sunglasses</p>
<p>Sunglasses1 ,this sun glass can use to do something 1 Works on myopia introduction </p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img width="200px" height="100px" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcST_xwzDU6FVnqY1R7Yn7jBIiRcClElTQLv3g&usqp=CAU" /></figure>
<h3><span class="blu">$</span>50</h3>
<select name="dropdownbox">
<option value="value1">value1</option>
<option value="value2">value2</option>
<option value="value3">value3</option>
</select>
<br/><input name="myInput_DRS"
onkeypress="return isNumeric(event)"
oninput="maxLengthCheck(this)"
type = "number"
maxlength = "3"
min = "1"
max = "999" />
<p>Sunglasses</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img width="200px" height="100px" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcST_xwzDU6FVnqY1R7Yn7jBIiRcClElTQLv3g&usqp=CAU" /></figure>
<h3><span class="blu">$</span>50</h3>
<select name="dropdownbox">
<option value="value1">value1</option>
<option value="value2">value2</option>
<option value="value3">value3</option>
</select>
<br/><input name="myInput_DRS"
onkeypress="return isNumeric(event)"
oninput="maxLengthCheck(this)"
type = "number"
maxlength = "3"
min = "1"
max = "999" />
<p>Sunglasses</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img width="200px" height="100px" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcST_xwzDU6FVnqY1R7Yn7jBIiRcClElTQLv3g&usqp=CAU" /></figure>
<h3><span class="blu">$</span>50</h3>
<select name="dropdownbox">
<option value="value1">value1</option>
<option value="value2">value2</option>
<option value="value3">value3</option>
</select>
<br/><input name="myInput_DRS"
onkeypress="return isNumeric(event)"
oninput="maxLengthCheck(this)"
type = "number"
maxlength = "3"
min = "1"
max = "999" />
<p>Sunglasses</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img width="200px" height="100px" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcST_xwzDU6FVnqY1R7Yn7jBIiRcClElTQLv3g&usqp=CAU" /></figure>
<h3><span class="blu">$</span>50</h3>
<select name="dropdownbox">
<option value="value1">value1</option>
<option value="value2">value2</option>
<option value="value3">value3</option>
</select>
<br/><input name="myInput_DRS"
onkeypress="return isNumeric(event)"
oninput="maxLengthCheck(this)"
type = "number"
maxlength = "3"
min = "1"
max = "999" />
<p>Sunglasses</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img width="200px" height="100px" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcST_xwzDU6FVnqY1R7Yn7jBIiRcClElTQLv3g&usqp=CAU" /></figure>
<h3><span class="blu">$</span>50</h3>
<select name="dropdownbox">
<option value="value1">value1</option>
<option value="value2">value2</option>
<option value="value3">value3</option>
</select>
<br/><input name="myInput_DRS"
onkeypress="return isNumeric(event)"
oninput="maxLengthCheck(this)"
type = "number"
maxlength = "3"
min = "1"
max = "999" />
<p>Sunglasses</p>
</section>
</section>
<section class="col-xl-3 col-lg-3 col-md-6 col-sm-6">
<section class="glasses_box">
<figure><img width="200px" height="100px" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcST_xwzDU6FVnqY1R7Yn7jBIiRcClElTQLv3g&usqp=CAU" /></figure>
<h3><span class="blu">$</span>50</h3>
<select name="dropdownbox">
<option value="value1">value1</option>
<option value="value2">value2</option>
<option value="value3">value3</option>
</select>
<br/><input name="myInput_DRS"
onkeypress="return isNumeric(event)"
oninput="maxLengthCheck(this)"
type = "number"
maxlength = "3"
min = "1"
max = "999" />
<p>Sunglasses</p>
</section>
</section>
<section class="col-md-12">
<input onclick="orderfunction()" type="button" name="ordernow" value="Order Now" />
<input onclick="cancelfunction()" type="button" name="cancel" value="Cancel" />
<a class="read_more" href="#">Read More</a>
</section>
</section>
</section>
</section>
<!-- end Our Glasses section -->
<!-- footer -->
<footer>
<section class="footer">
<section class="container">
<section class="row">
<ul class="location_icon">
<li><a href="#"><i class="fa fa-map-marker" aria-hidden="true"></i></a><br> Location</li>
<li><a href="#"><i class="fa fa-phone" aria-hidden="true"></i></a><br> +01 1234567890</li>
<li><a href="#"><i class="fa fa-envelope" aria-hidden="true"></i></a><br> [email protected]</li>
</ul>
</section>
</footer>
<!-- end footer -->
</body>
</html>
Few points I would like to give you to focus more on good web page
structure.
1. Don't use tags unnecessarily.
2. Make the CSS and JS files seperately.
3. Don't use tag more than twice when it can work with single
use.
Thanks.