I've defined an html/css page with the following code:
<!DOCTYPE html>
<html><head>
<title>TEST1</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.main-rows {
display: flex;
flex-flow: column;
}
.main-columns {
display: flex;
flex-flow: row;
}
.dividerv {
background: black;
width: 4px;
}
.dividerh {
background: black;
height: 4px;
}
</style>
</head>
<body>
<div class="main-rows">
<div>
This is an example text <br/>
This is an example text <br/>
This is an example text <br/>
This is an example text <br/>
<br/>
<br/>
</div>
<div class="dividerh"></div>
<div class="main-columns">
<div class="dividerv"></div>
<div class="main-rows">
<div style="border: 1px solid black;">
<button style="margin: 0 auto;">→</button>
<div>blah, blah, blah, blah</div>
<button>←</button>
</div>
<div style="border: 1px solid black;">
<button style="margin: 0 auto;">→</button>
<div>blah, blah, blah, blah</div>
<button>←</button>
</div>
</div>
<div class="dividerv"></div>
<div class="main-rows">
<div style="border: 1px solid black;">
<button style="margin: 0 auto;">→</button>
<div>blah, blah, blah, blah</div>
<button>←</button>
</div>
</div>
<div class="dividerv"></div>
</div>
</div>
</body>
</html>
The main question is: how to center horizontally the buttons with the arrows ? I've tested several solutions based on "text-align" and similar but without success (please, take that into account before to flag as duplicated).
In addition, it will be welcome how to simplify this code. In particular, how to skip the need to repeat the blocks as:
<div style="border: 1px solid black;">
<button style="margin: 0 auto;">→</button>
<div>blah, blah, blah, blah</div>
<button>←</button>
</div>
that will change from one to other only in the actions associated to each button ("onclick" functions) and the text that appears between the buttons. Could be a javascript solution could allow this part.
Thanks a lot.