やりたいこと↓
<footer> <div class="container"> <p>Copyright 2018 Pikacho</p> </div> </footer> ここのcopyrightのところとfontawsomeで追加したアイコンと同じ高さにしたい。 paddingを使ってみましたが、iタグを全く使ったことがなく、cssでどう書けばいいのかわからない。HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Portfolio</title> <link rel="stylesheet" href="stylesheet.css"> <link rel="stylesheet" href="responsive.css"> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> <!-- fontawesome --> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> </head> <body> <header> <div class="container"> <div class="header-left"> <p><i class="fas fa-bars"></i></p> </div> <div class="header-right"> <a href="http://pikacho.jp" target="_blank">My Blog</a> <a href="https://twitter.com" target="_blank">Twitter</a> <a href="https://github.com/pikacho007" target="_blank">github</a> <a </div> </div> </header> <!-- header --> <div class="top-wrapper"> <div class="container"> <h1>HELLO.</h1> <h1>WELCOME TO MY PORTFOLIO.</h1> </div> </div> <!-- top-wrapper --> <div class="introduction"> <div class="container"> <div class="heading"> <img src="img/my_face.jpg"> <h2>Who I am</h2> <p>鹿島学園高等学校卒後、<br>約1年間ヒューマンアカデミーでお世話になる。</p> <h3>Love</h3> <p>うさぎ、英語、ゲーム、海外ドラマ鑑賞、海外映画鑑賞、静かなカフェに行く。<br>特に本屋さんの横についているカフェが好き。</p> </div> </div> </div> <!-- introduction --> <div class="lesson-wrapper"> <div class="container"> <div class="heading"> <h2>What I Can Do!</h2> </div> <div class="lessons"> <div class="lesson"> <div class="lessons-icon"> <img src="https://prog-8.com/images/html/advanced/html.png"> <p>HTML & CSS</p> </div> </div> <div class="lesson"> <div class="lessons-icon"> <img src="https://prog-8.com/images/html/advanced/jQuery.png"> <p>JavaScript</p> </div> </div> <div class="lesson"> <div class="lessons-icon"> <img src="https://prog-8.com/images/html/advanced/ruby.png"> <p>Illustrator</p> </div> <p class="text-contents"></p> </div> <div class="lesson"> <div class="lessons-icon"> <img src="https://prog-8.com/images/html/advanced/php.png"> <p>Photoshop</p> </div> </div> <div class="clear"></div> </div> </div> </div> <!-- lesson-wrapper --> <div class="works"> <div class="container"> <div class="bottom"> <h2>What I Made</h2> <!-- ここに作品載せる-->
</div> </div> </div> <!-- works --> <div class="contact"> <h2>Contact Me</h2> <img src="img/mail.png"> <p><a href="hikaripoppo@gmail.com" target="_blank">hikaripoppo@gmail.com</p> </div> <!-- contact --> <p id="page-top"> <a href="#"><i class="fas fa-angle-up my-small"></i></a> </p> <!-- page-top --> <footer> <div class="container"> <p>Copyright 2018 Pikacho</p> </div> </footer> <!-- footer --> <script> $(function () { var topBtn = $('#page-top'); topBtn.hide(); //スクロールが500に達したらボタン表示 $(window).scroll(function () { if ($(this).scrollTop() > 500) { topBtn.fadeIn(); } else { topBtn.fadeOut(); } }); //スルスルっとスクロールでトップへもどる topBtn.click(function () { $('body,html').animate({ scrollTop: 0 }, 500); return false; }); }); </script> </body> </html>CSS
- {
box-sizing: border-box;
}
body {
margin: 0;
font-family: "Hiragino Kaku Gothic ProN", sans-serif;
}
a {
text-decoration: none;
}
.clear {
clear: left;
}
.header-left p .fas.fa-bars {
font-size: 1.8em;
padding-top: 4px;
}
header p {
color: white;
font-family: "Hiragino Kaku Gothic ProN", sans-serif;
}
.container {
max-width: 1170px;
width: 100%;
padding: 0 15px;
margin: 0 auto;
}
.container h1 {
color: white;
}
.top-wrapper {
padding: 180px 0 100px 0;
background-image: url("img/top.jpg");
/*
↑こっちは自分で選んだ画像。
↓プロゲートの時に使っていた画像。
background-image: url(https://prog-8.com/images/html/advanced/top.png);
*/
background-size: cover;
color: white;
text-align: center;
}
.top-wrapper h1 {
opacity: 0.7;
font-size: 45px;
letter-spacing: 5px;
}
.top-wrapper p {
opacity: 0.7;
}
.btn {
padding: 8px 24px;
color: white;
display: inline-block;
opacity: 0.8;
border-radius: 4px;
text-align: center;
}
.btn:hover {
opacity: 1;
}
.fa {
margin-right: 5px;
}
header {
height: 65px;
width: 100%;
background-color: rgba(34, 49, 52, 0.9);
position :fixed;
top: 0;
z-index: 10;
}
.header-left {
float: left;
}
.header-right {
float: right;
margin-right: -25px;
}
.header-right a {
line-height: 65px;
padding: 0 25px;
color: white;
display: block;
float: left;
transition: all 0.5s;
}
.header-right a:hover {
background-color: rgba(255, 255, 255, 0.3);
}
.introduction {
text-align: center;
padding-top: 30px;
padding-bottom: 30px;
}
.introduction img {
width: 250px;
height: 250px;
}
.introduction h2 {
padding-top: 35px;
}
.introduction h3 {
padding-top: 35px;
}
.lesson-wrapper {
padding-bottom: 80px;
padding-left: 5%;
padding-right: 5%;
background-color: #f7f7f7;
text-align: center;
}
.heading {
padding-top: 80px;
padding-bottom: 50px;
color: #5f5d60;
}
.heading h2 {
font-weight: normal;
}
.lesson {
float: left;
width: 25%;
}
.lessons-icon {
position: relative;
}
.lessons-icon p {
position: absolute;
top: 44%;
width: 100%;
color: white;
}
.works {
text-align: center;
}
.works h2 {
padding-top: 100px;
}
.contact {
text-align: center;
}
.contact h2 {
padding-top: 100px;
}
.contact img {
padding-top: 30px;
}
#page-top {
position: fixed;
bottom: 20px;
right: 20px;
font-size: 80%;
}
#page-top a {
color: gray;
padding: 0 25px;
border-radius: 10px;
}
#page-top a:hover {
text-decoration: none;
}
.my-small {
font-size: 2.5em;
}
footer img {
width: 125px;
}
footer p {
color: #b3aeb5;
font-size: 12px;
text-align: center;
border-top: 1px solid #f7f7f7;
padding-top: 30px;
}
footer {
padding-top: 30px;
padding-bottom: 20px;
}
回答2件
あなたの回答
tips
プレビュー