Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Minor HTML Code Driving Me Crazy, Can U Help?


  • Please log in to reply
3 replies to this topic

#1 jbylake

jbylake

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:09:38 PM

Posted 08 January 2011 - 02:18 PM

If I use this code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<Title>AmericanTwinCycles</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style type="text/css">
.style1 {
vertical-align: top;
margin-left: 50px;
margin-right: 50px;
margin-top: 10px;}

}
</style>
</head>
<body style="color:#FFFFFF; background-color: #000000">
<center><img class="style1" height="150" src="atcbanner.gif" width="1200" ></a></p><br><br>

<FORM METHOD="link" ACTION="shop.html"><INPUT TYPE="submit" VALUE=" Shop Now ">
<FORM METHOD="link" ACTION="contact.html"><INPUT TYPE="submit" VALUE=" Contact Us ">
<FORM METHOD="link" ACTION="cust.html"><INPUT TYPE="submit" VALUE=" Customer's Bikes ">
<FORM METHOD="link" ACTION="tech.html"><INPUT TYPE="submit" VALUE=" Tech Tips ">
<FORM METHOD="link" ACTION="about.html"><INPUT TYPE="submit" VALUE=" About Us "></FORM>



<br><br>
</body>

</html>
<a href="about.html">

I get a nice Horizontal display of my buttons, but they all link to the first page which is "shop.html", no matter what button you click:

Now, if I close all <Form lines like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<Title>AmericanTwinCycles</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style type="text/css">
.style1 {
vertical-align: top;
margin-left: 50px;
margin-right: 50px;
margin-top: 10px;}

}
</style>
</head>
<body style="color:#FFFFFF; background-color: #000000">
<center><img class="style1" height="150" src="atcbanner.gif" width="1200" ></a></p><br><br>

<FORM METHOD="link" ACTION="shop.html"><INPUT TYPE="submit" VALUE=" Shop Now "></FORM>
<FORM METHOD="link" ACTION="contact.html"><INPUT TYPE="submit" VALUE=" Contact Us "></FORM>
<FORM METHOD="link" ACTION="cust.html"><INPUT TYPE="submit" VALUE=" Customer's Bikes "></FORM>
<FORM METHOD="link" ACTION="tech.html"><INPUT TYPE="submit" VALUE=" Tech Tips "></FORM
<FORM METHOD="link" ACTION="about.html"><INPUT TYPE="submit" VALUE=" About Us "></FORM>



<br><br>
</body>

</html>
<a href="about.html">

....with the closing brackets </FORM> they will align Vertically, and link to the correct *.html pages.

I would prefer that they display horizontally, but I've read every book I've got, and surfed the web until exhausted, I can't find a solution,
except for Java and PHP, which I don't know. I would prefer to keep this project HTML. Is there an easy solution to this so that they (buttons) will align Horizontally, and link to the correct pages?

Any help you could provide would be greatly appreciated, and keep me from having a nervous breakdown?
Seriously, Thanks for any help in advance!

J.

BC AdBot (Login to Remove)

 


#2 Nate15329

Nate15329

  • Members
  • 92 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:WI, USA
  • Local time:08:38 PM

Posted 08 January 2011 - 03:40 PM

Here Try This:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<Title>AmericanTwinCycles</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style type="text/css">
.style1 {
vertical-align: top;
margin-left: 50px;
margin-right: 50px;
margin-top: 10px;}

}
</style>
</head>
<body style="color:#FFFFFF; background-color: #000000">
<center><img class="style1" height="150" src="atcbanner.gif" width="1200" ></a></p><br><br>
<table><tr><td><FORM METHOD="link" ACTION="shop.html"><INPUT TYPE="submit" VALUE=" Shop Now "></FORM></td>
<td><FORM METHOD="link" ACTION="contact.html"><INPUT TYPE="submit" VALUE=" Contact Us "></FORM></td>
<td><FORM METHOD="link" ACTION="cust.html"><INPUT TYPE="submit" VALUE=" Customer's Bikes "></FORM></td>
<td><FORM METHOD="link" ACTION="tech.html"><INPUT TYPE="submit" VALUE=" Tech Tips "></FORM></td>
<td><FORM METHOD="link" ACTION="about.html"><INPUT TYPE="submit" VALUE=" About Us "></FORM></td></tr></table>
<br><br>
</body>

</html>
<a href="about.html">

#3 jbylake

jbylake
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:09:38 PM

Posted 08 January 2011 - 06:38 PM

Thanks, so much. I don't know how I missed those tags, but anyway you were a great help. I did learn and won't make the same mistake again, thanks to you. Hope I can pass HTML help on to someone else someday.

Again,
Thanks,
Jim.

#4 MelissaPleases

MelissaPleases

  • Members
  • 537 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:Now in the Heartland of the USA
  • Local time:08:38 PM

Posted 11 February 2011 - 10:52 AM

Coming to this pretty late, but I'd like to add a comment here about CSS. CSS can be used with great efficiency in defining exactly how each page of a web site will appear. In your case, simply naming the forms area something like "form," and then setting up a parameter like this:

#form form {
display: inline;
}

in a CSS file would display your buttons horizontally.

Also, in your first example, you opened five <FORM> tags, but only closed one. The way the tags work, you actually only closed the first <FORM> tag, which is why all of the buttons took you to "shop.html."

Snowden03.png

~   Notorious Thread Killer   ~
Case: CoolerMaster Storm Trooper Full ATX | Motherboard: GIGABYTE GA-Z170X | CPU: Intel Core i7-6700K 8M Skylake Quad-Core | GPU: MSI Radeon R9 390X 8GB 512-Bit | PSU: EVGA 80 PLUS GOLD 850 W | RAM: Corsair Vengeance DDR4 SDRAM [4x8GB] Audio: Integrated Creative Sound Core 3D 5.1 | Internal Storage: Samsung 2 TB HDD | Seagate 1 TB HDD | Samsung 500GB SSD [x2] | Mushkin 500GB SSD | External Storage: Seagate 2TB | Optical Drive: Lite-On iHAS324 Dual Layer

Display 1: AOC I2757Fh 27" | Display 2 & 3: LG 24MP57HQ-P 24" | Operating Systems: OS 1: Windows 10 Professional | OS 2: Linux Mint Cinnamon | OS 3: Windows 7 Ultimate x-64 | Antivirus: MS Security Essentials | Firewall: Windows Firewall





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users