Sep 12 2008

Pin Your Footers The CSS Way

Category: Programming, Tutorialsstephen @ 7:59 am

I have been using a new CSS tech­nique for cre­at­ing fixed foot­ers – that is, foot­ers which pin them­selves to the bot­tom of the browser win­dow – with­out using JavaScript. Head­scape designer Ed Mer­ritt is the one who came up with the idea, and like most ele­gant solu­tions, this one is so sim­ple that I wish I’d thought of it. It really works.

Assum­ing your basic HTML lay­out markup looks like below:

1
2
3
4
<div id="container">
  <div id="content"></div>
  <div id="footer"></div>
</div>

… you can use the fol­low­ing CSS exam­ple to pin your footer:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#container {
  position:absolute;
  min-height:100%;
}
 
#content {
  margin-bottom:100px; /* same as footer height */
}
 
#footer {
  position:absolute;
  bottom:0;
  height:100px; /* same as content margin-bottom */
}

So, hack away. It’s not suit­able for every design, of course, but it just might help you get rid of that annoy­ing white­space below your footer, for instance on a content-starved page which ends up far short of the win­dow height.

Tags:


Jun 20 2008

ALA: Faux Absolute Positioning

Category: Programmingstephen @ 8:20 am

One of my favorite web pub­li­ca­tions, A List Apart, has pushed an arti­cle about a new CSS lay­out tech­nique that the author, Eric Sol, calls Faux Absolute Posi­tion­ing. Up until now, I’d always relied pri­mar­ily on float­ing divs. Other folks pre­ferred using (real) absolute posi­tion­ing, but that required the use of JavaScript to keep the footer from smoosh­ing things.

For grid­tas­tic designs, this new tech­nique appears to be the best answer CSS has to offer yet. The ben­e­fits of absolute posi­tion­ing, but using rel­a­tive posi­tion­ing + neg­a­tive mar­gins so as not to break the lay­out. I plan to try this out on future sites I work on, so I with­hold final judg­ment, but as things look right now, Eric Sol will end up as my new CSS rock­star hero.

Tags: , ,


Apr 23 2008

New Rails and Django Guides

Category: Programmingstephen @ 9:42 am

A List Apart, the famous online mag­a­zine “for peo­ple who make web­sites,” just pub­lished a pair of arti­cles that help peo­ple who want to start out with Ruby on Rails: Get­ting Started with Ruby on Rails and Cre­at­ing More Using Less Effort with Ruby on Rails.

No more than a day later, Dig­i­tal Web responded with an Intro­duc­tion to Django. I just find it inter­est­ing that we have all of this in the same week.

Ruby on Rails and Django are com­pet­ing web appli­ca­tion frame­works that fol­low the MVC pat­tern. Rails is built on the Ruby pro­gram­ming lan­guage, while Django uses Python. It’s friendly com­pe­ti­tion, of course… it all boils down to whether you’re a Python­ista or a Rubyist.

I am a huge fan of Rails, but I’d also like to learn more about Django… that is, if I can over­come my own Ruby vs. Python bias. One of my fond­est mem­o­ries of SXSW this year was hear­ing Michael Lopp ask from the stage, “What’s wrong with this Python code?” and some­one in the audi­ence called out, “It’s not Ruby!”

Oooh, snap!

Tags: ,


Aug 28 2006

Designers, I feel ya

Category: Design, Humor, Programmingstephen @ 9:40 am

The real rea­son design­ers don’t con­tribute to open source [via Encyte­Me­dia].

ROTFL.

I do apol­o­gize to any designer on whom I’ve inflicted (or attempted to inflict) Sub­ver­sion pain. While ver­sion con­trol remains a nec­es­sary evil of soft­ware projects, svnX exists for those who are command-line shy…

So Brian let me know when you’re ready to check out the lat­est tree. User/pass: brian/w4?vteRsZvx3v#$U&TFCxsdfs^^^. Haha.


Aug 15 2006

Welcome Mephisto

Category: Programming, Railsstephen @ 12:52 pm

Every­one say hi to Mephisto, a way-cool Rails blog­ging engine. The two heavy­weights behind it are none other than Rails Core devel­oper Rick Olsen and DOM-scripting genius Justin Palmer.

Need­less to say, I’ll be watch­ing the project with much inter­est in the next few months, and I may seri­ously con­sider con­vert­ing my blog over when trunk reaches 1.0. It’s at 0.5 now and there is already a really nice selec­tion of refined fea­tures. The default tem­plate is the excel­lent Hem­ing­way by Kyle Neath, and the tem­plate sys­tem uses Tobi Lütke’s Liq­uid engine. One thing I always look for is how a blog would han­dle poten­tial com­ment spam; Mephisto cur­rently uses Akismet, which requires an API key.

Ain’t open source soft­ware grand? I love it when a plan comes together.


Next Page »