2017-07-31 15 views
0

ここは新しいです。私はこの問題について尋ねたがっています。HTML - テキストがボタンの内側にない

The text is not inside the boxテキストはボックスの外にあるように見え、奇妙に見えます。テキストをボックス内に表示させるにはどうすればよいですか?コーディングで何が間違っていましたか?私は自分のコーディングで何の問題も見ません。ちなみに、私はDreamweaverを使ってこのインターフェイスをコーディングしています。

HTMLコード:

<html> 
<head> 
<meta charset="utf-8"> 
<title>Deane.co</title> 
<link href="style.css" rel="stylesheet" type="text/css" > 
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> 
</head> 

<body> 
<div id="nav1"> 
<h4><a href="index.html"><h1>Deane.co</a></h4> 
<ul> 
    <li id="active"><a href="index.html"</a>Home</li> 
    <li><a href="service.html"</a>Products</li> 
    <li><a href="contact.html"</a>Contact</li> 
    <li><a href="about.html"About</a>About</li> 
</ul> 
</div> 
<div id="main-content"> 
<br> 
<h1> Welcome To Deane.co </h1> 
<br> 
<p> Welcome to Deane.co the place to shop beautiful clothes easier </p> 
<br> 
<div id = "products"> 
<h5><a href="products.html">Check our products</a></h5> 
</div> 
</div> 
<div id="shirtsaesthetic"> 
<div id="shirtsaesthetic1"> <img src="Images/shirtsaesthetic.jpg"> <br> 
<h4> Hipster Blouse </h4> <br> 
<p> RM40 </p> 
</div> 
<div id="shirtsaesthetic1"> <img src="Images/shirtsaesthetic.jpg"> <br> 
<h4> Hipster Blouse </h4> <br> 
<p> RM40 </p> 
</div> 
<div id="shirtsaesthetic1"> <img src="Images/shirtsaesthetic.jpg"> <br> 
<h4> Hipster Blouse </h4> <br> 
<p> RM40 </p> 
</div> 
</div> 
<div id="footer"> 
<h2>&copy; Allright Reserved</h2> 
<div> 
<ul> 
    <li><a href="#"><i class="fa fa-facebook"></i></a></li> 
    <li><a href="#"><i class="fa fa-twitter"></i></a></li> 
    <li><a href="#"><i class="fa fa-instagram"></i></a></li> 
</ul> 
</div> 
</div> 
</body> 
</html> 

CSSコード:

body { 
font-family: 'Raleway', sans-serif; 
} 
*{ 
padding: 0px; 
margin: 0px; 
} 

#nav1 { 
width: 100%; 
height: 70px; 
line-height: 70px; 
background: #a5aab1; 
} 
#nav1 h1 { 
float: left; 
font-size: 2.5em; 
margin-left: 15px; 

} 
#nav1 h1 a { 
text-decoration: none; 
color: white; 
} 
#nav1 ul { 
float: right; 
margin-right: 15px; 

} 
#nav1 ul li { 
display: inline-block; 
list-style-type: none; 
} 

#nav1 ul li a { 
text-decoration: none; 
color: white; 
padding: 25px; 
} 
#nav1 ul li:hover{ 
background: #bfc5ce; 
transition: all ease-in-out 0.45s; 

} 
#active { 
background: #bfc5ce; 

} 

#main-content { 
width: 100&; 
height: 600px; 
background: url(Images/store-background3.jpg) no-repeat; 
background-size: cover; 
text-align: center; 
color: black; 
line-height: 40px; 

} 
#main-content a { 
text-decoration: none; 
color: black; 
} 
#products { 
background: #a5aab1; 
width: 170px; 
height: 60px; 
line-height: 60px; 
margin-left: auto; 
margin-right: auto; 
border-radius: 5px; 
color: white; 
font-weight: 100; 
} 
#products:hover { 
box-shadow: 1px 1px 10px 10px rgba(136, 131, 131, 0.83); 
transition: all ease-in-out 0.45s; 
} 
#products a { 
color: white; 
text-decoration: none; 
padding: 25px; 

} 

#shirtsaesthetic { 
width: 100%; 
height: 400px; 
background: white; 
} 
#shirtsaesthetic1 { 
width: 400px; 
height: 300px; 
padding: 5px; 
display: inline; 
float: left; 
margin: 19px; 
text-align: center; 
} 
#shirtsaesthetic1 img { 
width: 300px; 
height: 220px; 
border-radius: 5px; 
} 

答えて

1

コードのあなたの最初のビットが台無しにされています。適切 閉じるタグ:あなたのstyle.cssファイルで

<head> 
<title>Deane.co</title> 
<link href="style.css" rel="stylesheet" type="text/css" > 
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet"> 
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> 

</head>  
<body> 
<div id="nav1"> 
<h4><a href="index.html"><h1>Deane.co</h1></a></h4> 
<ul> 
    <li id="active"><a href="index.html">Home</a></li> 
    <li><a href="service.html">Products</a></li> 
    <li><a href="contact.html">Contact</a></li> 
    <li><a href="about.html"About>About</a></li> 
</ul> 
<div id="main-content"> 
<br> 
<h1> Welcome To Deane.co </h1> 
<br> 
<p> Welcome to Deane.co the place to shop beautiful clothes easier </p> 
<br> 
<div id = "products"> 
<h5><a href="products.html">Check our products</a></h5> 
</div> 
</div> 
<div id="shirtsaesthetic"> 
<div id="shirtsaesthetic1"> <img src="Images/shirtsaesthetic.jpg"> <br> 
<h4> Hipster Blouse </h4> <br> 
<p> RM40 </p> 
</div> 
<div id="shirtsaesthetic1"> <img src="Images/shirtsaesthetic.jpg"> <br> 
<h4> Hipster Blouse </h4> <br> 
<p> RM40 </p> 
</div> 
<div id="shirtsaesthetic1"> <img src="Images/shirtsaesthetic.jpg"> <br> 
<h4> Hipster Blouse </h4> <br> 
<p> RM40 </p> 
</div> 
</div> 
<div id="footer"> 
<h2>&copy; Allright Reserved</h2> 
<div> 
<ul> 
    <li><a href="#"><i class="fa fa-facebook"></i></a></li> 
    <li><a href="#"><i class="fa fa-twitter"></i></a></li> 
    <li><a href="#"><i class="fa fa-instagram"></i></a></li> 
</ul> 
</div> 
</div> 
</body> 
+0

#products aからフィドルhttps://jsfiddle.net/4w95cd9h/を削除する必要があります – Klajdi

1

、以下の行を削除:あなたのhtmlファイルで

#products a { 
    color: white; 
    text-decoration: none; 
    padding: 25px; //remove this line 
} 

、あなたは逃した ">" これらの行にタグの:

<ul> 
    <li id="active"><a href="index.html"></a>Home</li> 
    <li><a href="service.html"></a>Products</li> 
    <li><a href="contact.html"> </a>Contact</li> 
    <li><a href="about.html"></a>About</li> 
</ul> 
0

最初の順序付けられていないリストのタグが正しく閉じられていません。あなたのナビゲーションで

1

aタグが間違っている、とあなたはpadding

body { 
 
font-family: 'Raleway', sans-serif; 
 
} 
 
*{ 
 
padding: 0px; 
 
margin: 0px; 
 
} 
 

 
#nav1 { 
 
width: 100%; 
 
height: 70px; 
 
line-height: 70px; 
 
background: #a5aab1; 
 
} 
 
#nav1 h1 { 
 
float: left; 
 
font-size: 2.5em; 
 
margin-left: 15px; 
 

 
} 
 
#nav1 h1 a { 
 
text-decoration: none; 
 
color: white; 
 
} 
 
#nav1 ul { 
 
float: right; 
 
margin-right: 15px; 
 

 
} 
 
#nav1 ul li { 
 
display: inline-block; 
 
list-style-type: none; 
 
} 
 

 
#nav1 ul li a { 
 
text-decoration: none; 
 
color: white; 
 
padding: 25px; 
 
} 
 
#nav1 ul li:hover{ 
 
background: #bfc5ce; 
 
transition: all ease-in-out 0.45s; 
 

 
} 
 
#active { 
 
background: #bfc5ce; 
 

 
} 
 

 
#main-content { 
 
width: 100&; 
 
height: 600px; 
 
background: url(Images/store-background3.jpg) no-repeat; 
 
background-size: cover; 
 
text-align: center; 
 
color: black; 
 
line-height: 40px; 
 

 
} 
 
#main-content a { 
 
text-decoration: none; 
 
color: black; 
 
} 
 
#products { 
 
background: #a5aab1; 
 
width: 170px; 
 
height: 60px; 
 
line-height: 60px; 
 
margin-left: auto; 
 
margin-right: auto; 
 
border-radius: 5px; 
 
color: white; 
 
font-weight: 100; 
 
} 
 
#products:hover { 
 
box-shadow: 1px 1px 10px 10px rgba(136, 131, 131, 0.83); 
 
transition: all ease-in-out 0.45s; 
 
} 
 
#products a { 
 
color: white; 
 
text-decoration: none; 
 

 
} 
 

 
#shirtsaesthetic { 
 
width: 100%; 
 
height: 400px; 
 
background: white; 
 
} 
 
#shirtsaesthetic1 { 
 
width: 400px; 
 
height: 300px; 
 
padding: 5px; 
 
display: inline; 
 
float: left; 
 
margin: 19px; 
 
text-align: center; 
 
} 
 
#shirtsaesthetic1 img { 
 
width: 300px; 
 
height: 220px; 
 
border-radius: 5px; 
 
}
<html> 
 

 
<head> 
 
    <meta charset="utf-8"> 
 
    <title>Deane.co</title> 
 
    <link href="style.css" rel="stylesheet" type="text/css"> 
 
    <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet"> 
 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
 
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> 
 
</head> 
 

 
<body> 
 
    <div id="nav1"> 
 
    <h4><a href="index.html"><h1>Deane.co</a></h4> 
 
    <ul> 
 
     <li id="active"><a href="index.html">Home </a></li> 
 
     <li><a href="service.html">Products</a></li> 
 
     <li><a href="contact.html">Contact</a></li> 
 
     <li><a href="about.html">About</a></li> 
 
    </ul> 
 
    </div> 
 
    <div id="main-content"> 
 
    <br> 
 
    <h1> Welcome To Deane.co </h1> 
 
    <br> 
 
    <p> Welcome to Deane.co the place to shop beautiful clothes easier </p> 
 
    <br> 
 
    <div id="products"> 
 
     <h5><a href="products.html">Check our products</a></h5> 
 
    </div> 
 
    </div> 
 
    <div id="shirtsaesthetic"> 
 
    <div id="shirtsaesthetic1"> <img src="Images/shirtsaesthetic.jpg"> <br> 
 
     <h4> Hipster Blouse </h4> <br> 
 
     <p> RM40 </p> 
 
    </div> 
 
    <div id="shirtsaesthetic1"> <img src="Images/shirtsaesthetic.jpg"> <br> 
 
     <h4> Hipster Blouse </h4> <br> 
 
     <p> RM40 </p> 
 
    </div> 
 
    <div id="shirtsaesthetic1"> <img src="Images/shirtsaesthetic.jpg"> <br> 
 
     <h4> Hipster Blouse </h4> <br> 
 
     <p> RM40 </p> 
 
    </div> 
 
    </div> 
 
    <div id="footer"> 
 
    <h2>&copy; Allright Reserved</h2> 
 
    <div> 
 
     <ul> 
 
     <li><a href="#"><i class="fa fa-facebook"></i></a></li> 
 
     <li><a href="#"><i class="fa fa-twitter"></i></a></li> 
 
     <li><a href="#"><i class="fa fa-instagram"></i></a></li> 
 
     </ul> 
 
    </div> 
 
    </div> 
 
</body> 
 

 
</html>

関連する問題