I'm working on a design where I have six buttons that need to be displayed on top of a background image. How can I ensure that the text inside the buttons stays contained within them? Here is the current code structure I am using, which involves utilizing a list method for simplicity:
ul
{
padding:0px;
margin:0px;
width:510px;
float:left;
list-style:none;
background-image: url(http://www.returngis.net/wp-content/uploads/pics/demos/grass.jpg);
z-index:150;
}
ul li
{
width:50px;
height:100px;
padding:20px;
float: left;
display:inline-block;
z-index:100;
}
<ul>
<li><img src="http://via.placeholder.com/350x150" width="50" height="100" />LINK1</li>
<li><img src="http://via.placeholder.com/350x150" width="50" height="100" />LINK2</li>
<li><img src="http://via.placeholder.com/350x150" width="50" height="100" />LINK3</li>
<li><img src="http://via.placeholder.com/350x150" width="50" height="100" />LINK4</li>
<li><img src="http://via.placeholder.com/350x150" width="50" height="100" />LINK5</li>
</ul>