変化に応え、価値を届ける
以下のようなサンプルサイトを制作します。htmlでコーディングした後、phpに変換します。

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/destyle.css@3.0.2/destyle.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.css">
<link rel="stylesheet" href="./css/style.css">
<link rel="icon" href="favicon.png">
<title>サンプルカンパニー</title>
</head>
<body>
<div class="wrap">
<header class="header">
<h1 class="logo">
<a href="#">
<img src="./images/logo.svg" alt="SAMPLE COMPANY"></a></h1>
<nav>
<ul class="nav">
<li><a href="#">HOME</a></li>
<li><a href="#">会社概要</a></li>
<li><a href="#">業務案内</a></li>
<li><a href="#">お問い合わせ</a></li>
</ul>
</nav>
</header>
</div>
<section class="hero js-fade-up">
<img src="./images/main.jpg" />
<div class="hero__catch">
<p class="hero__text">Hello!World
<span class="hero__wp">by wordpress</span>
</p>
</div>
</section>
<div class="wrap">
<section class="top-message">
<h2 class="title">変化に応え、価値を届ける。</h2>
<p>
時代やニーズの変化を的確に捉え、
本質的な価値を見極めながら、最適な形で提供し続けます。</p>
</section>
<!--- NEWS---------------------->
<section class="news-section">
<div class="news-heading">
<h2 class="news-heading__title">NEWS</h2>
<p class="news-heading__sub">お知らせ</p>
</div>
<div class="news-list">
<ul>
<li class="news-item">
<time class="news-date" datetime="2030-02-01">2030.02.01</time>
<span class="news-tag">お知らせ</span>
<p class="news-text"><a href="/2026/company/material.zip">▶︎ ここから、素材のDLができます。</a></p>
</li>
<li class="news-item">
<time class="news-date" datetime="2030-01-25">2030.01.25</time>
<span class="news-tag">制作実績</span>
<p class="news-text"><a href="">Yahoo!JAPAN様のウェブサイトを制作。</a></p>
</li>
<li class="news-item">
<time class="news-date" datetime="2030-01-20">2030.01.20</time>
<span class="news-tag">採用</span>
<p class="news-text"><a href="">Webデザイナーを1名募集中です!</a></p>
</li>
</ul>
</div>
</section>
<section class="cards">
<a href="#" class="card card--link">
<img src="./images/president.jpg" alt="メッセージ">
<span class="card__title">メッセージ</span>
</a>
<a href="#" class="card card--link">
<img src="./images/concept.jpg" alt="コンセプト">
<span class="card__title">コンセプト</span>
</a>
<a href="#" class="card card--link">
<img src="./images/office.jpg" alt="お問い合わせ">
<span class="card__title">お問い合わせ</span>
</a>
</section>
</div>
<!------ slider------>
<section class="works-slider">
<div class="swiper works-swiper">
<div class="swiper-wrapper">
<div class="swiper-slide"><img src="./images/image01.jpg" alt=""></div>
<div class="swiper-slide"><img src="./images/image02.jpg" alt=""></div>
<div class="swiper-slide"><img src="./images/image03.jpg" alt=""></div>
<div class="swiper-slide"><img src="./images/image04.jpg" alt=""></div>
<div class="swiper-slide"><img src="./images/image05.jpg" alt=""></div>
<div class="swiper-slide"><img src="./images/image06.jpg" alt=""></div>
<div class="swiper-slide"><img src="./images/image07.jpg" alt=""></div>
<div class="swiper-slide"><img src="./images/image08.jpg" alt=""></div>
<div class="swiper-slide"><img src="./images/image09.jpg" alt=""></div>
<div class="swiper-slide"><img src="./images/image10.jpg" alt=""></div>
</div>
</div>
</section>
<footer class="footer">
<div class="wrap">
<small>
<span> このサイトは、学習用のサンプルです。実在しない架空の組織です。
</span></small>
</footer>
<script src="https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.js"></script>
<script src="./js/script.js"></script>
</body>
</html>CSSスタイル
/*
Theme Name: My Theme
Author:
Description: シンプルな企業サイト用テーマ
Version: 1.0
*/
html {
height: 100%;
}
body {
min-height: 100vh;
display: flex;
flex-direction: column;
/*縦方向のflexコンテナに*/
font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
color: #333;
line-height: 1.6;
}
.site-container {
flex: 1;
}
img {
width: 100%;
height: auto;
display: block;
}
a {
color: inherit;
text-decoration: none;
}
/* =========================
Layout
========================= */
.wrap {
width: min(1240px, calc(100% - 40px));
margin: 20px auto;
}
/* =========================
Header
========================= */
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
}
.logo {
width: clamp(280px, 30vw, 420px);
}
.nav {
display: flex;
gap: 28px;
font-size: 18px;
font-weight: 700;
}
.nav a {
position: relative;
display: inline-block;
padding-bottom: 4px;
/* 下線の余白 */
}
/* 下線(初期は隠す) */
.nav a::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background: #2F2A8B;
transform: scaleX(0);
transform-origin: left;
/* -------基準点(支点)を左にする*/
transition: transform 0.3s ease;
}
/* ホバーで左→右に伸びる */
.nav a:hover::after {
transform: scaleX(1);
}
/* =========================
Hero
========================= */
.hero {
position: relative;
}
.hero img {
height: 400px;
object-fit: cover;
}
.hero__catch {
position: absolute;
inset: 0;
/*まとめて記述---top: 0;right: 0;bottom: 0;left: 0;*/
display: grid;
place-items: center;
/*---------センター配置*/
z-index: 2;
}
/* テキスト */
.hero__text {
margin: 0;
color: rgba(255, 255, 255, 0.5);
font-size: clamp(2rem, 8vw, 10rem);
font-weight: 900;
letter-spacing: 0.1em;
text-align: center;
line-height: 1.2;
/* アニメ初期状態 */
opacity: 0;
transform: translateY(50px);
transition: opacity 0.8s ease, transform 0.8s ease;
}
.hero__wp {
font-size: clamp(1rem, 2vw, 1.5rem);
letter-spacing: 0.5em;
display: block;
}
/* 表示時 */
.hero.is-show .hero__text {
opacity: 1;
transform: translateY(0);
}
.hero::before {
content: "";
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.3);
z-index: 1;
}
/* =========================
Message
========================= */
.top-message {
padding: 20px 28px 42px;
text-align: center;
}
.top-message .title {
font-size: 1.5rem;
font-weight: 900;
}
.top-message p {
font-size: 1.2rem;
}
/* =========================
NEWS
========================= */
.news-section {
padding: 40px 0 50px;
display: flex;
align-items: flex-start;
gap: 48px;
}
.news-heading {
width: 200px;
}
.news-heading__title {
margin: 0;
color: #2f2a8b;
font-size: 3rem;
line-height: 1;
font-weight: 500;
}
.news-heading__sub {
margin-top: 10px;
color: #2f2a8b;
font-size: 1.4rem;
line-height: 1.4;
font-weight: 700;
}
.news-list {
flex: 1;
}
.news-item {
display: grid;
grid-template-columns: 140px 120px 1fr;
gap: 16px;
align-items: center;
padding: 18px 0;
border-bottom: 1px solid #ccc;
}
.news-item:first-child {
padding-top: 0;
}
.news-date {
font-size: 1.3rem;
color: #555;
line-height: 1.4;
}
.news-tag {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 32px;
padding: 0 12px;
background: #ddd;
border-radius: 999px;
font-size: 1.1rem;
font-weight: 700;
white-space: nowrap;
}
.news-text {
font-size: 1.3rem;
line-height: 1.6;
}
/* =========================
Cards
========================= */
.cards {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 40px;
padding: 0 28px 42px;
}
/* =========================
CARD(リンク版)
========================= */
.card--link {
position: relative;
display: block;
overflow: hidden;
aspect-ratio: 4 / 3;
}
.card--link img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s;
}
/* テキスト中央 */
.card__title {
position: absolute;
inset: 0;
display: grid;
place-items: center;
color: #fff;
font-size: 1.4rem;
font-weight: 700;
letter-spacing: 0.1em;
z-index: 2;
}
/* うっすら暗くする(可読性UP) */
.card--link::before {
content: "";
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.3);
z-index: 1;
transition: background 0.3s;
}
/* ホバー時 */
.card--link:hover img {
transform: scale(1.05);
}
.card--link:hover::before {
background: rgba(0, 0, 0, 0.4);
}
/* =========================
swiper-------
========================= */
.works-swiper .swiper-slide {
width: 20vw;
}
.works-swiper .swiper-wrapper {
transition-timing-function: linear !important;
}
.works-slider {
width: 100%;
overflow: hidden;
padding-top: 100px;
}
.works-swiper {
width: 100%;
}
.works-swiper .swiper-slide {
width: 20vw;
aspect-ratio: 16 / 10;
overflow: hidden;
}
.works-swiper .swiper-slide img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
/* =========================
Footer
========================= */
.footer {
background-color: #eee;
text-align: center;
padding: 50px 20px;
font-size: 0.8rem;
color: #999;
}
.footer span {
font-size: 0.6rem;
}
/* =========================
Responsive
========================= */
@media (max-width: 900px) {
.header {
flex-direction: column;
align-items: flex-start;
gap: 16px;
}
.nav {
flex-wrap: wrap;
gap: 12px;
font-size: 14px;
}
/*news-----------*/
.news-section {
gap: 24px;
}
.news-heading {
flex: 0 0 150px;
}
.news-heading__title {
font-size: 2.6rem;
}
.news-heading__sub {
font-size: 1.2rem;
}
.news-item {
grid-template-columns: 120px 110px 1fr;
gap: 12px;
padding: 16px 0;
}
.news-date {
font-size: 1.1rem;
}
.news-tag {
min-height: 28px;
padding: 0 10px;
font-size: 0.95rem;
}
.news-text {
font-size: 1.1rem;
line-height: 1.6;
}
/*slider-----*/
.works-swiper .swiper-slide {
width: 60vw;
}
.cards {
grid-template-columns: 1fr;
}
}
@media (max-width: 600px) {
.wrap {
width: min(100%, calc(100% - 10px));
margin: 5px auto;
}
.header {
padding: 20px 10px;
}
.hero img {
height: 220px;
}
.top-message {
padding: 20px 20px 36px;
text-align: left;
}
.top-message .title {
font-size: 1.3rem;
}
.top-message p {
font-size: 1rem;
}
/*news-----*/
.news-section {
flex-direction: column;
align-items: stretch;
gap: 16px;
padding: 20px 10px 30px;
}
.news-heading {
flex: none;
width: auto;
margin-bottom: 0;
}
.news-heading__title {
font-size: 2.4rem;
}
.news-heading__sub {
margin-top: 6px;
font-size: 1.2rem;
}
.news-list {
width: 100%;
}
.news-date {
font-size: 1.1rem;
}
.news-tag {
justify-self: start;
min-height: 24px;
padding: 0 10px;
font-size: 0.8rem;
}
.news-text {
grid-column: 1 / -1;
font-size: 1rem;
line-height: 1.6;
}
/*slider---*/
.works-swiper .swiper-slide {
width: 78vw;
}
.cards {
gap: 24px;
padding: 0 20px 28px;
}
.footer {
padding: 36px 16px;
}
}
/* =========================
single・page・sidebar
========================= */
.sidebar figure {
margin-bottom: 2rem;
}
.sidebar li {
list-style: none;
line-height: 2rem;
font-weight: bold;
margin-left: 1rem;
}
.content {
display: flex;
gap: 50px;
}
.main {
flex: 1;
line-height: 1.8rem;
}
.main h1 {
color: #2F2A8B;
font-size: 1.5rem;
margin-bottom: 1rem;
font-weight: bold;
}
.main h2 {
color: #740101;
font-size: 1.4rem;
margin-bottom: 1rem;
font-weight: bold;
}
.main h3 {
color: #5e5d70;
font-size: 1.3rem;
margin: 1rem 0 0.5rem;
font-weight: bold;
}
.sidebar {
width: 300px;
}
/*会社概要の表*/
.company-table {
width: 100%;
border-collapse: collapse;
font-size: 0.95rem;
margin: 50px auto;
border: 5px solid #eee;
}
.company-table tr {
border-bottom: 1px solid #e5e7eb;
}
.company-table td {
padding: 18px 20px;
vertical-align: top;
color: #555;
}
/* 左列だけ見出し風にする */
.company-table td:first-child {
width: 28%;
background: #f7f8fa;
font-weight: 600;
color: #444;
}
/* 最後の行だけ少し締める */
.company-table tr:last-child {
border-bottom: 2px solid #ddd;
}
@media (max-width: 768px) {
.content {
flex-direction: column;
padding: 0 10px;
}
.sidebar {
width: min(100%, calc(100% - 20px));
margin-bottom: 20px;
}
}