inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

HTML+CSS+JS 포트폴리오 실전 퍼블리싱(시즌1)

순서 체크 가상클래스 활용한 실전 퍼블리싱 03(Flexbox 활용한 갤러리 이미지 어코디언 네비게이션)

li(이미지) 전부를 흑백으로 하고 hover하면 색 이 들어가도록

534

코등학생

작성한 질문수 3

1

취향상 수업내용과 반대로 해보았는데 li에 전부 흑백을 주면 프레임이 느려지네요,, 왜이런 현상이 생길까요 

그리고 크로스브라우징을 고려해서 filter 속성을 거의 사용하지 않는다 하셨는데 그럼 필터효과를 주려면 주로 어떤 다른속성을 사용해야하나요??

아래에 중복된 코드이미지가 안사라지네요ㅜ 위에꺼만 봐주세요

.gallery{
    display: flex;
    height: 100vh;
}

.gallery li{
    border-right: 5px solid black;
    flex: 1;
    transition: 0.5s;
    filter: grayscale(1);
}

.gallery li:last-child{
    border-right: none;
}

.gallery li:nth-child(1){
    background: url(../images/artistic-image-01.jpg)
    no-repeat center center;
}

.gallery li:nth-child(2){
    background: url(../images/artistic-image-02.jpg)
    no-repeat center center;
}

.gallery li:nth-child(3){
    background: url(../images/artistic-image-03.jpg)
    no-repeat center center;
}

.gallery li:nth-child(4){
    background: url(../images/artistic-image-04.jpg)
    no-repeat center center;
}

.gallery li:nth-child(5){
    background: url(../images/artistic-image-05.jpg)
    no-repeat center center;
}

.gallery li:hover{
    flex: 3;
    filter: grayscale(0);
}


/* Google Web Font */
@import url('https://fonts.googleapis.com/css?family=Raleway&display=swap');

/* Fontawesome 4.7 */
@import url('https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');

body{
    line-height: 1.5em;
    font-family: 'Arial';
    font-weight: 500;
    margin: 0;
    padding: 0;
    font-family: 'Raleway', sans-serif;
    }

ul,
li{
    padding: 0;
    margin: 0;
    list-style: none;
    
}

a{
    text-decoration: none;
    color: inherit;
}

.gallery{
    display: flex;
    height: 100vh;
}

.gallery li{
    border-right: 5px solid black;
    flex: 1;
    transition: 0.5s;
    filter: grayscale(1);
}

.gallery li:last-child{
    border-right: none;
}

.gallery li:nth-child(1){
    background: url(../images/artistic-image-01.jpg)
    no-repeat center center;
}

.gallery li:nth-child(2){
    background: url(../images/artistic-image-02.jpg)
    no-repeat center center;
}

.gallery li:nth-child(3){
    background: url(../images/artistic-image-03.jpg)
    no-repeat center center;
}

.gallery li:nth-child(4){
    background: url(../images/artistic-image-04.jpg)
    no-repeat center center;
}

.gallery li:nth-child(5){
    background: url(../images/artistic-image-05.jpg)
    no-repeat center center;
}

.gallery li:hover{
    flex: 3;
    filter: grayscale(0);
}


jquery HTML/CSS

답변 1

1

코딩웍스(Coding Works)

프레임이 느려질 정도까지는 아닐텐데.. 컴퓨터 사양이 좀 낮으면 그럴수도 있을 것 같아요.

코드 상에 문제는 전혀 보이지 않습니다.

이 예제는 제가 학원에서도 수업하는 예제인데 프레임이 느려지는 정도를 느껴본 적은 없습니다.

IE에서 필터속성을 사용해 보려고 한적이 없어서 고민해본 적이 없었는데 검색해보니.. 역시나 매우 가성비가 안나오게 복잡하네요.

아래 주소에 있는걸 참고하시면 될 듯 합니다. 저는 해보지는 않았습니다.

https://mainichibenkyo.tistory.com/408

class 값 한 번에 부여하는법

2

80

1

@media에서의 flex-direction: column으로 세로배치 관련 질문드립니다.

1

69

1

div#css-checker-widget의 해결방

1

60

2

input의 포커스되었을때 검정선이 사라지지 않아요

0

79

2

강의듣는법

1

74

1

아코디언 만들기 100%이하의 화면으로 보았을때

1

68

2

input checked 질문합니다.

0

76

1

Bracket Pair Colorizer - 비주얼 스튜디오

1

140

2

Part 1 영상 안나옵니다

1

89

1

제이쿼리 작동이 안됩니다

1

199

3

강의 내용 질문있습니다.

1

120

2

일정 부분만 주석하는 방법

1

211

2

폰트어썸

1

134

2

인접선택자에 대한 질문드립니다!

1

129

2

delay 적용 안됨

1

134

1

rotateY(360deg)가 적용이 안됩니다!

1

186

2

세로이동할때 height값

1

138

2

폰트어썸이 안되요..

1

485

2

화면 정중앙에 오게끔 할수있나요?

1

169

1

어코디언 네비게이션 중

1

125

1

라이브서버 문제

1

226

2

넷플릭스 어코디언 예제 질문

1

104

1

이번 강의에선 display flex가 무조건 적으로 필요한건가요 ?

1

156

1

active 관련 질문

1

145

2