You are currently viewing Center a div

Center a div

*!$**%&!!$^!! why won’t you just move!?!

The line of text just sat there stubbornly, nicely aligned to the left margin.

Unfortunately, I wanted it in the centre. 

In the kitchen, over many years, I’ve got much better at not getting angry at inanimate objects. From time to time however, I still do. I’m just much wiser at knowing that the pan, jelly, sauce, egg, pastry, oven, mixer etc really doesn’t care if it hasn’t behaved as I wanted it too. It simply is. 

This line of text however was pushing its luck. It was fortunate that it sat behind a relatively expensive monitor, powered by a relatively expensive laptop. I was unemployed so the prospect of damaging any of my hardware (as though that would help) was simply off the agenda. Plus it wasn’t the hardware’s fault, it wasn’t even the code’s fault.

I knew it was my fault. 

What a @£!!**^&% dumbass. 

Are you sure this is what you want to do….? Move into Tech, learn to code…? 

I’m pretty sure getting text to align in the centre with CSS wasn’t quite quantum computing, yet for the moment I was stumped.

I’d spent the past two hours trying to do very basic styling to a very basic page. I’m pretty sure the allocated time frame was 10 minutes.

What a loser.

For now I had to admit defeat and walk away. My chin hung low and the frontal lobes of my brain were pounding. If my brain had a cooling fan like a laptop does to dump heat from the cpu, it would be working overtime.

After a few encouraging words from my girlfriend I decided to step away.

With a sigh I decided to mooch downstairs to eat some Monster Munch.

This wasn’t going to be easy, that was clear. I’d better start getting used to it.