例.html
<!DOCTYPE html>
<html lang="ja">
<head>
<title>ホームページ</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>* { margin: 0; padding: 0; box-sizing: border-box; } html, body { height: 100%; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
a { text-decoration: none; color: inherit; } ul, ol { list-style: none; }</style>
<link rel="stylesheet" href="例.css">
</head>
<body>
<header>
<h1>ようこそ!ホームページへ</h1>
<nav>
<ul>
<li><a href="./例.html">自己紹介</a></li>
<li><a href="./例.html">スキル</a></li>
<li><a href="./例.html">お問い合わせ</a></li>
</ul>
</nav>
</header>
<main>
<section >
<h2>自己紹介</h2>
<p>こんにちは。ホームページの勉強をしています。</p>
</section>
<section >
<h2>スキル</h2>
<ul>
<li>HTML / CSS </li>
<li>PHP / JS</li>
</ul>
</section>
<section>
<h2>お問い合わせ</h2>
<p>ご質問やご相談は <a href="mailto:〇〇@〇〇.com">メール</a> でどうぞ。</p>
</section>
</main>
<footer>
<p>© ホームページ</p>
</footer>
</body>
</html>
例.css
@charset "UTF-8";
body {
font-family: 'Arial', sans-serif;
line-height: 1.6;
margin: 0;
padding: 0;
background-color: #f4f4f4;
color: #333;
}
header {
background-color: #007acc;
color: white;
padding: 20px 0;
text-align: center;
}
nav ul {
list-style: none;
padding: 0;
}
nav ul li {
display: inline;
margin: 0 15px;
}
nav ul li a {
color: white;
text-decoration: none;
}
main {
padding: 20px;
max-width: 800px;
margin: auto;
background-color: white;
}
section {
margin-bottom: 40px;
}
footer {
text-align: center;
padding: 10px;
background-color: #ddd;
}
見た目
