Home About Icons Models Papercraft Photos Shirts

Welcome to Nuclear Pixel!

Nuclear Pixel is the personal website of Admiral Potato.
The page you are currently viewing is probably his blog.



Cool HTML5 CSS Absolute Center Trick

Posted by Admiral on 2010-02-05 01:32:55

For the longest time, I've been trying to figure out just how exactly to center elements on a page using only CSS properties, and without having to use an HTML 4.01 transitional DTD and telling a table to be 100% wide and 100% tall, aligning it's contents to center, then valigning them to middle. I think I've finally found a way to do it.

Tonight, I stumbled across a really nifty little trick that Safari uses to center lone multimedia elements on pages. Safari does this when you visit links to MP3s or other Quicktime readable multimedia across the web, and the destination ends up being a browser window rather than a forced download. I discovered this when I right clicked on the background of one such page and selected the "Inspect Element" contextual menu item.

Screenshot of one of Safari's debug features showing off a really cool CSS trick

If you use Safari and don't have the "Inspect Element" contextual menu option available when you right click inside a page, you probably need to go to the "Advanced" tab in your Safari preferences and click the "Show Develop menu in menu bar" checkbox. FireFox users can get a similar functionality by installing FireBug, which is, for the record, totally the sweetest Javascript debugger around. That I have used. To date.

Anyway, here's a basically what's happening above:

<style> .center{ margin: auto; position: absolute; top: 0px; bottom: 0px; left: 0px; right: 0px; } </style> <img src="some_image.png" class="center">

You can view a quick demo of this sweet trick in action on a quick little page I wrote up to test this, and download a copy of the source for the trick and play with it yourself.

Please keep in mind that this trick only works in the good browsers, and not in the bad browsers. Screenshots were provided by Adobe BrowserLab.

Remember kids, the sooner we can get all of our families and friends using one of "The GOOD browsers", the sooner IE will loose its market share, and the sooner we can to stop catering to Microsoft's inadequacies.

Tags: css | explorer sucks | html5 | webdesign

Bookmark and Share

New Picture-Rama 2 update finally on the way!

Posted by Admiral on 2010-02-03 01:25:48

Update:Picture-Rama 2 has been updated! Download it here.

So why has it been over 7 months since I last updated or re-compiled Picture-Rama 2? Well, I think I'll summarize it like this: New girlfriend, travel, loss of friends, LOSS OF DATA DUE TO FAILURE OF WESTERN DIGITAL HARD DRIVES (Is it clear that I'm pissed about that?), cars parked at my place getting broken into and stolen outright, and most recently, concentration on changing jobs and writing and designing myself a beautiful new website. These things have all either wasted my time outright (I'm looking at you, WD) or taken significant chunks of my time to work through or live with, but I'm finally getting around to making PR2 happen again.

I am really, really excited to finally be getting back on the ball with this project.

As of my publishing this, I am headed to bed after clicking the "Render" button in After Effects, and my trusty 1.5ghz single core G4 12-inch laptop will churn away on generating another fabulous installation of the compilation as I drift off to sleep.

A preview of my favorite recent image from the collection:

Nogias is being temporarily overlooked in favor of a tasty, tasty JalapeƱo in the foreground.

Sorry for the delay, everyone! I'll post an update when Mnemosyne has finished cranking out and uploading a web-ready version for your viewing pleasure.

Tags: finally | photos | picture-rama 2 update

Bookmark and Share


Creative Commons License
This page and its contents were created by Admiral Potato.
All content created by Admiral is licensed under a Creative Commons Attribution-Noncommercial 3.0 United States License.
All content not created by Admiral is Copyright it's own respective owners.

This page was written using valid HTML5 & CSS3. Explorer can suck it.