今日学习:JS轮播文字,css布局。学习时长:4h。
.box7{
width: 100%;
height: 1000px;
}
.toupiao{
position: relative;
left: 100px;
width: 500px;
height: 500px;
border-right: 2px solid gray;
}
.T-text{
width: 500px;
height: 60px;
border-bottom: 2px solid gray;
font-size: 30px;
font-weight: 1000;
}
.T-text a{
position: relative;
left: 300px;
font-size: 20px;
font-weight: 500;
cursor: pointer;
user-select: none;
transition: 0.3s;
}
.T-text a:hover{
color: #ff6b19;
}
.toupiao p{
font-size: 25px;
font-weight: 1000;
text-align: center;
}
.T1{
position: relative;
top: 10px;
left: 20px;
width: 150px;
height: 80px;
border-radius: 10px;
background-image: url(img/new7.jpg);
background-size: cover;
cursor: pointer;
}
.T2{
position: relative;
left: 200px;
top: -60px;
width: 250px;
height: 80px;
color: gray;
}
.T3{
position: relative;
top: -60px;
width: 400px;
height: 40px;
margin: 10px;
line-height: 40px;
padding-left: 10px;
background-color: #aee2f8;
border-radius: 10px;
}
.T3 a{
width: 50px;
height: 40px;
position: absolute;
right: -80px;
text-align: center;
line-height: 40px;
cursor: pointer;
background-color: #5ac9fa;
border-radius: 10px;
user-select: none;
}
.T3 a:hover{
background-color: #aee2f8;
transition: 0.2s;
}
.T4{
position: relative;
top: -60px;
width: 480px;
height: 40px;
margin: 10px;
line-height: 40px;
}
.T4 a{
position: absolute;
right: 0px;
top: 8px;
width: 40px;
height: 25px;
background-color: rgb(199, 199, 199);
text-align: center;
line-height: 25px;
border-radius: 5px;
cursor: pointer;
user-select: none;
}
.T4 a:hover{
background-color: rgb(239, 239, 239);
}
.yuanchuang{
width: 700px;
height: 500px;
position: relative;
top: -500px;
left: 600px;
}
.Y-text{
width: 700px;
height: 60px;
border-bottom: 2px solid gray;
font-size: 30px;
font-weight: 1000;
}
.Y-text a{
position: relative;
left: 500px;
font-size: 20px;
font-weight: 500;
cursor: pointer;
user-select: none;
transition: 0.3s;
}
.Y-text a:hover{
color: #ff6b19;
}
.Y1{
width: 300px;
height: 400px;
position: relative;
top: 20px;
left: 10px;
border-radius: 10px;
background-image: url(img/new8.jpg);
cursor: pointer;
}
.Y1:hover{
background-size: 220%;
}
.Y1 a{
background-color: rgb(239, 239, 239,0.7);
width: 300px;
height: 30px;
position: absolute;
bottom: 0px;
}
.Y2{
width: 300px;
height: 100px;
position: absolute;
top: 80px;
right: 50px;
border-radius: 10px;
box-shadow: 5px 5px 10px #ffbc98;
font-size: 20px;
padding: 10px;
user-select: none;
cursor: pointer;
}
.Y2:hover{
color:#ff6b19;
transition: 0.2s;
}
.Y3{
width: 350px;
height: 40px;
position: relative;
left: 320px;
top: -270px;
margin: 15px;
line-height: 40px;
cursor: pointer;
user-select: none;
}
.Y3:hover{
color: #ff6b19;
}
/*即将发布*/
.jijiang{
width: 1100px;
height: 400px;
position: relative;
top:-450px;
left: 100px;
}
.J-text{
width: 1100px;
height: 60px;
font-size: 30px;
font-weight: 1000;
}
.J-text a{
position: relative;
left: 900px;
font-size: 20px;
font-weight: 500;
cursor: pointer;
user-select: none;
transition: 0.3s;
}
.J-text a:hover{
color: #ff6b19;
}
.JB{
width: 1100px;
height: 340px;
display: flex;
}
.J1{
width: 200px;
height: 320px;
position: relative;
margin: 10px;
}
.J1 a{
font-size: 20px;
position: relative;
top: 260px;
left: 5px;
}
.J1 p{
font-size: 15px;
position: relative;
top: 270px;
left: 6px;
color: gray;
}
.J-img1{
width: 200px;
height: 250px;
background-color:#ffa16e;
margin: 0 auto;
border-radius: 10px;
background-image: url(img/new9.jpg);
cursor: pointer;
background-size: cover;
}
.J-img1:hover{
color: #ff6b19;
transition: 0.2s;
}
.J-img2{
width: 200px;
height: 250px;
background-color:#ffa16e;
margin: 0 auto;
border-radius: 10px;
background-image: url(img/new10.jpg);
cursor: pointer;
background-size: cover;
}
.J-img2:hover{
color: #ff6b19;
transition: 0.2s;
}
.J-img3{
width: 200px;
height: 250px;
background-color:#ffa16e;
margin: 0 auto;
border-radius: 10px;
background-image: url(img/new11.jpg);
cursor: pointer;
background-size: cover;
}
.J-img3:hover{
color: #ff6b19;
transition: 0.2s;
}
.J-img4{
width: 200px;
height: 250px;
background-color:#ffa16e;
margin: 0 auto;
border-radius: 10px;
background-image: url(img/new12.png);
cursor: pointer;
background-size: cover;
}
.J-img4:hover{
color: #ff6b19;
transition: 0.2s;
}
.J-img5{
width: 200px;
height: 250px;
margin: 0 auto;
border-radius: 10px;
background-image: url(img/new13.jpg);
cursor: pointer;
background-size: cover;
}
.J-img5:hover{
color: #ff6b19;
transition: 0.2s;
}
-function(){
let newcenter=document.querySelector(".new-center");
newcenter.onmouseover=function(e){
let obj=e.target;
let index=parseInt(obj.getAttribute("data-id"));
let newlist=document.querySelector(".alllist");
newlist.style.left=-500*index+"px";
let brotherAndMe=obj.parentElement.children;
for(let i=0;i<brotherAndMe.length;i++){
brotherAndMe[i].classList.remove("new-active");
}
obj.classList.add('new-active')
}
}()