主頁 > 前端設計 > 京東購物車(html+css+js)

京東購物車(html+css+js)

2020-12-07 10:37:25 前端設計

html+js部分

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>我的購物車</title>
<link rel="stylesheet" type="text/css" href="css/css.css" />
<link rel="stylesheet" type="text/css" href="font-awesome-4.7.0/css/font-awesome.css" />
</head>
<body>
<div id="contain">
<div id="banner">
<div class="banner1">
<div class="banner2">
<ul>
<li><img src="img/小房子_03.png"></li>
<li><a href="#">京東首頁</a></li>
<li><i class="fa fa-map-marker" aria-hidden="true"></i></li>
<li>
<option>廣東</option>
</li>
</ul>
</div>
<div class="banner3">
<ul>
<li><a href="#">余生</a><i class="fa fa-chevron-down" aria-hidden="true"></i></li>
<li><span>|</span></li>
<li><a href="#">我的訂單</a></li>
<li><span>|</span></li>
<li><a href="#">我的京東</a><i class="fa fa-chevron-down" aria-hidden="true"></i></li>
<li><span>|</span></li>
<li><a href="#">京東會員</a></li>
<li><span>|</span></li>
<li><a href="#">企業采購</a><i class="fa fa-chevron-down" aria-hidden="true"></i></li>
<li><span>|</span>
<li>
<li><a href="#">客戶服務</a><i class="fa fa-chevron-down" aria-hidden="true"></i></li>
<li><span>|</span></li>
<li><a href="#">網站導航</a></li>
<li><span>|</span>
<li>
<li><a href="#">手機京東</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<div class="content1">
<div class="logo"><img src="img/京東購物車專案.png"><a href="#">購物車</a></div>
<div class="from">
<input type="text" class="search" value=''>
<span class='photo' title="未選擇取任何檔案">
<img src="camera.png" alt="">
</span>
<button class='button'>
<i>搜索</i>
</button>
</div>
</div>
<div class="content2">
<div class="dl">
<ul>
<li class="sanjiao"><img src="img/三角警告_07.png"></li>
<li class="denglu">你還沒有登錄!請登錄后購物車的商品將保存到你的賬號中</li>
<li><button class="dl1"><i>立即登錄</i></button></li>
</ul>
</div>
</div>
<div class="content3" id="jd_cart">
<div class="jdsp">
<div class="allshopping">
<ul>
<li><em>全部商品</em></li>
<li>
<hr class="underscorecharacter" />
</li>
</ul>
</div>
<div class="region">
<ul>
<li>配送至:</li>
<li>
<select class="area">
<option>廣東省汕頭市龍湖區</option>
</select>
</li>
</ul>
</div>
</div>
<div class="operationbox">
<div class="allcheck">
<input type="checkbox" checked id="checkAll" />全選
</div>
<div class="shopping">商品</div>
<div class="nullbox"></div>
<div class="unitprice">單價</div>
<div class="amount">數量</div>
<div class="subtotal">小計</div>
<div class="system">操作</div>
</div>
</div>
<div id="content5">
<div class="phonebox1">
<div class="check"><input type="checkbox" checked id="checkAll" /></div>
<div class="phonepicture"><img src="img/手機1.png"></div>
<div class="phoneinformation"><a href="#">小米10 Pro 雙模5G手機【下單送豪</br> &ensp; 禮】驍龍865 新品游戲手機小米10pro</a></div>
<div class="phonechoose" title="珍珠白">珍珠白 8+258GB</br>官方標配</div>
<div class="price">¥4699.00</div>
<div class="number">
<button οnclick="calc(this)">-</button>
<span> 1 </span>
<button οnclick="calc(this)">+</button>
</div>
<div class="total">¥4699.00</div>
<div class="opreate"><a href="#">洗掉</a></div>
</div>
<div class="phonebox1">
<div class="check"><input type="checkbox" checked id="checkAll" /></div>
<div class="phonepicture"><img src="img/手機2.png"></div>
<div class="phoneinformation"><a href="#">小米10 5G游戲手機【至高12期分期0</br>首付】 鈦銀黑 8G+256G</a></div>
<div class="phonechoose" title="鈦銀黑">鈦銀黑</br>8G+256G</div>
<div class="price">¥3788.00</div>
<div class="number">
<button οnclick="calc(this)">-</button>
<span> 1 </span>
<button οnclick="calc(this)">+</button>
</div>
<div class="total">¥3788.00</div>
<div class="opreate"><a href="#">洗掉</a></div>
</div>
<div class="phonebox1">
<div class="check"><input type="checkbox" checked id="checkAll" /></div>
<div class="phonepicture"><img src="img/手機3.png"></div>
<div class="phoneinformation"><a href="#">Apple 蘋果 iphone 11 手機 黃色 全網通 128GB</a></div>
<div class="phonechoose" title="黃色">黃色</br>全網通 128GB</div>
<div class="price">¥5489.00</div>
<div class="number">
<button οnclick="calc(this)">-</button>
<span> 1 </span>
<button οnclick="calc(this)">+</button>
</div>
<div class="total">¥5489.00</div>
<div class="opreate"><a href="#">洗掉</a></div>
</div>
<div class="phonebox1">
<div class="check"><input type="checkbox" checked id="checkAll" /></div>
<div class="phonepicture"><img src="img/手機4.png"></div>
<div class="phoneinformation"><a href="#">Apple 蘋果 iphone 11 手機 綠色 全網通 128GB</a></div>
<div class="phonechoose" title="綠色">綠色</br>全網通 128GB</div>
<div class="price">¥5399.00</div>
<div class="number">
<button οnclick="calc(this)">-</button>
<span> 1 </span>
<button οnclick="calc(this)">+</button>
</div>
<div class="total">¥5399.00</div>
<div class="opreate"><a href="#">洗掉</a></div>
</div>
</div>
<div class="Bottombox">
<div class="bottombox">
<ul>
<li><input type="checkbox" checked id="checkAll" />全選</li>
<li><a href="#">洗掉選中商品</a></li>
<li><a href="#">移到關注</a></li>
<li><a href="#">清理購物車</a></li>
</div>
<div class="rightbottombox">
<div class="select">
已選擇<span>4</span>件商品<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div class="bottomprice">
總價:<span>¥19375.00</span>
</div>
<div class="settlement">
<button>去結算</button>
</div>
</div>
</div>
</div>
<div id="guessyoulike">
<h2 class="guesswhatyoulike">猜你喜歡</h2>
<hr class="guesswhatyoulike1">

<div id="goodlistdiv">
<ul id="goodlist">

</ul>
<div class="left">
<</div> <div class="right">>
</div>
</div>
</div>
</div>
<div id="footer">
<div class="footer1">
<div class="fourzt">
<ul>
<li><img src="img/多_03.png"></li>
<li><i class="ttf">品類齊全,輕松購物</i></li>
<li><img src="img/快_03.png"></li>
<li><i class="ttf">多倉直發,極速配送</i></li>
<li><img src="img/好_03.png"></li>
<li><i class="ttf">正品行貨,精致服務</i></li>
<li><img src="img/?_03.png"></li>
<li><i class="ttf">天天低價,暢選無憂</i></li>
</ul>
</div>
<hr>
<div class="btbox">
<div class="bt1">
<h2>購物指南</h2>
<ul>
<li><a href="#">購物流程</a></li>
<li><a href="#">會員介紹</a></li>
<li><a href="#">生活旅行/團購</a></li>
<li><a href="#">常見問題</a></li>
<li><a href="#">大家電</a></li>
<li><a href="#">聯系客服</a></li>
</ul>
</div>
<div class="bt2">
<h2>配送方式</h2>
<ul>
<li><a href="#">上門自提</a></li>
<li><a href="#">211限時達</a></li>
<li><a href="#">配送服務查詢</a></li>
<li><a href="#">配送費收取標準</a></li>
<li><a href="#">海外配送</a></li>
</ul>
</div>
<div class="bt3">
<h2>支付方式</h2>
<ul>
<li><a href="#">貨到付款</a></li>
<li><a href="#">在線支付</a></li>
<li><a href="#">分期付款</a></li>
<li><a href="#">公司轉賬</a></li>

</ul>
</div>
<div class="bt4">
<h2>售后服務</h2>
<ul>
<li><a href="#">售后政策</a></li>
<li><a href="#">價格保護</a></li>
<li><a href="#">退款說明</a></li>
<li><a href="#">返修/退換貨</a></li>
<li><a href="#">取消訂單</a></li>
</ul>
</div>
<div class="bt5">
<h2>特色服務</h2>
<ul>
<li><a href="#">奪寶島</a></li>
<li><a href="#">DIY裝機</a></li>
<li><a href="#">延保服務</a></li>
<li><a href="#">京東E卡</a></li>
<li><a href="#">京東通信</a></li>
<li><a href="#">京東魚智能</a></li>
</ul>
</div>
</div>
<hr>
<div class="dxbox">
<div class="dbdht">
<ul>
<li><a href="#">關于我們</a></li>
<li><span>|</span></li>
<li><a href="#">聯系我們</a></li>
<li><span>|</span></li>
<li><a href="#">聯系客服</a></li>
<li><span>|</span></li>
<li><a href="#">合作招商</a></li>
<li><span>|</span></li>
<li><a href="#">商家幫助</a></li>
<li><span>|</span></li>
<li><a href="#">營銷中心</a></li>
<li><span>|</span></li>
<li><a href="#">手機京東</a></li>
<li><span>|</span></li>
<li><a href="#">友情鏈接</a></li>
<li><span>|</span></li>
<li><a href="#">銷售聯盟</a></li>
<li><span>|</span></li>
<li><a href="#">京東社區</a></li>
<li><span>|</span></li>
<li><a href="#">風險監測</a></li>
<li><span>|</span></li>
<li><a href="#">隱私政策</a></li>
<li><span>|</span></li>
<li><a href="#">京東公益</a></li>
<li><span>|</span></li>
<li><a href="#">English Site</a></li>
<li><span>|</span></li>
<li><a href="#">Media&ensp;&&ensp;IR</a></li>
</ul>
</div>
<div class="dbdht1">
<ul>
<li><a href="#">京公網安備&ensp;11000002000088號</a></li>
<li><span>|</span></li>
<li>京ICP證070359號</li>
<li><span>|</span></li>
<li><a href="#">互聯網藥品資訊服務資格證編號(京)-經營性-2014-0008</a></li>
<li><span>|</span></li>
<li>新出發京零 字第大120007號</li>
</ul>
</div>
<div class="dbdht2">
<ul>
<li>互聯網出版許可證編號新出網證(京)字150號</li>
<li><span>|</span></li>
<li><a href="#">出版物經營許可證</a></li>
<li><span>|</span></li>
<li><a href="#">網路文化經營許可證京網文[2014]2148-348號</a></li>
<li><span>|</span></li>
<li>違法和不良資訊舉報電話:4006561155</li>
<li><span>|</span></li>
</ul>
</div>
<div class="dbdht3">
<ul>
<li>
<p>Copyright ? 2004-2020京東JD.com著作權所有</p>
</li>
<li><span>|</span></li>
<li>消費者維權熱線:4006067733 <a href="#">經營證照 </a></li>
<li><span>|</span></li>
<li> (京)網械平臺備字(2018)第00003號 </li>
<li><span>|</span></li>
<li><a href="#"> 營業執照</a></li>

</ul>
</div>
<div class="dbdht4">
<ul>
<li><img src="img/國旗_03.png"></li>
</ul>
</div>
<div class="dbdht5">
<ul>
<li>京東旗下網站: <a href="#">京東錢包</a>
<li>
<li><span>|</span></li>
<li> <a href="#">京東智聯云</a></li>
</ul>
</div>
<div class="dbdht6">
<ul>
<ul>
<li><img src="img/網站_03.png"></li>
<li class="zt">可信網站</br>信用評價</li>
<li><img src="img/網警_03.png"></li>
<li class="zt">網路警察</br>提醒你</li>
<li><img src="img/誠信_03.png"></li>
<li class="zt1">誠信網站</li>
<li><img src="img/互聯_03.png"></li>
<li class="zt">網上有害信</br>息舉報專區</li>
<li><img src="img/下載_03.png"></li>
<li class="zt">網路舉報</br>APP下載</li>

</ul>
</div>
</div>
</div>

</div>
</div>
</body>
<script type="text/javascript">
//手動輪播
//獲取左右按鈕,加單擊事件
var guessyoulike = document.getElementById("guessyoulike");
var leftDiv = guessyoulike.getElementsByClassName("left")[0];
var rightDiv = guessyoulike.getElementsByClassName("right")[0];
var ul = document.getElementById("goodlist");

//向左移動
var timer = null;
leftDiv.onclick = leftMove;

function leftMove() {
//獲取ul當前的left值
var left = Math.ceil(ul.offsetLeft / 280) * 280; //重新計算left值是280的倍數
left -= 280;
if (left < -1120) {
left = 0;
}
//運動效果
//ul.style.left=left+"px";
clearInterval(timer); //停止上次定時器
timer = setInterval(function() { //開啟定時器兩個引數
leftDiv.onclick = null; //一次運動沒有完成時不能再次點擊
if (ul.offsetLeft > left) { //還沒到目標位置
var newLeft = ul.offsetLeft - 5; //計算一小步
ul.style.left = newLeft + "px"; //運動一小步
} else {
clearInterval(timer); //停止定時器
ul.style.left = left + "px"; //修正最終位置
leftDiv.onclick = leftMove; //本次定時器結束單擊事件再次有效
}

}, 20); //每隔20秒呼叫一次函式
}
//向右移動
rightDiv.onclick = rightMove;

function rightMove() {
//獲取ul當前的left值
var left = Math.ceil(ul.offsetLeft / 280) * 280;
left += 280;
if (left > 150) {
left = -1120;
}
//ul.style.left=left+"px";
clearInterval(timer);
timer = setInterval(function() {
rightDiv.onclick = null;
if (ul.offsetLeft < left) { //還沒到目標位置
var newLeft = ul.offsetLeft + 5;
ul.style.left = newLeft + "px";
} else {
clearInterval(timer);
ul.style.left = left + "px";
rightDiv.onclick = rightMove;
}
}, 20)
}
//滑鼠滑入和滑出時左右箭頭現實
var autoMoveTimer = null;
guessyoulike.onmouseover = function() { //顯示
leftDiv.style.display = "block";
rightDiv.style.display = "block";
clearInterval(autoMoveTimer);
}
guessyoulike.onmouseout = function() { //隱藏
leftDiv.style.display = "none";
rightDiv.style.display = "none";
autoMove();
}
//自動輪播
function autoMove() {
var left = -1120;
autoMoveTimer = setInterval(function() {
if (ul.offsetLeft > left) {
var newLeft = ul.offsetLeft - 1;
ul.style.left = newLeft + "px";
} else {
ul.style.left = 0;
}
}, 20)
}
autoMove();


//添加商品到購物車
//1.自動生成商品串列
//商品資料
var goodsArr = [{
imgUrl: "img/phone.jpg",
name: "華為(HUAWEI)榮耀9Play3",
price: "868"
},
{
imgUrl: "img/phone2.jpg",
name: "天語H5全面屏",
price: "668"
},
{
imgUrl: "img/phone3.jpg",
name: "OPPO Find X2手機",
price: "4999"
},
{
imgUrl: "img/phone4.jpg",
name: "vivo X50 5G手機",
price: "3498"
},
{
imgUrl: "img/phone5.jpg",
name: "三星 Galaxy A90",
price: "2699"
},
{
imgUrl: "img/phone6.jpg",
name: "Redmi 10X天璣820",
price: "1799"
},
{
imgUrl: "img/phone7.jpg",
name: "vivo S5 8GB+128GB",
price: "1998"
},
{
imgUrl: "img/phone8.jpg",
name: "vivo X30 雙模5G",
price: "2998"
},
];
//把以上商品放入ul串列
//獲取存放的商品ul
var goodlist = document.getElementById("goodlist");
//遍歷陣列通過函式來進行處理
//創建li
goodsArr.forEach(function(el, idx) {
var li = document.createElement("li");
goodlist.appendChild(li);
//創建li中的內容
var htmlStr = "<div><img src='" + el.imgUrl + "'></div>"
htmlStr += "<div>" + el.name + "</div>";
htmlStr += "<div>&yen;" + el.price + "</div>";
htmlStr += "<div οnclick='addCart(" + idx + ")'><a href='#'>添加到購物車</a></div>";
li.innerHTML = htmlStr;
})

//實作商品到購物車
function addCart(i) {
//一.如果添加的商品已經在購物車存在,則在數量上增加即可
//通過要添加的商品名稱與購物車商品名稱對比
//如果有相同的名稱,則表示此商品已經添加過
//(1)獲取購物車中所有的商品名稱
//(a)獲取content5所有行
var content5 = document.getElementById("content5");
var alldiv = content5.children;
//console.log(alldiv);
//(b)獲取所有商品名稱
var allGoodsNameArr = [];
for (var k = 0; k < alldiv.length; k++) {
//console.log(k);
//console.log(alldiv[k]);
allGoodsNameArr.push(alldiv[k].children[2].innerText);
//console.log(alldiv[k].children.length);
}
//(2)查找要添加的商品名稱是否存在于購物車
var index = allGoodsNameArr.findIndex(function(v) {
return v == goodsArr[i].name;
}); //回傳-1,表示在陣列中不存在要比較的物件
if (index != -1) { //如果添加的商品已經存在于購物車中
//獲取已添加商品中所在盒子中的數量加1
var n = alldiv[index].getElementsByTagName("span")[0].innerText;
n++;
alldiv[index].getElementsByTagName("span")[0].innerText = n;
//更新小計 單價*數量
var price = alldiv[index].getElementsByClassName('price')[0].innerText.substr(1);
console.log(price);
alldiv[index].getElementsByClassName('total')[0].innerHTML = "&yen;" + n * price;

//更新總計
total();
return; //不再執行下面的代碼,即購物車中不再添加新行
}
var content5 = document.getElementById("content5");
var newDiv = document.createElement("div");
var phonebox1 = newDiv.classList.add("phonebox1");
content5.appendChild(newDiv);
//二.如果購物車沒有此商品,則商品添加此商品到購物車中

var newDiv1 = document.createElement("div");
newDiv.appendChild(newDiv1);
var check = newDiv1.classList.add("check");
var newCheckbox = document.createElement("input");
newCheckbox.setAttribute("type", "checkbox");
newCheckbox.setAttribute("checked", true);
newDiv1.appendChild(newCheckbox);

console.log(allCheckbox.length);
var arr = Array.from(allCheckbox);
checkAll.checked = arr.every(function(v) {
return v.checked;
});
//實作復選功能
newCheckbox.onchange = function() {
// var arr = Array.from(allCheckbox);
//只要陣列中元素的checked值有一個為假,every函式的回傳值為假
checkAll.checked = arr.every(function(v) {
return v.checked;
});
total();
}
//放入圖片
var newDiv2 = document.createElement("div");
newDiv.appendChild(newDiv2);
var phonepicture = document.createElement("img");
newDiv2.appendChild(phonepicture);
phonepicture.src = goodsArr[i].imgUrl;
phonepicture.width = 104;
phonepicture.height = 104;
newDiv2.className = 'phonepicture1';
//放入商品名稱
var newDiv3 = document.createElement("div");
newDiv.appendChild(newDiv3);
var phoneinformation = document.createElement("a");
phoneinformation.setAttribute("href", "#");
newDiv3.appendChild(phoneinformation);
phoneinformation.innerText = goodsArr[i].name;
phoneinformation.width = 300;
phoneinformation.height = 100;
newDiv3.className = 'phoneinformation';
//放入一個空盒子
var newDiv4 = document.createElement("div");
newDiv4.className = 'phonechoose1';
newDiv.appendChild(newDiv4);
//放入單價
var newDiv5 = document.createElement("div");
newDiv5.className = 'price';
newDiv.appendChild(newDiv5);
newDiv5.innerHTML = "&yen;" + goodsArr[i].price;
//放入數量
var newDiv6 = document.createElement("div");
newDiv6.className = 'number';
newDiv.appendChild(newDiv6);
newDiv6.innerHTML = '<button οnclick="calc(this)">-</button><span> 1 </span><button οnclick="calc(this)">+</button>';
//放入小計
var newDiv7 = document.createElement("div");
newDiv7.className = 'total';
newDiv.appendChild(newDiv7);
newDiv7.innerHTML = "&yen;" + goodsArr[i].price;
total();
//洗掉操作
var newDiv8 = document.createElement("div");
newDiv8.className = 'opreate';
newDiv.appendChild(newDiv8);
newDiv8.innerHTML = "<a href='#'>洗掉</a>";
newDiv8.getElementsByTagName('a')[0].onclick = function() {
this.parentNode.parentNode.remove(); //洗掉行
total();

var arr = Array.from(allCheckbox);
//只要陣列中元素的checked值有一個為假,every函式的回傳值為假
checkAll.checked = arr.every(function(v) {
return v.checked;
});
//洗掉全部商品后全選按鈕不再被選中
if (allCheckbox.length === 0) {
checkAll.checked = false;
}
};


}

//洗掉
var content5 = document.getElementById("content5");
var allA = content5.getElementsByTagName("a"); //拿到所有a
//console.log(allA);
for (var i = 1; i < allA.length; i += 2) { //遍歷奇數a
allA[i].onclick = function() {
this.parentNode.parentNode.remove(); //洗掉整個盒子
total(); //重新總計
//由每一個盒子復選框狀態決定全選按鈕狀態
//把復選框集合轉成陣列
var arr = Array.from(allCheckbox);
//只要陣列中元素的checked值有一個為假,every函式的回傳值為假
checkAll.checked = arr.every(function(v) {
return v.checked;
});
//洗掉全部商品后全選按鈕不再被選中
if (allCheckbox.length === 0) {
checkAll.checked = false;
}
}
}
//獲取全選按鈕復選框
var checkAll = document.getElementById("checkAll");

var content5 = document.getElementById("content5");
var allCheckbox = content5.getElementsByTagName("input"); //獲取盒子中所有的復選框
console.log(allCheckbox.length);
for (var i = 0; i < allCheckbox.length; i++) {
allCheckbox[i].onchange = function() {
total();
//由每一個盒子復選框狀態決定全選按鈕狀態
//把復選框集合轉成陣列
var arr = Array.from(allCheckbox);
//只要陣列中元素的checked值有一個為假,every函式的回傳值為假
checkAll.checked = arr.every(function(v) {
return v.checked;
}); //對陣列里每個元素進行遍歷
}
}

//全選和全不選功能實作
checkAll.onchange = function() {
for (var i = 0; i < allCheckbox.length; i++) {
allCheckbox[i].checked = checkAll.checked;
}
total();
}


//*****************01
function total() {

//三.總計
var content5 = document.getElementById("content5");
var alldiv = content5.children;
var allCheckbox = content5.getElementsByTagName("input"); //獲取盒子中所有的復選框
//console.log(allCheckbox);
var total = 0;
for (var i = 0; i < alldiv.length; i++) {
//累加復選框選中的盒子進行小計
if (allCheckbox[i].checked) { //復選框選中狀態
total += parseFloat(alldiv[i].children[6].innerText.substr(1));
}
}
//console.log(total);
//找到最后一個總計
var content = document.getElementById("content");
var Bottombox = content.getElementsByClassName("Bottombox")[0];
var rightbottombox = Bottombox.getElementsByClassName("rightbottombox")[0];
var bottomprice = rightbottombox.getElementsByClassName("bottomprice")[0];
//console.log(bottomprice);
bottomprice.innerHTML = "總價" + "&yen;" + total.toFixed(2);
}

function calc(btn) {
//一.數量增減
var div = btn.parentNode;
var spanArr = div.getElementsByTagName("span");
var span = spanArr[0];
var n = parseInt(span.innerText);
if (btn.innerText == '-') {
n--;
if (n < 1) {
n = 1;
}
} else {
n++;
}
span.innerText = n;
//二.小計
var pricediv = div.previousElementSibling;
var price = pricediv.innerText.substr(1);
var sumdiv = div.nextElementSibling;
sumdiv.innerHTML = "&yen;" + price * n;
total();
}
</script>
</html>

二.css部分

*{
margin: 0px;
padding: 0px;
}
body{
font-size:15px ;
font-family: "黑體";
}
ul li{
list-style: none;
}
ul li a{
text-decoration: none;
}
#contain{
width: 1920px;
}
#banner{
width: 1920px;
height: 40px;
background: lightgrey;


}
#content{
width: 1250px;
margin: 0px auto;
}
#footer{
width: 1920px;
height: 840px;
background: #EEEEEE;
display: flex;
align-items: center;
justify-content: center;
}
.banner1{
width: 1250px;
height: 40px;
margin: 0px auto;
display: flex;
align-items: center;
justify-content: space-between;
}
.banner2{
width: 162px;
height: 25px;


}
.banner3{
width: 864px;
height: 25px;

}
.content1{
width: 1250px;
height: 140px;
display: flex;
align-items: center;
justify-content: space-between;
}
.logo{
width: 270px;
height: 80px;
font-size: 25px;

}
.logo a{
text-decoration: none;
color: black;
position: relative;
bottom: 15px;
}
.from{
width: 420px;
height: 34px;
border: 3px solid #e2231a;
}
.content2{
width: 1250px;
height: 60px;
background: lightgoldenrodyellow;
display: flex;
align-items: center;
border: 1px solid yellow;

}
.content3{
width: 1250px;
}
#guessyoulike{
width:1250px ;
height: 466px;
margin: 0px auto;
margin-top: 20px;
overflow: scroll;
position: relative;
}
.footer1{
width: 1250px;
height: 760px;

}
.fourzt{
width: 1110px;
height: 60px;
margin: 0px auto;
margin-top: 20px;
}
.btbox{
width: 1110px;
height: 320px;
margin: 0px auto;
display: flex;
align-items: center;
justify-content: flex-start;
}
.dxbox{
width: 1250px;
height: 300px;

}
.bt1{
width: 105px;
height: 200px;

}
.bt2{
width: 115px;
height: 200px;
margin-left:130px ;
}
.bt3{
width: 105px;
height: 200px;

margin-left:110px ;
}
.bt4{
width: 105px;
height: 200px;

margin-left: 140px;
}
.bt5{
width: 100px;
height: 200px;

margin-left: 145px;
}
.dbdht{
width: 1250px;
height: 40px;
}
.dbdht1{
width: 960px;
height: 30px;
margin: 0px auto;
}
.dbdht2{
width: 1054px;
height: 30px;
margin: 0px auto;
}
.dbdht3{
width: 980px;
height: 30px;
margin: 0px auto;
}
.dbdht4{
width: 809px;
height: 30px;
margin: 0px auto;
}
.dbdht5{
width: 687px;
height: 50px;
margin:0px auto;
}
.banner2 ul li{
float: left;

}
.banner2 ul li a:hover{
color: red;
}
.banner2 ul li a{
color: lightslategrey;
}
.banner2 ul{
margin-top:5px ;
}
.banner3 ul li{
float: left;
}
.banner3 ul{
margin-left: 300px;
margin-top: 5px;
color: grey;
}
.banner3 ul li a:hover{
color: red;
}
.banner3 ul li a{
color: grey;
}
.search{
width: 365px;
height: 34px;
border: 1px solid transparent;
background: transparent;
line-height: 34px;
overflow: hidden;
}
.button{
width: 58px;
height: 34px;
background: #E2231A;
border: 1px solid transparent;
outline: none;
cursor: pointer;
position: absolute;
top: 93px;
right: 315px;
}
button:hover{
background-color:#c81623 ;
}
.dl{
width: 700px;
height: 32px;
margin-left: 50px;
}
.dl1{
width: 73px;
height: 30px;
background: #C81623;
}
.dl1:hover{
color: red;
}
.dl ul li{
float: left;
}
.sanjiao{
margin-top:10px ;
}
.denglu{
font-size: 20px;
color: darkorange;

}
.fourzt ul li{
float: left;
font-size:20px ;
color: black;
}
.bt1 ul li a:hover{
color: red;
}
.bt1 ul li a{
color:grey ;
font-size: 16px;
margin-top: 10px;
}
.bt1 ul li{
padding-top: 5px;
}
h2{
color: #777;
}
.bt2 ul li a:hover{
color: red;
}
.bt2 ul li a{
color:grey ;
font-size: 16px;
margin-top: 10px;
}
.bt2 ul li{
padding-top: 5px;
}
.bt3 ul li a:hover{
color: red;
}
.bt3 ul li a{
color:grey ;
font-size: 16px;
margin-top: 10px;
}
.bt3 ul li{
padding-top: 5px;
}
.bt4 ul li a:hover{
color: red;
}
.bt4 ul li a{
color:grey ;
font-size: 16px;
margin-top: 10px;
}
.bt4 ul li{
padding-top: 5px;
}
.bt5 ul li a:hover{
color: red;
}
.bt5 ul li a{
color:grey ;
font-size: 16px;
margin-top: 10px;
}
.bt5 ul li{
padding-top: 5px;
}
.dbdht ul li{
float: left;
margin-top: 10px;
margin-left:5px ;
}
.dbdht ul li a:hover{
color: red;
}
.dbdht ul li a{
color: grey;
font-size: 15px;
}
span{
color: grey;
}
.dbdht1 ul li{
float: left;
margin-top:5px ;
color: grey;
padding-right: 5px;
}
.dbdht1 ul li a{
color: grey;
}
.dbdht1 ul li a:hover{
color: red;
}
.dbdht2 ul li{
float: left;
margin-top:5px ;
color: grey;
padding-right: 5px;
}
.dbdht2 ul li a{
color: grey;
}
.dbdht2 ul li a:hover{
color: red;
}
.dbdht3 ul li{
float: left;
padding-right: 5px;
color: grey;
margin-top: 5px;
}
.dbdht3 ul li a{
color: grey;
}
.dbdht3 ul li a:hover{
color: red;
}
.dbdht3 ul li p{
margin-top: -2px;
}
.dbdht5 ul li{
float: left;
padding-right: 5px;
color: grey;
margin-top: 5px;
}
.dbdht5 ul li a{
color: grey;
}
.dbdht5 ul li a:hover{
color: red;
}
.dbdht5 ul{
margin-left:150px;
}
.dbdht6 ul li{
float: left;
}
.dbdht6 {
width: 686px;
height: 50px;
margin: 0px auto;
}
.zt{
position: relative;
bottom: 2px;
color: dimgrey;
padding-right: 20px;
}
.zt1{
position: relative;
top: 5px;
color: dimgrey;
padding-right: 20px;
}
h3{
margin-top: 10px;
padding-left:10px ;
padding-right: 10px;
}
.sp a{
color: red;
font-size: 20px;
text-decoration: none;

}
.sp em{
font-style:normal ;
display: block;
line-height:40px ;
}
.sp1 hr{
border-bottom:1px solid red ;
margin-top: 8px;
}
.dq ul li{
float: left;
font-size: 18px;

}
.dq1{
width: 220px;
height: 27px;
margin-top: -2px;
font-size: 17px;

}
.dq2{
margin-left:16px ;
}
.jdsp{
width: 1250px;
height: 53px;
display: flex;
align-items: center;
justify-content: space-between;
}
.operationbox{
width: 1250px;
height: 52px;
display: flex;
align-items: center;
background: lightgrey;
}
.phonebox{
width: 1250px;
height: 272px;
background: #FFFF00;
display: flex;
align-items: center;
border:2px solid ;
border-color:grey mintcream mintcream mintcream;
}
.phonebox1{
width: 1250px;
height: 272px;

border:2px solid ;
border-color:grey mintcream mintcream mintcream;
display: flex;
align-items: center;

}

.Bottombox{
width: 1250px;
height: 69px;
border: 1px solid white;
display: flex;
align-items: center;
justify-content: space-between;
}
.allshopping{
width: 110px;
height: 40px;
font-size: 20px;
line-height: 40px;
}
.allshopping ul li{
color: red;
}
.underscorecharacter{
margin-top:4px ;
border-color: red;
}
em,i,u{
font-style: normal;
}
.ttf{
position: relative;
top: 5px;
}
.fourzt ul li{
font-size: 25px;
color: #000000;
}
.region{
width: 260px;
height: 40px;
font-size: 15px;
margin-top: 10px;
line-height: 30px;

}
.region ul li{
float: left;
}
.area{
width: 190px;
height: 31px;
}
.allcheck{
text-align: center;
width: 133px;
height: 32px;
line-height: 25px;
}
.shopping{
width: 208px;
height: 32px;
line-height: 27px;
text-align: center;
}
.nullbox{
width: 300px;
height: 32px;
}
.unitprice{
width: 160px;
height: 32px;
text-align: right;
line-height: 25px;
}
.amount{
width: 140px;
height: 32px;
text-align: center;
line-height: 25px;
}
.subtotal{
width: 140px;
height: 32px;
text-align: right;
line-height:25px ;
}
.system{
width: 75px;
height: 32px;
line-height: 25px;
text-align: right;
}
.check{
width: 16px;
height: 100px;
text-align: right;
margin-left: 40px;
}
.phonepicture{
width: 142px;
height: 100px;
text-align: center;
}
a{
text-decoration: none;
color: black;
}
a:hover{
color: red;
}
.phoneinformation{
width: 300px;
height: 100px;
text-align: center;
}
.phonechoose{
width: 250px;
height: 100px;
}
.price{
width: 100px;
height: 100px;
}
.number{
width: 180px;
height: 100px;

}
.total{
width:98px ;
height: 100px;
}
.opreate{
height: 100px;
}
.bottombox{
width: 343px;
height: 27px;
text-align: center;
}
.bottombox ul li{
float: left;
padding-left: 5px;
padding-top: 5px;
}
.bottombox ul{
margin-left: 43px;
}
.rightbottombox{
width: 490px;
height: 68px;
display: flex;
}
.select{
height: 69px;
}
.bottomprice{
margin-left: 20px;
font-size: 30px;
color: grey;

}
.bottomprice span{
color: red;
}
.settlement button{
position: relative;
left: 5px;
margin-left:10px;
padding:20px;
padding-left:20px;
width:120px;
background:#F00;
font-size:18px;
font-weight: 800;
color:#FFF

}
.guesswhatyoulike{
color: red;
}
.guesswhatyoulike1{
width: 90px;
border-color:red ;
}
#goodlist li{
float: left;
width: 280px;
height: 360px;
border: 1px dashed #CACACA;
margin-top: 5px;
}
.phonechoose1{
width: 300px;
height: 100px;
}
#goodlist{
width: 2260px;
height: 400px;
border: 1px dashed #cacaca;
position: absolute;
margin-top: 2px;
}
#guessyoulike .left,#guessyoulike .right{
position: absolute;
width: 40px;
height: 100px;
line-height: 100px;
background-color: lightgray;
top: 100px;
font-size: 40px;
display: none;
}
#guessyoulike .left{
left: 0;
}
#guessyoulike .right{
right: 0;
text-align: center;

}
#goodlistdiv{
width:1130px ;
height: 370px;
margin-left: 46px;
margin-right: 46px;
position: absolute;
overflow: hidden;
}

轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/231017.html

標籤:其他

上一篇:瀏覽器渲染網頁程序

下一篇:CSS3簡易切割輪播圖

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • vue移動端上拉加載

    可能做得過于簡單或者比較low,請各位大佬留情,一起探討技術 ......

    uj5u.com 2020-09-10 04:38:07 more
  • 優美網站首頁,頂部多層導航

    一個個人用的瀏覽器首頁,可以把一下常用的網站放在這里,平常打開會比較方便。 第一步,HTML代碼 <script src=https://www.cnblogs.com/szharf/p/"js/jquery-3.4.1.min.js"></script> <div id="navigate"> <ul> <li class="labels labels_1"> ......

    uj5u.com 2020-09-10 04:38:47 more
  • 頁面為要加<!DOCTYPE html>

    最近因為寫一個js函式,需要用到$(window).height(); 由于手寫demo的時候,過于自信,其實對前端方面的認識也不夠體系,用文本檔案直接敲出來的html代碼,第一行沒有加上<!DOCTYPE html> 導致了$(window).height();的結果直接是整個document的高 ......

    uj5u.com 2020-09-10 04:38:52 more
  • WordPress網站程式手動升級要做好資料備份

    WordPress博客網站程式在進行升級前,必須要做好網站資料的備份,這個問題良家佐言是遇見過的;在剛開始接觸WordPress博客程式的時候,因為升級問題和博客網站的修改的一些嘗試,良家佐言是吃盡了苦頭。因為購買的是西部數碼的空間和域名,每當佐言把自己的WordPress博客網站搞到一塌糊涂的時候 ......

    uj5u.com 2020-09-10 04:39:30 more
  • WordPress程式不能升級為5.4.2版本的原因

    WordPress是一款個人博客系統,受到英文博客愛好者和中文博客愛好者的追捧,并逐步演化成一款內容管理系統軟體;它是使用PHP語言和MySQL資料庫開發的,用戶可以在支持PHP和MySQL資料庫的服務器上使用自己的博客。每一次WordPress程式的更新,就會牽動無數WordPress愛好者的心, ......

    uj5u.com 2020-09-10 04:39:49 more
  • 使用CSS3的偽元素進行首字母下沉和首行改變樣式

    網頁中常見的一種效果,首字改變樣式或者首行改變樣式,效果如下圖。 代碼: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, ......

    uj5u.com 2020-09-10 04:40:09 more
  • 關于a標簽的講解

    什么是a標簽? <a> 標簽定義超鏈接,用于從一個頁面鏈接到另一個頁面。 <a> 元素最重要的屬性是 href 屬性,它指定鏈接的目標。 a標簽的語法格式:<a href=https://www.cnblogs.com/summerxbc/p/"指定要跳轉的目標界面的鏈接">需要展示給用戶看見的內容</a> a標簽 在所有瀏覽器中,鏈接的默認外觀如下: 未被訪問的鏈接帶 ......

    uj5u.com 2020-09-10 04:40:11 more
  • 前端輪播圖

    在需要輪播的頁面是引入swiper.min.js和swiper.min.css swiper.min.js地址: 鏈接:https://pan.baidu.com/s/15Uh516YHa4CV3X-RyjEIWw 提取碼:4aks swiper.min.css地址 鏈接:https://pan.b ......

    uj5u.com 2020-09-10 04:40:13 more
  • 如何設定html中的背景圖片(全屏顯示,且不拉伸)

    1 <style>2 body{background-image:url(https://uploadbeta.com/api/pictures/random/?key=BingEverydayWallpaperPicture); 3 background-size:cover;background ......

    uj5u.com 2020-09-10 04:40:16 more
  • Java學習——HTML詳解(上)

    HTML詳解 初識HTML Hyper Text Markup Language(超文本標記語言) 1 <!--DOCTYPE:告訴瀏覽器我們要使用什么規范--> 2 <!DOCTYPE html> 3 <html lang="en"> 4 <head> 5 <!--meta 描述性的標簽,描述一些 ......

    uj5u.com 2020-09-10 04:40:33 more
最新发布
  • 我的第一個NPM包:panghu-planebattle-esm(胖虎飛機大戰)使用說明

    好家伙,我的包終于開發完啦 歡迎使用胖虎的飛機大戰包!! 為你的主頁添加色彩 這是一個有趣的網頁小游戲包,使用canvas和js開發 使用ES6模塊化開發 效果圖如下: (覺得圖片太sb的可以自己改) 代碼已開源!! Git: https://gitee.com/tang-and-han-dynas ......

    uj5u.com 2023-04-20 07:59:23 more
  • 生產事故-走近科學之消失的JWT

    入職多年,面對生產環境,盡管都是小心翼翼,慎之又慎,還是難免捅出簍子。輕則滿頭大汗,面紅耳赤。重則系統停擺,損失資金。每一個生產事故的背后,都是寶貴的經驗和教訓,都是專案成員的血淚史。為了更好地防范和遏制今后的各類事故,特開此專題,長期更新和記錄大大小小的各類事故。有些是親身經歷,有些是經人耳傳口授 ......

    uj5u.com 2023-04-18 07:55:04 more
  • 記錄--Canvas實作打飛字游戲

    這里給大家分享我在網上總結出來的一些知識,希望對大家有所幫助 打開游戲界面,看到一個畫面簡潔、卻又富有挑戰性的游戲。螢屏上,有一個白色的矩形框,里面不斷下落著各種單詞,而我需要迅速地輸入這些單詞。如果我輸入的單詞與螢屏上的單詞匹配,那么我就可以獲得得分;如果我輸入的單詞錯誤或者時間過長,那么我就會輸 ......

    uj5u.com 2023-04-04 08:35:30 more
  • 了解 HTTP 看這一篇就夠

    在學習網路之前,了解它的歷史能夠幫助我們明白為何它會發展為如今這個樣子,引發探究網路的興趣。下面的這張圖片就展示了“互聯網”誕生至今的發展歷程。 ......

    uj5u.com 2023-03-16 11:00:15 more
  • 藍牙-低功耗中心設備

    //11.開啟藍牙配接器 openBluetoothAdapter //21.開始搜索藍牙設備 startBluetoothDevicesDiscovery //31.開啟監聽搜索藍牙設備 onBluetoothDeviceFound //30.停止監聽搜索藍牙設備 offBluetoothDevi ......

    uj5u.com 2023-03-15 09:06:45 more
  • canvas畫板(滑鼠和觸摸)

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>canves</title> <style> #canvas { cursor:url(../images/pen.png),crosshair; } #canvasdiv{ bo ......

    uj5u.com 2023-02-15 08:56:31 more
  • 手機端H5 實作自定義拍照界面

    手機端 H5 實作自定義拍照界面也可以使用 MediaDevices API 和 <video> 標簽來實作,和在桌面端做法基本一致。 首先,使用 MediaDevices.getUserMedia() 方法獲取攝像頭媒體流,并將其傳遞給 <video> 標簽進行渲染。 接著,使用 HTML 的 < ......

    uj5u.com 2023-01-12 07:58:22 more
  • 記錄--短視頻滑動播放在 H5 下的實作

    這里給大家分享我在網上總結出來的一些知識,希望對大家有所幫助 短視頻已經無數不在了,但是主體還是使用 app 來承載的。本文講述 H5 如何實作 app 的視頻滑動體驗。 無聲勝有聲,一圖頂百辯,且看下圖: 網址鏈接(需在微信或者手Q中瀏覽) 從上圖可以看到,我們主要實作的功能也是本文要講解的有: ......

    uj5u.com 2023-01-04 07:29:05 more
  • 一文讀懂 HTTP/1 HTTP/2 HTTP/3

    從 1989 年萬維網(www)誕生,HTTP(HyperText Transfer Protocol)經歷了眾多版本迭代,WebSocket 也在期間萌芽。1991 年 HTTP0.9 被發明。1996 年出現了 HTTP1.0。2015 年 HTTP2 正式發布。2020 年 HTTP3 或能正... ......

    uj5u.com 2022-12-24 06:56:02 more
  • 【HTML基礎篇002】HTML之form表單超詳解

    ??一、form表單是什么

    ??二、form表單的屬性

    ??三、input中的各種Type屬性值

    ??四、標簽 ......

    uj5u.com 2022-12-18 07:17:06 more