This is more like a CSS question than a GIS one. But I don't have any clue how to center an element that has an absolute position.
Here's some relevant markup for my icon category selector that I create using
ol.control.defaults().extend( new myCustomControlFunction() ); (it's used within a Wordpress plugin that I'm writing and the category buttons are created dynamically based upon the Wordpress categories):
`<div class="ol-taxonomy-selector ol-unselectable ol-control"> <span class="selectbuttons"> <button class="category-name" name="catid" onclick="iconSelectCat(this)">Category Name</button> <!-- one button for each category here --> </span> <button class="mobiletoggle"></button> </div>`
I want to center the horizontal category select bar at the bottom of the map. In ol.css, ".ol-button" is set to position:absolute so that I can position it left, right, top, bottom. But how do I center an element that has position:absolute and a variable width?
It's more a general CSS question but with the code you can see where I want to apply it.