按钮引导我到另一页

时间:2017-06-20 23:37:41

标签: html css

所以我遇到了一些关于购买按钮的问题。每次我点击“立即购买”按钮,它会引导我进入“关于我们”页面。我真的不知道出了什么问题,我希望你能帮助我。 谢谢你们

的Emal

<style>
.Button {
    background-color: Plum;
    border: 1px solid;
 border-color: black;
    color: white;
    padding: 10px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
 font-family: hacked;
 border-radius: 8px;
 text-shadow: 2px 2px grey;
 
}

  .sub {
  position: relative;
}
.itmHolder {
  position: relative;
}

  
  
  .itmHolder:nth-child(2),
.itmHolder:nth-child(3) {
  position: absolute;
  top: 0;
}
.og {
  margin-top: 50px;
  position: center;
  text-align: center;
}
h1 {
    font-size: 400%;
 color: Plum;
 text-shadow: 3px 3px Black;
}
body {  
    background-image: url("lightning.gif");
    background-repeat: no-repeat;
    -webkit-transform: rotateX(0);
    background-size: cover;
    background-position: center center;
   min-height: 100vh;
}
p  {
   color: Plum;
   text-shadow: 2px 2px Black;
}
h2 {
  color: DarkGreen;
  text-shadow: 2px 2px Black;
}

a:link, a:visited {
    color: black;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}
</style>
<!DOCTYPE html>
<html>
<head>
</head>
<font size=60><center><h1 style="font-family:blowbrush;">Buy now</font></center></h1><form action="side2.html">
<body background="background.jpg">
<title>Our Future</title>
  <div class="og">
  <div class="itmHolder">

  <div class="sub">
       <button type="button" class="Button"><a href="selve_websiten.html">Frontpage</a></button>
	   <button type="button" class="Button"><a href="side2.html">About us</a></button>
    </div>
 <br></br>
 
 
 
 
<center><font size=6><p style="font-family:levirebrushed;">No Turning Back - Steam Code</font></p><h2 style="font-family:levirebrushed;"><font size=6> 1,99€</h2></font></center>


<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

  <!-- Identify your business so that you can collect the payments. -->
  <input type="hidden" name="business" value="EmalGod@hotmail.com">

  <!-- Specify a Buy Now button. -->
  <input type="hidden" name="cmd" value="_xclick">

  <!-- Specify details about the item that buyers will purchase. -->
  <input type="hidden" name="item_name" value="No Turning Back - Steam Code">
  <input type="hidden" name="amount" value="1.99">
  <input type="hidden" name="currency_code" value="EUR">

  <!-- Display the payment button. -->
  <input type="image" name="submit" border="0"
  src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_buynow_107x26.png"
  alt="Buy Now">
  <img alt="" border="0" width="1" height="1"
  src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >

</form>
  
  
  
  

</form></center>
</body>
</html>

2 个答案:

答案 0 :(得分:1)

表单中的

<button>标记充当<input type="submit">。这里的问题是您<a>内有<button>个问题。由浏览器实现决定在这种情况下必须发生什么。换句话说,这是未定义的行为。

现在,通过采取以下挑战,您肯定会学到很多东西:从HTML代码中删除所有<font><center>代码以及style属性,链接.css文件使用<link>标记,并尝试尽可能接近页面的原始外观,只在此外部文件中使用样式声明。关于<font>大小的CSS等价物的This question可能有所帮助。

相信我,它会对你有所帮助。

答案 1 :(得分:0)

您的代码非常无效,但主要原因是此<form action="side2.html">形式 - 它包含了您网页的大部分内容,包括您的PayPal表单。

form元素不能包含form元素。

https://www.w3.org/TR/html5/forms.html#the-form-element

  

内容模型:流内容,但没有form元素后代。

删除form(因为我目前没有看到它的用途......),或者只将它包装在需要包含它的元素周围。

您还应该通过validator运行代码,并清除所有无效的,格式错误的HTML。

.Button {
    background-color: Plum;
    border: 1px solid;
 border-color: black;
    color: white;
    padding: 10px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
 font-family: hacked;
 border-radius: 8px;
 text-shadow: 2px 2px grey;
 
}

  .sub {
  position: relative;
}
.itmHolder {
  position: relative;
}

  
  
  .itmHolder:nth-child(2),
.itmHolder:nth-child(3) {
  position: absolute;
  top: 0;
}
.og {
  margin-top: 50px;
  position: center;
  text-align: center;
}
h1 {
    font-size: 400%;
 color: Plum;
 text-shadow: 3px 3px Black;
}
body {  
    background-image: url("lightning.gif");
    background-repeat: no-repeat;
    -webkit-transform: rotateX(0);
    background-size: cover;
    background-position: center center;
   min-height: 100vh;
}
p  {
   color: Plum;
   text-shadow: 2px 2px Black;
}
h2 {
  color: DarkGreen;
  text-shadow: 2px 2px Black;
}

a:link, a:visited {
    color: black;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}
<!DOCTYPE html>
<html>
<head>
</head>
<font size=60><center><h1 style="font-family:blowbrush;">Buy now</font></center></h1>
<body background="background.jpg">
<title>Our Future</title>
  <div class="og">
  <div class="itmHolder">

  <div class="sub">
       <button type="button" class="Button"><a href="selve_websiten.html">Frontpage</a></button>
	   <button type="button" class="Button"><a href="side2.html">About us</a></button>
    </div>
 <br></br>
 
 
 
 
<center><font size=6><p style="font-family:levirebrushed;">No Turning Back - Steam Code</font></p><h2 style="font-family:levirebrushed;"><font size=6> 1,99€</h2></font></center>


<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

  <!-- Identify your business so that you can collect the payments. -->
  <input type="hidden" name="business" value="EmalGod@hotmail.com">

  <!-- Specify a Buy Now button. -->
  <input type="hidden" name="cmd" value="_xclick">

  <!-- Specify details about the item that buyers will purchase. -->
  <input type="hidden" name="item_name" value="No Turning Back - Steam Code">
  <input type="hidden" name="amount" value="1.99">
  <input type="hidden" name="currency_code" value="EUR">

  <!-- Display the payment button. -->
  <input type="image" name="submit" border="0"
  src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_buynow_107x26.png"
  alt="Buy Now">
  <img alt="" border="0" width="1" height="1"
  src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >

</form>
  
  
  
  

</center>
</body>
</html>