본문 바로가기
SITE/IMGTEXT

SITE | imgTextType #1

by 코딩하자9 2022. 9. 2.
728x90

사이트 이미지/텍스트 유형 #1

이미지와 텍스트로 이루어진 사이트를 만들어봅시다. 이미지 유형과 텍스트 유형을 잘 떠올리면서 도전해보세요 !


1. CSS 살펴보기

/* reset */
li {
    list-style: none;
}
.blind{
    position: absolute;
    clip: rect(0 0 0 0);
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
}

+ 목록 초기화와 블라인드 효과 추가

/* common */
.gray {
    background-color: #f5f5f5;
}

+ 배경색 추가

/* imgTextType */
.imgText__inner {
    display: flex;
    justify-content: space-between;
}
.imgText__inner > div {
    width: 32%;
    height: 500px;
}                                                                                                                                                                
.imgText__txt span {
    font-size: 16px;
    color: #666;
    text-decoration: underline;
    text-underline-position: under;
    margin-bottom: 20px;
    display: block;
}            
.imgText__txt h3 {
    font-size: 50px;
    font-weight: 300;
    word-break: keep-all;
    line-height: 1.4;
    margin-bottom: 20px;
}                
.imgText__txt p {
    font-size: 18px;
    font-weight: 300;
    line-height: 1.5;
    color: #666;
    margin-bottom: 10px;
}
...

+ text-underline-position: under; 텍스트 밑줄 위치를 아래로 잡아줌

...
.imgText__txt ul {
    font-size: 19px;
    font-weight: 300;
    line-height: 1.6;
}    
.imgText__txt ul li {
    position: relative;
    padding-left: 20px;
} 
.imgText__txt ul li a {
    color: #666;
}
.imgText__txt ul li:before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    position: absolute;
    left: 5px;
    top: 9px;
    background: #666;
}
...

+ 목록 스타일은 브라우저마다 다르기 때문에 가상요소로 지정

...
.imgText__img {
    border-radius: 10px;
    position: relative;
}
.imgText__img a {
    position: absolute;
    left: 30px;
    bottom: 30px;
    background-color: #7c2b39;
    color: #fff;
    font-size: 18px;
    padding: 10px 30px;
    border-radius: 30px;
    display: inline-block;
}
.imgText__img a.blue {
    background-color: #2b387c;
}
.imgText__img.img1 {
    background: url(img/imgText_bg01.jpg) no-repeat center / cover;
}
.imgText__img.img2 {
    background: url(img/imgText_bg02.jpg) no-repeat center / cover;
}

+ 목록 스타일은 브라우저마다 다르기 때문에 가상요소로 지정

2. HTML 살펴보기

<body>
    <section id="imgTextType" class="imgText__wrap nexon section gray">
        <h2 class="blind">유용한 사이트 살펴보기</h2>
        <div class="imgText__inner container">
            <div class="imgText__txt">
                <span>이미지 텍스트 유형01</span>
                <h3>유용한 사이트 살펴보기</h3>
                <p>웹 디자이너, 웹 퍼블리셔, 프론트앤드 개발자를 위한 유용한 사이트입니다.</p>
                <ul>
                    <li><a href="/">튜토리얼 사이트</a></li>
                    <li><a href="/">레퍼런스 사이트</a></li>
                    <li><a href="/">웹폰트 사이트</a></li>
                    <li><a href="/">CSS 사이트</a></li>
                    <li><a href="/">WebGL 사이트</a></li>
                    <li><a href="/">Youtube 사이트</a></li>
                </ul>
            </div>
            <div class="imgText__img img1">
                <a href="/">레퍼런스 사이트</a>
            </div>
            <div class="imgText__img img2">
                <a href="/" class="blue">튜토리얼 사이트</a>
            </div>
        </div>
    </section>
</body>

3. 결과 확인하기

댓글


It's cording time

코딩 여기서 정리하고 배워보자구 :9

광고 준비중입니다.