본문 바로가기
2023/HTML

[HTML]

by Or0i쿠 2023. 4. 18.
display: flex;
자식들을 정렬하도록하는 명령어    
justify-content: center;   
가로 가운데 정렬
align-items: center;
세로 가운데 정렬

/* header */
#header{width: 100%;}

#header .logo{
    width: 200px; height: 100px;
     display: flex;
    justify-content: center;
    align-items: center;
    background-color: black;
    float: left;
}
#header .logo>a{}
#header .logo>a>img{}

#header .nav{float: right;}
#header .nav ul{}
#header .nav ul li{
    width: 150px; height: 50px; 
    line-height: 50px;
    float: left;
}
#header .nav ul li a {
    background-color: black; color: white; display: block;
    text-align: center; 
}
#header .nav ul li a:hover{opacity: 0.5;}
#header .nav ul li .submenu{}
#header .nav ul li .submenu li{}
#header .nav ul li .submenu li a{
    background-color: #555;
}

 

/* layer */
#layer{
    width: 500px; height: 320px; background-color: whitesmoke;
    padding: 30px; border: 5px solid #555; position: absolute;
    top: 20%; left: 40%; transform: translate(-50%,-50%);
    display: none;
}
#layer .title{
    font-size: 28px; display: block; 
    text-align: center; margin-bottom: 20px;
    letter-spacing: 3px; border-bottom: 2px solid black;
    padding-bottom: 20px;
}
#layer .desc{
    display: block; margin-bottom: 30px; line-height: 1.8;
    text-align: justify; font-size: 18px;

}
#layer .desc_sub{
    display: block; margin-bottom: 30px;
}
#layer .close{
    display: block; 
    right: 10px;
    bottom: 10px;
    position: absolute;
    background-color: #555;
    color: white;
    padding: 10px;
}
#layer .close a{
    display: block; background-color: #555;
}
$("#banner>ul>li").hide();
$("#banner>ul>li:first-child").show();
setInterval(function(){            $("#banner>ul>li:firstchild").fadeOut(1500).next().fadeIn(1500).end(3000).appendTo("#banner>ul")        },3000)
        var count = 0;
        setInterval(function(){
            if(count <2){
                //조건이 참일 때 실행
                count = count +1;
            }else{
                //조건이 거짓일 때 실행
                count = 0;
            }
            var sp = count *(-1200)+"px";
            $(".banner>ul").animate({left:sp},500)
        },2500);
console.log(변수값)
콘솔에서 변수값 확인가
        var count = 0;

        setInterval(function(){
            if(count<2){
                count++;
            }
            else{
                count =0;
            }
            var sp = count * (-1200)+"px";
            // console.log(count)
            // console.log(sp);
            $(".list").animate({left:sp},500);
        },3000);
p

'2023 > HTML' 카테고리의 다른 글

[HTML] 입체적인 애니매이션 표현하기  (0) 2023.07.10
[HTML]  (0) 2023.04.19
[HTML] 필터  (0) 2023.04.14
[HTML]  (0) 2023.04.14
[html] 축제 홈페이지 만들기  (0) 2023.04.12