Using CSS to attribute photos in your blog posts

Rebecca recently made a post about using the AddQuickTags plugin for WordPress to display captions on photos in her blog posts, I would elaborate on the CSS styling it takes to get this. The WordPress plugin makes this easier, but I thought it would be useful to share how you can do this with some simple CSS, especially if you don’t have WordPress at your disposal.

First, how do you get this…

John and Becks by duanestorey on Flickr
Photo credit: duane storey on Flickr

to work?

To start with, you need your image and then link it to its origin or creator to attribute credit to. This is just good practice and makes the original author happy. We’ll have to peak at some quick HTML to get a sense of what’s going on here because we don’t like using visual editors. Code might be tough to work with for some, but it’s second nature to us.

<a href="http://website.com"><img src="http://photosharingsite.com/photo/image.jpg" /></a>

Your HTML might look different, but the premise should be the same. It’s a linked image, but how do you get the “Photo by:” tag underneath the image? Let’s start by adding some code to your CSS.

.captioncentered {
display: block;
text-align: center; /*centers text & image*/
margin: 10px auto; /*centers the whole div*/
padding-bottom: 1px; /*this depends of your design*/
font-size: 0.85em;
color: #ccc;
}

This will make like somewhat simple for you in the long run because this will set the design of your blog to work for all posts you use this styling for. So now what do you do with it?

You just setup a “class” to use in the “div” tag. It works like this.

<div class="captioncentered"><a href="http://website.com"><img src="http://photosharingsite.com/photo/image.jpg" /></a></div>

That centers the image, so now you need to add a little more HTML to this in order to get the credit where it deserves to be. This just requires some text and then linking the words you want linked. However, this extra text must be inside the div tags in order for this to work!

<div class="captioncentered"><a href="http://website.com"><img src="http://photosharingsite.com/photo/image.jpg" /></a>
<br />Photo by: <a href="http://website.com" />author</a> on PhotoSharingSite.com</div>

Once you have this, you are able to to display an image, such as a photo from Flickr, with proper attribution. Why? Because it’s the right thing to do, not to mention a legal way to not get yourself into trouble with the original author for taking their content.

The next thing you can do is edit your CSS to make some adjustment to the look of your text or perhaps the background. It really comes down to what you want to do. There might be a better way to do this, but this is how we get this function to work.

Electric Six – dance commander

It’s been a while since we’ve had a good rock song from YouTube. Walking across the bridge on the way home from work the other day, this popped up on random, and everything seemed better.

Check out more Electric Six if you dig it. We had the extreme pleasure of seeing these guys when we interviewed Aberdeen City for RadioZoom #116

Drupal Camp Vancouver this weekend

It’s harsh to mention this now, but Drupal Camp Vancouver is this weekend. If you haven’t signed up to attend, then you’re out of luck. It’s been sold out for the last few weeks, but that does ensure that this gathering and sharing of knowledge all related to good things Drupal should be a good one.

Drupal Camp Vancouver

I am fortunate enough to be able to attend as well as helping out with the behind the scenes of getting things lined up with some of the sponsors for the event. Working with DaveO, we were able to make sure that they and we were all good to go for a spectacular weekend of talking Drupal.

Unfortunately, my day job prevents me from making Friday’s events until late afternoon, but I’ll be getting into what I can on Saturday. I’m not sure what my coverage of the event will be like this weekend, but be sure to check in on Rebecca to get some insight to the action from her recap from here and there.

Checking out Firefox 3 beta RC3

In an effort to at least post something in about a week, I thought I would make a quick mention of some initial thoughts I had when I downloaded Firefox 3 beta 3. Now to get that in normal people speak, that would be version 3.0 of Firefox, but it’s still in the beta phase of development, meaning that it’s not ready for official, widespread release and/or use. The second 3 means that it’s third in a series of release candidates for the big day when Firefox 3 is finally here.

You still with me?

The first thing I noticed, on my Powerbook G4 with a 1GHz processor circa 2003, is the speed that this browser works. It’s fast. The current release of Firefox, 2.0.0.12, is rough on my laptop. I can only achieve half the speed of the latest beta by plugging in a hard wire connection, and that only makes me even more sad to the reality that this beautiful laptop is ending its life cycle, but that’s a whole other story.

Rebecca has been using it a bit more than I after I told her about how well it operated, but it starts and stops with the speed. There are some minor bugs that still need to be worked out. There are key commands for WordPress that don’t work in the beta release, but that’s less important than the numerous plugins that I rely on daily which need to be updated and ported into this new version. That will come in time, but certainly makes me hesitate to make the upgrade before I get all my tools lined up and readily available.

Phillip sent me a Twitter the other night when I mentioned this, asking if he should download it. I would say that it wouldn’t hurt if you are a multi-browser user. Firefox is my main workhorse, but I also bounce in and out of Safari and Camino. I expect to do the same with this beta release as well, so if you think you are along those lines, then go for it. Otherwise, hold off. This beta release (beta being the very important word here) isn’t quite ready for the big time.

Northern Voice Day 2: Keynote with Matt Mullenweg

I’m not going to say a lot as I wait for this keynote to start, but it’s incredibly cool to have Matt Mullenweg here to start the day off at Northern Voice 2008. So much of what I do is WordPress, so it’s pretty freaking neat that the guy who founded the project is speaking today.

Boris and Matt
Photo credit: Duane Storey on Flickr

Interesting notes during the keynote:

  • WP 2.5 to have one click upgrades to plugins. WP 2.6 to hopefully have one click upgrade to core software.
  • Ha! This Matt just mentioned the Matt I mentioned in my last post. They are in a battle for the highest Google ranking for their first name.
  • “Kill the Megabrands”
  • “When you have the taste of freedom, it’s tough to go back.” Basically, no matter what the open source project is, everyone has the ability to contribute to it, knowing how to code or not.
  • Why shouldn’t the government have more open source information? Otherwise, they are just stealing from us and keeping information to themselves.
  • You can listen to his keynote here.

Rainer Maria – catastrophe

I’ve had this song popping up on my iPod a lot lately when tromping to and from work on the bus, and Rebecca has recently taken a liking to these guys, even though Rainer Maria[wiki] broke up in 2006.

There is something to be said about this being a song about heartbreak, but there is a subtle undertone of a political viewpoint, unintentional or not. I like it when artists are able to do that. It sudden becomes uber-interpretation-able.

Not bad for three kids from the Midwest. Check out the rest of their catalog if you aren’t in the know. I know Beck is.

The Black Keys are coming to Vancouver

I have to say, I’m pretty excited. Even better, Rebecca scored us tickets to the show on April 6 at The Commodore Ballroom. Quite frankly, The Black Keys were the only thing keeping me sane at work today.

Check out the video below for “Just Got To Be”. If you like it, get more of their music. If you really like it, come see the show. I have been well assured that their live performances are quite splendid.

Look what my new Canon camera can do

Ok, this isn’t anything to be overly proud of or that important to showcase, but this is a great example of what my Canon S5 IS can do in movie mode. This is a short video I made within hours of getting this on Christmas morning while driving across the Pattullo Bridge.

The quality of YouTube actually decreases the quality of these videos, not to mention the fact that it records in stereo for the audio. Very cool. I hope to take more advantage of this in the future. I just need to find a good set of rechargeable AA batteries.

The legend of Roger Luttski

The following video was somewhat surprising to find on YouTube, but it doesn’t do the legend of Roger Luttski justice. And thankfully, the person who posted it finally made it embeddable.

Colonial Lanes in Iowa City has made a series of commercials for their bowling ally that have been absolutely hilarious, all while keeping things on a low budget. More so, the creativity compared to production quality doesn’t even compare, but there is only so much you can expect from local commercials, no matter where you are in the world. This, on the other hand, has always been a campaign that is witty, if not completely hilarious.

The tag line of “oh yeah, bowling” is a play on all the things you can do at what is more than just a bowling ally. In fact, it’s something that I still throw out once and a while, but no one has a clue what I’m talking about. I’m not so sure that just this clip even begins to explain it, but it’s still pretty good. And the quality is far superior to the soft, grainy, yet comforting VHS look and sound of their old TV spots.

And who can forget the Tiger Woods spoof of, “I am Roger Luttski”? That one almost made me cry.

This is, or was, a long running theme in their commercials, and I hope it still is. Roger Luttski is a completely fictional character, but he has been portrayed as the same guy for a number of years now. I’m sure it’s not an easy job, but bowling for fun and then stumbling into the realm of a spokes person would be pretty cool.