I want to render some text in a DIV which should appear at the center of the SPAN - both vertically as well as horizontally.
This is my jsfiddle - http://jsfiddle.net/8Syqv/13/
HTML:
<span>something here</span>
CSS:
body { height: 100%; width: 100%; }
span {
position: absolute;
border: 1px red solid;
height: 30%;
width: 40%;
text-align: center;
vertical-align: middle;
left: 0;
margin: auto;
top: 0;
right: 0;
}
I have looked at these:
Vertical and Horizontal alignment of text with CSS
How to center an element horizontally and vertically?
and more..
But, the ideas suggested here did not work on my jsfiddle. I think m missing something here. not sure what>
Thank You