TEST-web-siteの2のcssコーディング

TEST 2のコーディングです。参考にできます

cssのノーマライズの部分

@charset "utf-8";

/*---------------サイトの基本設定---------------*/

/*cssのリセット*/
こちらはノーマライズするときは要らない html,
body,
div,
span,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
abbr,
address,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
samp,
small,
strong,
sub,
sup,
var,
b,
i,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section,
summary,
time,
mark,
audio,
video {
  font-size: 100%;
  margin: 0;
  padding: 0;
  vertical-align: baseline;
  border: 0;
  outline: 0;
  background: transparent;
}

/*html&bodyの設定*/
html {
  font-size: 62.5%; /* 1rem = 10px */
  overflow-y: scroll;
  overflow-x: hidden;
}

body {
  font-family: "Lato", "YakuHanJPs_Noto", "Roboto", "Noto Sans JP",
    "游ゴシック Medium", "游ゴシック体", "Yu Gothic Medium", "YuGothic",
    "ヒラギノ角ゴ ProN", "Hiragino Kaku Gothic ProN", "メイリオ", "Meiryo",
    "MS Pゴシック", "MS PGothic", sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.8;
  width: 100%;
}

/* Box Sizing の設定 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* - -  h1.h2.h3....  - - */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
  color: #000;
  overflow-wrap: break-word;
}

/* -- a -- */
a {
  text-decoration: none;
  outline: none;
  color: #000;
}

a,
a > img {
  -webkit-transition: 0.2s;
  -moz-transition: 0.2s;
  -ms-transition: 0.2s;
  -o-transition: 0.2s;
  transition: 0.2s;
}

/* -- img -- */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* -- ul -- */
ul {
  list-style: none;
}
li {
  list-style: none;
}

/* -- :hover -- */
a:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  cursor: pointer;
}

/* -- inputの設定 --*/
input[type="text"] {
  font-size: 1rem;
}
input[type="submit"] {
  padding: 8px;
  border: #efefef;
  color: #000;
  background-color: aliceblue;
}

/*--  フォーム要素の設定  --*/
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  margin: 0;
}
button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

/*--テーブルのborder-collapse*/
table {
  border-collapse: collapse;
  border-spacing: 0;
}


cssのstyle.cssの部分まで

@charset "utf-8";

/*---------------rootの基本設定---------------*/
:root {
  /* カラーパレット */
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --bg-beige: #f3f0e8;
  --text-color: #333;
  --white--: #ffffff;
  --gold--: #b49f68;
  --black--: #000000;
  --footer-bg: #222222;

  /* フォントサイズ */
  --font-small: 12px; /* 12px */
  --font-medium: 16px; /* 16px */
  --font-large: 20px; /* 20px */

  /* スペーシング */
  --spacing-small: 8px;
  --spacing-medium: 16px;
  --spacing-large: 24px;
}
/*---------------設定終了---------------*/

/*---------------デバイス別表示・非表示---------------*/
/* PC専用(769px以上で表示) */
.pc-only {
  display: block;
}
@media screen and (max-width: 768px) {
  .pc-only {
    display: none !important;
  }
}

/* タブレット専用(768px〜1024px) */
.tablet-only {
  display: none;
}
@media screen and (min-width: 768px) and (max-width: 1024px) {
  .tablet-only {
    display: block;
  }
}

/* スマホ専用(500px以下で表示) */
.sp-only {
  display: none;
}
@media screen and (max-width: 500px) {
  .sp-only {
    display: block !important;
  }
}

/* モバイル専用(768px以下で表示:タブレット+スマホ) */
.mobile-only {
  display: none;
}
@media screen and (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }
}
/*---------------デバイス別表示・非表示の設定終了---------------*/

/*---------------全体のフォント設定---------------*/
body {
  font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
}
/*---------------全体のフォント設定終了---------------*/

/*---------------mainの設定-------------------------------*/
.main_visual {
  margin-top: 70px; /* ヘッダーの高さ分のマージンを追加 */
}

#main {
  background-image: url("../img/back2.png");
  background-size: auto; /* 元のサイズで表示 */
  background-position: top center;
  background-repeat: repeat; /* タイル状に繰り返す */
}
/*---------------mainの設定終了-------------------------------*/


cssのheader.cssの部分

@charset "utf-8";

/*---------------headerの設定-------------------------------*/

#header {
  background-color: var(--white--);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}
.header_inner {
  width: 100%;
  height: 70px;
  margin-inline: auto;
  padding-block: min(0.69vw, 10px);
  padding-inline: min(1.39vw, 20px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header_logo img {
  width: 100%;
}
.header_nav {
  display: flex;
  align-items: center;
}
.header_nav ul {
  list-style: none;
  display: flex;
  gap: min(1.39vw, 20px);
  margin-right: min(1.39vw, 20px);
  padding: 0;
}
.header_nav ul li a {
  text-decoration: none;
  color: var(--text-color);
  font-size: min(1.11vw, 16px);
  font-weight: 500;
}
.header_nav ul li a:hover {
  color: var(--primary-color);
}
.header_btn .btn_basic {
  background-color: var(--gold--);
  color: var(--white--);
  font-size: min(1.11vw, 16px);
  padding-block: min(0.69vw, 10px);
  padding-inline: min(1.39vw, 20px);
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
}
.header_btn .btn_basic:hover {
  background-color: var(--black--);
}
/*---------------headerの設定終了-------------------------------*/


cssのmv.cssの部分

@charset "utf-8";

/*---------------MVの設定-------------------------------*/
.main_visual {
  width: 100%;
  aspect-ratio: 2 / 1; /* 2:1の比率で1440pxなら720px */
  /*max-height: 920px; /* 最大720pxに制限 */
  margin-top: 70px; /* ヘッダーの高さ分のマージンを追加 */
  overflow: hidden;
  position: relative;
}
.main_visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
@media screen and (max-width: 768px) {
  .main_visual {
    /*aspect-ratio: 4 / 3; /* スマホは4:3など調整可能 */
    height: 100vh; /* ビューポートの高さに合わせる */
  }
}
/*---------------MVの設定終了-------------------------------*/


cssのsection.cssの部分

@charset "utf-8";

/*---------------section_test_oneのスタイル---------------*/
.section_test_one {
  background-color: transparent; /* 背景を透明にしてmainの背景を表示 */
  padding-inline: min(3.47vw, 50px);
  padding-block: min(6.94vw, 100px);
  padding-bottom: min(13.8vw, 200px);
}

.section_inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-inline: min(2.08vw, 30px);
}

.section_title {
  font-size: min(3.47vw, 40px);
  color: var(--text-color);
  margin-bottom: min(1.39vw, 20px);
  text-align: left;
}

.icon-attention {
  position: relative;
  top: -10px;
  width: 45px;
  height: 45px;
}

.section_items {
  width: 100%;
}

.section_item {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: min(2.08vw, 30px);
  flex-wrap: wrap;
}

.section_item li {
  flex: 0 1 calc(50% - min(1.04vw, 15px));
  max-width: 580px;
}

.section_item li a {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section_item li a:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.section_item_img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #f5f5f5;
}

.section_item_img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section_item_text {
  width: 100%;
  padding: min(1.39vw, 20px);
  background-color: var(--white--);
}

.item_title {
  font-size: min(2.08vw, 24px);
  letter-spacing: 5px;
  color: var(--black--);
  margin-bottom: min(0.69vw, 10px);
  text-align: left;
}

.item_desc {
  font-size: min(1.39vw, 16px);
  color: var(--text-color);
  line-height: 1.6;
  text-align: left;
}
/*---------------section_test_oneのスタイル終了---------------*/

/*---------------contactセクションの設定---------------*/
.contact_wrapper {
  width: 100%;
  text-align: center;
}

.contact_inner {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.contact_bg {
  width: 100%;
  height: auto;
  vertical-align: top;
}

.contact_content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 80%;
  padding: 20px;
}

.contact_title {
  font-size: min(2.78vw, 32px);
  color: var(--white--);
  margin-bottom: min(1.39vw, 20px);
}

.contact_desc {
  font-size: min(1.39vw, 16px);
  color: var(--white--);
  margin-bottom: min(2.08vw, 30px);
  line-height: 1.6;
}

.contact_btn {
  display: inline-block;
  padding: min(1.39vw, 20px) min(2.78vw, 40px);
  background-color: var(--gold--);
  font-size: min(1.39vw, 16px);
  border-radius: 5px;
  transition: background-color 0.3s ease;
}
.contact_btn a {
  color: var(--white--);
  text-decoration: none;
}
.contact_btn:hover {
  background-color: #a88850; /* ホバー時の色変更 */
}

@media screen and (max-width: 768px) {
  .section_title {
    font-size: min(5.2vw, 40px);
  }
  .item_title {
    font-size: min(2.6vw, 20px);
  }
  .item_desc {
    font-size: min(1.82vw, 14px);
  }
  .contact_inner {
    bottom: -1px;
  }
  .section_item_text {
    padding: min(2.6vw, 20px);
  }
  .contact_title {
    font-size: min(4.16vw, 32px);
  }
  .contact_desc {
    font-size: min(1.82vw, 14px);
  }
  .contact_btn {
    font-size: min(1.82vw, 14px);
  }
}

@media screen and (max-width: 540px) {
  .icon-attention {
    top: 0px;
    width: 40px;
    height: 40px;
  }
}

@media screen and (max-width: 500px) {
  .section_title {
    font-size: min(6vw, 30px);
  }
  .section_item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: min(6vw, 30px);
    flex-wrap: wrap;
  }
  .section_item_text {
    padding: min(4vw, 20px);
  }
  .item_title {
    font-size: min(3.72vw, 16px);
  }
  .item_desc {
    font-size: min(3.02vw, 13px);
  }
  .contact_inner {
    bottom: -1px;
  }
  .contact_title {
    font-size: min(5vw, 25px);
  }
  .contact_desc {
    font-size: min(2.4vw, 12px);
  }
  .contact_btn {
    font-size: min(2.4vw, 12px);
  }
}


cssのfooterの部分

@charset "utf-8";

/*---------------footerの基本設定---------------*/

footer {
  background-color: var(--footer-bg);
  color: var(--white--);
  padding: min(4vw, 60px) min(3.47vw, 50px);
  text-align: center;
  font-size: min(1.39vw, 20px);
}
.footer_inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer_inner p {
  margin: 0;
}
.footer_inner a {
  color: var(--white--);
  text-decoration: none;
}
.footer_inner a:hover {
  text-decoration: underline;
}
.footer_logo {
  max-width: min(14.58vw, 210px);
}
.footer_nav ul {
  display: flex;
  gap: min(2.08vw, 30px);
}
.footer_copyright {
  font-size: min(1.04vw, 15px);
}
@media screen and (max-width: 768px) {
  footer {
    padding: min(7.81vw, 60px) min(6.5vw, 50px);
    font-size: min(1.82vw, 14px);
  }
  .footer_logo {
    max-width: min(27.34vw, 210px);
  }
  .footer_copyright {
    margin-top: min(3.9vw, 30px);
    font-size: min(1.82vw, 14px);
  }
}
@media screen and (max-width: 500px) {
  footer {
    padding: min(13.9vw, 60px) min(6.97vw, 30px);
    font-size: min(3.25vw, 14px);
  }
  .footer_logo {
    max-width: min(42vw, 210px);
  }
  .footer_copyright {
    margin-top: min(6vw, 30px);
    font-size: min(2.82vw, 14px);
  }
}


サイトは

こちらから