You can simply use the "button" element. I'm not quite sure what you want to achieve, but you can give 10 buttons of the same class.
HTML:
<button class="myButton" onClick="location.href='myPage.html'")>Log In</button> <button class="myButton" onClick="location.href='anotherPage.html'")>Next Link</button>
CSS
.myButton{ background-image:url("image.jpg"); } .myButton:hover{ background-image:url("hover.jpg"); }
I could completely abandon what you are trying to achieve, but this will work for what I think you are trying to achieve.
You also cannot stylize a button at all and get a good hover effect on your own, but it will not be the same in every browser.
You can also use regular anchor tags, for example, what you have is to give them a class that will work on all buttons:
<a class="myButton" href="myPage.html">Log In</a> <a class="myButton" href="anotherPage.html">Link 2</a>
Oh, and if you donβt want to do this, just keep your buttons the same as they are now, just duplicate your HTML, change where the links and text bind, for example:
<body> <ul> <li> <a href="#" class="my_button"> <div style="width:77px"> <div class="left"></div> <div class="middle">Log In</div> <div class="right"></div> </div> </a> </li> <li> <a href="#1" class="my_button"> <div style="width:77px"> <div class="left"></div> <div class="middle">Different link</div> <div class="right"></div> </div> </a> </li> <li> <a href="#2" class="my_button"> <div style="width:77px"> <div class="left"></div> <div class="middle">Another link.</div> <div class="right"></div> </div> </a> </li> </ul> </body>
Adding a PHP solution.
functions.php:
<?php function myButton($link, $title){ echo '<a href="'.$link.'" class="my_button"> <div style="width:77px"> <div class="left"></div> <div class="middle">'.$title.'</div> <div class="right"></div> </div> </a>'; } ?>
Your new page will be page.php (not html)
page.php:
<?php include_once 'functions.php'; ?> <body> <ul> <li> <?php myButton('link.html', 'Click Me') ?> </li> <li> <?php myButton('anotherlink.html', 'No, Click Me!') ?> </li> </ul> </body>
This will allow you to shorten the code while maintaining the current structure. It will also allow you to type one line of code and dynamically add your button.
Let me know if you want more information.