I have 2 <div>
s each with a <h1>
and a <button>
. I want them to be centered but with space in between. I have scoured the internet looking at countless StackOverflow questions, articles, and tutorials but none of them seem to be working, here is my code: https://jsfiddle.net/obznmdcr/16/
button {
text-align: center;
height: 75px;
width: 225px;
font-size: 30px;
border-radius: 40px;
overflow: hidden;
border: none;
position: relative;
box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.4);
cursor: pointer;
}
.panel-left {
background: rgba(0, 0, 0, 0.2);
border-radius: 10px;
display: grid;
place-items: center;
float: left;
padding: 0px 30px 30px 20px;
vertical-align: middle;
}
.panel-left h2 {
font-family: Helvetica;
text-align: center;
padding-bottom: 5px;
margin-left: auto;
}
.panel-right {
background: rgba(0, 0, 0, 0.2);
border-radius: 10px;
display: grid;
place-items: center;
float: left;
right: 500px;
padding: 10px 20px 30px 20px;
margin-left: 18%;
margin-right: auto;
vertical-align: middle;
}
.panel-right h2 {
font-family: Helvetica;
text-align: center;
padding-bottom: 25px;
}
.btn-left {
background: linear-gradient(90deg, #ff5e62, #ff9966);
}
.btn-left:hover {
background: linear-gradient(90deg, #ff9966, #ff5e62);
}
.btn-left:active {
background: linear-gradient(90deg, #d68359, #d36668);
}
.btn-right {
background: linear-gradient(90deg, #ff9966, #ff5e62);
}
.btn-right:hover {
background: linear-gradient(90deg, #ff5e62, #ff9966);
}
.btn-right:active {
background: linear-gradient(90deg, #d36668, #d68359);
}
<div class="panel-left">
<h2>Title Left</h2>
<button class="btn-left" id="btn" type="button" onclick="console.log('button pressed');">Button Left</button>
</div>
<div class="panel-right">
<h2>Title Right</h2>
<button class="btn-right" id="btn" type="button" onclick="console.log('button pressed');">Button Right</button>
</div>