//AdSenseにリンク

HTML&CSS練習レスポンシブ【lesson5】

完成図

http://room.sub.jp/lesson/lesson5/

HTML

<!DOCTYPE html>
<html lang="ja">
 
<head>
  <meta charset="utf-8">
 <meta name="viewport" content="width=device-width,initial-scale=1">
  <title>lesson5</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
  <link rel="stylesheet" href="style.css">
</head>
 
<body>
    <div class="contant">
    <h1>
        <a href="index.html"><img src="images/200x40.png" alt=""></a>
    </h1>
        <ul class="nav">
            <li><a href="#about">about</a></li>
            <li><a href="#portfolio">portfolio</a></li>
        </ul>
<!----------main------------>
<main>
    <section class="ABOUT">
<img src="images/mainvisual.jpg" alt=""class="mainimg">
<h2>
    about
</h2>
<div class="contant2">
    <img src="images/about.jpg" alt="">
    <div class="text">
    <h3>
        NAME-NAME
    </h3>
    <p>
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. 
    </p>
</div>
</div>
</section>
<!---- PORTFORI0----->
<section class="PORTFORIO">
<h2>
    portfolio
</h2>
    <ul class="contant3">
        <li>
            <img src="images/portfolio.jpg" alt=""> 
        <h3>TITLE</h3>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec</p>
        </li>

        <li>
            <img src="images/portfolio.jpg" alt=""> 
        <h3>TITLE</h3>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec
        </p>
        </li>

        <li>
            <img src="images/portfolio.jpg" alt=""> 
        <h3>TITLE</h3>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec</p>
        </li>
    </ul>
</section>
</main>
<!----------footer------------>
<footer>
    <p>&copy; 2022 Profile</p>
</footer>
</body>
 
</html>

CSS

.contant{
    max-width: 860px;
    margin: 0 auto;
    padding: 0 10px;
}
img{
    max-width: 100%;
}
.nav {
display: flex;
list-style: none;
justify-content: flex-end;
}
a {
    text-decoration: none;
    color: rgb(93, 93, 93);
  }
.nav li{
    padding: 10px;
    margin-left: 10px;
    font-size: 1.2rem;
    color: rgb(93, 93, 93);
}
h2{
    text-align: center;
    font-size: 1.8rem;
}
.contant2{
display: flex;
justify-content: center;
align-items: center;
    }
    .contant2 img{
        width: 20%;
        border-radius: 50%;
        margin: 30px;
    } 
    .contant2 h3{
        font-size: 1.2rem;
        color: rgb(93, 93, 93);
    } 
    .contant2 p{
        inline-size: 580px;
        font-size: 1rem;
        line-height: 1.6rem;
        font-size: 1.2rem;
        color: rgb(93, 93, 93);
    }   
.contant3{
    display: flex;
    justify-content: space-between;/* 均等配置 */
}
.contant3 li{
    width:  calc(100% / 3);
    list-style: none;
    padding: 10px;
    font-size: 1rem;
    color: rgb(93, 93, 93);
}
.contant3 p{
    text-align: left;
    font-size: 1rem;
    color: rgb(93, 93, 93);
} 
footer{
    text-align: center;
    font-size: 0.8rem;
}
/*メディアクエリ*/
@media screen and (max-width: 600px) {

    .mainimg{
        height: calc(100vh - 60px);
    }
    .contant2{
        flex-direction: column;
    }
    .contant2 img{
        width: 40%;
    }
    .contant2{
        flex-direction: column;
    }
    .contant2 h3{
        padding: 0% 10%;
    }
    .contant2 p{
        font-size: 1rem;
        padding: 0% 10%;
        inline-size: 80%;
overflow-wrap: break-word;
    }
    .contant3{
        flex-direction: column;
    }
    .contant3 li{
        width: 80%;
        text-align: center;
    }
}