Link or Button?

acer34e

New Member
I learned CSS and basic xhtml while I was working for a Web Design start-up. The business has taken off, but I have missed out on some basics. I wouldn't know where to start making an html table (though I hear that's no loss).
I had made a few product includes for a customer and there were two links that needed to be put in place: a buy button that adds a quantity of one to an off site shopping cart, and a Learn More button that goes to a Product Info. Page. I coded them as links( <a href> ) and a colleague said it should be an input type=button. Unfortunately he didn't say why, and I can't find anything via google to justify this. It's not that I don't believe him, I do, and I am changing it now, but I want to know for future reference when buttons should be used instead of links and why. Is there a reason why it's going to work better than a link? Is it easier to format with CSS?
Thank you for your help. I hope your answers will make a good tutorial for anyone else wondering the same.
 

jmad

New Member
hope i am understanding ur question right. the learn more button should jus be a link but the buy button should be a input because u r wanting to send that input.
maybe something like this :
<form name="form" method="post" action="offsite_shopping_cart.php">
<input type="hidden" name="item" value="+1">
<input type="submit" value="item">
</form>
hope this helps i did somthing like this for a client of mine. the of site is the name of the page ur sending the input to. for more info on this go to w3schools.com look up forms in html.
 

zkiller

Super Moderator
Staff member
the only reasoning i can think of why a button/ form would be better is that it allows you to send various hidden information, such as variables, that the user does see.

in regards to html tables - while these are not needed when using html in conjunction with css, they are still a very handy tool and they don't have any cross browser compatibility issues. here is an example of a very basic table...

Code:
<table>
   <tr> -table row
      <tr>content here</tr> -table colum or cell. 
      <td>more content here</td> -one cell can span multiple colums
   </tr>
</table>
hope that helps. :)
 
Top