Utilizing CSS effectively can help eliminate redundancy. There are a few ways to share code among four buttons.
Assign a common class to the buttons and style their unique attributes:
<div id="btn1" class="button">Button 1</div>
<div id="btn2" class="button">Button 2</div>
<div id="btn3" class="button">Button 3</div>
<div id="btn4" class="button">Button 4</div>
<style>
.button {
color: blue;
background: white;
/* etc... */
}
#btn1 { background-image: url('uniqueimage1.png');
#btn2 { background-image: url('uniqueimage2.png');
/* etc... */
</style>
Alternatively, but with less favor...
Select multiple elements within one CSS rule:
<div id="btn1">Button 1</div>
<div id="btn2">Button 2</div>
<div id="btn3">Button 3</div>
<div id="btn4">Button 4</div>
<style>
#btn1, #btn2, #btn3, #btn4 {
color: blue;
background: white;
/* etc... */
}
#btn1 { background-image: url('uniqueimage1.png');
#btn2 { background-image: url('uniqueimage2.png');
/* etc... */
</style>