How do I verically center the content of floating div (which height I don't know)?
There is very simple HTML and CSS (see this fiddle: http://jsfiddle.net/DeH6E/1/)
This should be in the middle
border: 1px solid red;
How do I make the sentence "This should be in the middle" appear really in the middle (vertically centered)?
does not seem to work. I have tried
and it didn't work either. What's the best way to solve this issue? I'd like to avoid inserting any other HTML tags, do it just via CSS.
(Just to make it clear: I don't know the actual height of the container, 100px is just for the example)
I'd like you to understand me, so... Always when I design web page, I follow the rule that HTML holds the content and CSS is responsible for the visual style. I never mix them up together or use one just to enable the other. In this case, I want to stick with this rule too. I don't want to insert HTML element just for the CSS.