I am trying to vertical align text inside two div's. I have tried a number of solutions found here but none produce the required result.
I have crated a sjFiddle:
#outer {
position: relative;
}
#inner1 {
position: absolute;
align-items: center;
top: 10%;
bottom: 10%;
width: 100%;
height: 40%;
}
#inner2 {
position: absolute;
align-items: center;
top: 50%;
bottom: 10%;
width: 100%;
height: 40%;
}
html,
body {
height: 100%;
}
#outer {
background-color: purple;
width: 50%;
height: 50%;
}
#inner1 {
background-color: yellow;
}
#inner2 {
background-color: red;
}
<div id="outer">
<div id="inner1">
Test text 1
</div>
<div id="inner2">
Test text 1
</div>
</div>
Can anyone see how I can do this based on the code in my fiddle. Many thanks in advance for your time.