!DOCTYPE htmlhtmlhead titleMy Websitetitle style body font-family Arial sans-serif; margin 0; padding 0; nav background-color #333; color #fff; display flex; justify-content s
<p>的宽度,修改字体颜色和大小:</p>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: red;
}
nav {
background-color: #333;
color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
width: 20%;
}
nav a {
color: #fff;
text-decoration: none;
padding: 10px;
font-size: 20px;
}
nav a:hover {
background-color: #fff;
color: #333;
transition: all 0.3s ease;
}
.btn {
background-color: #333;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 20px;
}
.btn:hover {
background-color: #fff;
color: #333;
transition: all 0.3s ease;
}
form {
margin: 50px;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
text-align: center;
}
label {
margin: 10px;
font-weight: bold;
width: 200px;
text-align: right;
padding-right: 10px;
font-size: 20px;
color: #fff;
}
input[type="text"], input[type="email"] {
padding: 10px;
font-size: 16px;
border-radius: 5px;
border: none;
margin: 10px;
width: 300px;
}
input[type="submit"] {
background-color: #333;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
margin-top: 20px;
font-size: 20px;
}
input[type="submit"]:hover {
background-color: #fff;
color: #333;
transition: all 0.3s ease;
}
img {
max-width: 100%;
height: auto;
display: block;
margin: 50px auto;
transition: all 0.3s ease;
}
img:hover {
transform: scale(1.2);
}
@keyframes slideInFromLeft {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0);
}
}
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
h1 {
text-align: center;
animation: fadeIn 2s ease;
color: #fff;
font-size: 40px;
}
nav {
animation: slideInFromLeft 1s ease;
}
.btn {
animation: fadeIn 2s ease;
}
form {
animation: slideInFromLeft 1s ease;
}
img {
animation: fadeIn 2s ease;
}
</style>
原文地址: https://www.cveoy.top/t/topic/bMA8 著作权归作者所有。请勿转载和采集!