Posts Tagged ‘web design’

Vertically Centered Text

Sunday, July 26th, 2009

So, as promised here is a quick tip that I discovered completely by accident the other day.

As the title suggests, if you want to a single line of text inside of a containing block that has a known height, all you have to do is set the line-height of the text to the height of the block.

For example, if you have a header div with height 100px and want to vertically an h1 tag inside that div, all you need to do is add the following rule to your style sheet:

h1 { line-height: 100px; }

This is what it looks like in practice…

Here is some text

Pretty easy, right?

Remember that this will only if the text you are vertically centering does not wrap to more than one line. If it does the whole thing will break horribly.

Identity

Sunday, July 26th, 2009

So… the three of you reading this must have noticed that I updated the of my blog (finally!). Kinda simple but far from done. I’m not even going to try to support older browsers with this one. If it works, it works. If not, you’ll get a jumbled mess. You shouldn’t even be using any browser older than 6 months anyway.

While thinking about the and what kind of stuff will go on here, I figured my experience doing web stuff is kinda extensive, so I might as well add posts related to web , graphics, etc… If not for you three, but for me as a reference in the future because I tend to forget things easily.

So expect to see posts about me, about my , and about me working. I’m sure I’ll keep you at the edge of your seats.