这是我在论坛上的第一个问题抱歉,如果这是不专业的,希望我能从这篇文章的错误中吸取教训!
我把问题放在标题中但如果您有任何问题请随时问下面谢谢!寻求帮助!
我的代码
html {
font-family: Arial, sans-serif;
}
html,
body {
background-color: #67B177;
margin: 0;
padding: 0;
}
.wrapper {
width: 100%;
background-color: #4B574E;
}
.wrapper_nav {
display: grid;
width: auto;
height: 50px;
}
.wrapper_nav a {
text-decoration: none;
color: white;
padding: 0 1em;
font-size: 30px;
}
.nav_left {
text-align: left;
margin-left: 10%;
margin-top: 0.4em;
}
.nav_right {
float: right;
}
.text {
color: darkslategray;
}
.wrapper_body {}
.text-align-right {
text-align: right;
}
.text-align-center {
text-align: center;
}
h2 {
font-family: helvetica;
font-size: 64px;
text-decoration: none;
color: beige;
margin-top: 50px;
margin-bottom: 50px;
}
h3 {
font-size: 64px;
text-decoration: none;
color: beige;
margin-top: 00;
margin-bottom: 150px;
}
.text2:hover {
color: darkgray;
}
.text3:hover {
color: #67B177;
}
p {
color: beige;
font-family: sans-serif;
font-size: 16px;
}
.object-align-left {
margin-right: 10px;
margin-left: 100px;
width: 50;
}
.object-align-center {
margin-right: 300px;
margin-left: 500px;
}
.object-align-right {
margin-right: 300px;
margin-left: 500px;
}
.overlay {
position: absolute;
bottom: 0;
left: 100%;
right: 0;
background-color: #008CBA;
overflow: hidden;
width: 0;
height: 100%;
transition: .5s ease;
}
.container:hover .overlay {
width: 100%;
left: 0;
}
a {
text-decoration: none;
}
.textone {
margin-left: -170px;
line-height: 100px;
font-family: sans-serif;
color: beige
}
.imageone {
margin-bottom: 50px;
}
.textone:hover {
color: #4B574E;
}
imagegrid {
display: grid;
}
.texttwo {
margin-left: -150px;
line-height: 250px;
font-family: sans-serif;
color: beige;
}
.textthree {
margin-left: -150px;
line-height: 250px;
font-family: sans-serif;
color: beige;
}
.inline-block {
display: inline-block;
}
<html>
<head>
<title>Portfolio</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<div class="wrapper">
<div class="wrapper_nav">
<div class="nav_left">
<div class="text">
<div class="text2">
<a href="#" class="text2">HOME</a>
<a href="#" class="text2">EXPERIENCE</a>
<a href="#" class="text2">CONTACT</a>
<a href="#" class="text2">ABOUT</a>
<a href="#" class="text3">LOGIN</a>
</div>
</div>
</div>
</div>
</div>
<div class="text-align-center">
<h2>BUSINESS</h2>
</div>
<div class="inline-block">
<div class="object-align-left">
<div class="container">
<div class="">
<a href="#">
<img src="images/pen-icon.svg" height="200" class="imageone">
<a class="textone"><b>EXPERIMENTAL</b></a>
</a>
</div>
</div>
</div>
<div class="object-align-center">
<a href="#">
<img src="images/logo.svg" height="200">
<a class="texttwo"><b>FAST</b></a>
</a>
</div>
<div class="object-align-right">
<a href="#">
<img src="images/house-309113_1280.png" height="200">
<a class="textthree">INNOVATIVE</a>
</a>
</div>
</div>
<div class="text-align-center">
<h3>FREELANCE WORK</h3>
</div>
</body>
</html>
答案 0 :(得分:0)
我对你的代码进行了一些修改,你可以在这里看到它:
HTML:
<div class="wrapper">
<div class="wrapper_nav">
<div class="nav_left">
<div class="text">
<div class="text2">
<a href="#" class="text2">HOME</a>
<a href="#" class="text2">EXPERIENCE</a>
<a href="#" class="text2">CONTACT</a>
<a href="#" class="text2">ABOUT</a>
<a href="#" class="text3">LOGIN</a>
</div>
</div>
</div>
</div>
</div>
<div class="section1">
<h2>BUSINESS</h2>
</div>
<div class="section2">
<div class="object">
<a href="#">
<img src="https://dummyimage.com/200x200/4b574e/ffffff.png" height="200">
<a class="textone"><b>EXPERIMENTAL</b></a>
</a>
</div>
<div class="object">
<a href="#">
<img src="https://dummyimage.com/200x200/4b574e/ffffff.png" height="200">
<a class="textone"><b>FAST</b></a>
</a>
</div>
<div class="object">
<a href="#">
<img src="https://dummyimage.com/200x200/4b574e/ffffff.png" height="200">
<a class="textone">INNOVATIVE</a>
</a>
</div>
</div>
<div class="section3">
<h3>FREELANCE WORK</h3>
</div>
CSS:
html{
font-family: Arial,sans-serif;
}
html, body{
background-color:#67B177;
margin: 0;
padding: 0;
}
.wrapper {
width: 100%;
background-color: #4B574E;
}
.wrapper_nav{
display:grid;
width: auto;
height: 50px;
}
.wrapper_nav a{
text-decoration: none;
color: white;
padding: 0 1em;
font-size: 30px;
}
.nav_left{
text-align: left;
margin-left: 10%;
margin-top: 0.4em;
}
.nav_right{
float: right;
}
.text{
color: darkslategray;
}
.wrapper_body{
}
.section1{
text-align: center;
}
.section3{
text-align: center;
display: block;
padding-top: 50px;
clear: both;
overflow: hidden;
}
h2{
font-family:helvetica;
font-size: 64px;
text-decoration:none;
color:beige;
margin-top: 50px;
margin-bottom: 50px;
}
h3{
font-size: 64px;
text-decoration: none;
color: beige;
margin-top: 00;
margin-bottom: 150px;
}
.text2:hover{
color: darkgray;
}
.text3:hover{
color:#67B177;
}
p{
color: beige;
font-family: sans-serif;
font-size: 16px;
}
.overlay {
position: absolute;
bottom: 0;
left: 100%;
right: 0;
background-color: #008CBA;
overflow: hidden;
width: 0;
height: 100%;
transition: .5s ease;
}
.container:hover .overlay {
width: 100%;
left: 0;
}
a{
text-decoration: none;
}
.textone{
font-family:sans-serif;
color: beige;
display: block;
margin-top: 15px;
text-align:center;
}
.imageone{
margin-bottom: 50px;
}
.textone:hover{
color: #4B574E;
}
imagegrid{
display: grid;
}
.section2{
width: 900px;
margin: 0px auto;
}
.object{
float: left;
padding: 0 50px;
}
codepen上的代码 https://codepen.io/mehdiyatrib/full/mMOVQK