Forum Moderators: not2easy
CSS
#mybutton ul li
{
position: relative;
top: 100px;
left: 100px;
list-style-type: none;
padding: 0;
margin: 0;
display: block;
float: none;
background: url(images/mybutton.gif) repeat-x 20px;
height: 20px;
line-height: 20px;
text-indent: 10px;
font-size: 8pt;
font-weight: bold;
width: 94px; /* width of buttons */
}
#mybutton a
{
color: #008800;
text-decoration: none;
display: block;
width: 94px; /* width of border */
border-top: 1px solid #008800;
border-bottom: 1px solid #008800;
border-left: 1px solid #008800;
border-right: 1px solid #008800;
}
#mybutton li#active { background: url(images/mybuttonhover.gif) repeat-x 20px; }
#mybutton a:hover { background: url(images/mybuttonhover.gif) repeat-x 20px; }
-----------------------------------------------
To replace this;-
HTML
<input type="image" id="addtobasket1" name="submit" alt="Add to Basket" src="images/addtobasket.gif" />
</form>
CSS
#addtobasket1
{
position: relative;
top: 150px;
left: 100px;
height: 21px;
width: 94px;
}
Is so how? What do I do about the ><a href="#"> in the origional button
Thank you in advance
Further, if you're using a link, you'll have to use javascript to submit the form--which could cause you to lose sales to visitors with javascript turned off in their browsers.
If you have some need to place the button in a list (e.g. because it's in a menu etc), just place the whole <form> into the <li>--it'll validate and shouldn't cause too much in the way of additional styling problems.
-b
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal">
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="cmd" value="_cart"/>
<input type="hidden" name="business" value="info@####.co.uk"/>
<input type="hidden" name="item_name" value="Live Micro Algae Culture"/>
<input type="hidden" name="item_number" value="Product #100"/>
<input type="hidden" name="amount" value="12.50"/>
<input type="hidden" name="page_style" value="Primary"/>
<input type="hidden" name="return" value="http://www.####.co.uk/index.htm"/>
<input type="hidden" name="cancel_return" value="http://www.####.co.uk/index.htm"/>
<input type="hidden" name="no_shipping" value="2"/>
<input type="hidden" name="no_note" value="1"/>
<input type="hidden" name="currency_code" value="GBP"/>
<input type="image" id="addtobasket1" name="submit" alt="Add to Basket" src="images/addtobasket.gif" />
</form>
Please can you explain in more basic terms how I integrate the above form into this
<div id="mybutton">
<ul id="basket1">
<li><a href="#">Add to Basket</a></li>
</ul>
</div>
Sorry to sound so dim but I am a marine biologist not a web site designer
Thank you in advance
You're asking how to use a link as a button, but a link isn't a button--even though superficially (i.e. in terms of operation) they appear to work the same way. You can add button-type behaviour to a link with javascript if you need to, but there are some very good reasons to avoid this if it's possible.
What I would like to know is why you want to do this. A good answer to that question will make it easier to figure out what to tell you.
-b
But back to the question--given that:
...why do you want to use <a href="#">...</a> (a link) instead of <input type="submit" value="..." ... /> (a button)?
The code you've posted doesn't work that way. Presumably, you just need to replace this bit:
<input type="image" id="addtobasket1" name="submit" alt="Add to Basket" src="images/addtobasket.gif" /> ...with something along the lines of:
<input type="text id="addtobasket1" name="submit" value="Add to Basket" /> ...and:
#addtobasket1 { /* CSS for submit button */ }
-b
* With some small exceptions, as mentioned, for Safari and Camino at least...
Best Regards
Best Regards