这是我的网站:https://enmasantos.github.io/vitality_vista,对于我正在制作的个人项目,页脚下方有一个巨大的空白。我检查了页脚和周围元素的边距。 这是我用于页脚的代码:
/* footer.css */
.footer {
color: #ffffff;
padding: 1.5rem 0;
text-align: center;
transition: background-color 0.3s ease; /* Smooth transition for dynamic color change */
height: 16%;
border: 15px solid red;
}
.social-icons a img {
width: 24px;
height: 24px;
transition: transform 0.3s ease, fill 0.3s ease; /* Smooth color and scale transition */
}
.social-icons a img:hover {
transform: scale(1.1);
}
.footer-bottom p {
font-size: 0.875rem;
margin: 0;
color: #f1f1f1;
}
这是我的大致风格,但不知道它们与发生的事情有什么关系:
/* global.css */
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
/* Root Variables for Color Palette and Fonts */
:root {
--fandango: #a4036f;
--bittersweet: #ff595e;
--sunglow: #ffca3a;
--yellow-green: #8ac926;
--steel-blue: #1982c4;
--text-color: #333;
--background-color: #f9f9f9;
--font-family: 'Arial', sans-serif;
--font-size-base: 16px;
}
/* General Reset */
body {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: var(--font-family);
font-size: var(--font-size-base);
color: var(--text-color);
background-color: var(--background-color);
line-height: 1.6;
}
/* Headings */
h1, h2, h3, h4, h5, h6 {
color: var(--fandango);
margin-bottom: 0.5em;
font-weight: bold;
}
h1 {
font-size: 2rem;
}
h2 {
font-size: 1.75rem;
}
h3 {
font-size: 1.5rem;
}
/* Paragraphs */
p {
color: var(--text-color);
}
/* Links */
a {
color: var(--steel-blue);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* Buttons */
button {
font-family: var(--font-family);
padding: 10px 20px;
border-radius: 5px;
border: none;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
opacity: 0.9;
}
/* Container Layout */
.container {
width: 90%;
max-width: 100%;
margin: 0 auto;
}
/* Utility Classes */
.text-center {
text-align: center;
}
.mt-2 {
margin-top: 1rem;
}
.mb-2 {
margin-bottom: 1rem;
}
/* Dashboard Container */
.dashboard-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); /* Responsive card size */
gap: 1.25rem;
padding: 2rem;
}
/* Card Styles */
.dashboard-card {
background-color: #ffffff;
padding: 1rem;
border-radius: 0.625rem;
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
transition: transform 0.2s ease;
}
.dashboard-card:hover {
transform: translateY(-0.3125rem);
}
.dashboard-card h3 {
color: var(--fandango);
font-size: 1.2rem;
margin-bottom: 0.625rem;
}
.dashboard-card p {
color: #333;
margin-bottom: 0.625rem;
font-size: 1rem;
}
.dashboard-card button {
padding: 0.625rem 1.25rem; /* Spacing is now based on rem */
border: none;
border-radius: 0.3125rem;
background-color: var(--bittersweet);
color: #ffffff;
cursor: pointer;
font-size: 1rem;
transition: background-color 0.3s ease;
}
.dashboard-card button:hover {
background-color: var(--sunglow);
}
body, main {
overflow-x: hidden;
}
需要设置以下类
html,body {height:100%;}
和主要 {height:100%;}