If you're looking to center align the text within a div horizontally, without affecting vertical alignment, here's a solution for you:
To horizontally center align the text, you can use the following HTML and CSS code:
HTML Code:-
<div class = "galf">
<a>Hello</a>
</div>
CSS Code:-
.galf {
width : 100%;
height : 45.3%;
border: 1px solid;
text-align:center;
}
You can view the demo on JSFiddle by clicking on the following link:
https://jsfiddle.net/y59o0rjc/
If you also want to vertically center align the text within the div, you just need to make a small modification in the CSS as shown below:
.galf {
width : 100%;
height : 45.3%;
border: 1px solid;
text-align:center;
display: table;
}
.galf a {
display: table-cell;
vertical-align: middle;
}