| «« FanConcert is Syndicated | Page Caching and Personalized Content »» |
|
About
I'm Ryan Lowe, a Software Engineering graduate living in Ottawa, Canada. I like agile software development and Ruby on Rails.
I write this blog in Canadian English and don't use a spell checker. Typos happen.
Projects
» Full-time Ruby on Rails freelancer
» Full-time with Rails since May 2005 » Former committer for RadRails (now Aptana) » I also have a few Rails side-projects in development: 1. wheretogoinTO.com Toronto nightlife 2. Hey Heads Up! TODO list and sharing 3. Layered Genealogy family history research 4. foos for foosball scoring 5. fanconcert for music fans (on hold) Hiring Rails developers? I can telecommute by the hour from Ottawa, Canada »» Email: rails AT ryanlowe DOT ca
BulletBlog
Now hosted on Hey! Heads Up -- check it out!
Syndication
Pings
Recent
Derek Lowe's (Ryan's older brother) words at Ryan's funeral
blog@ryanlowe.ca no more Forging Email Headers: Good, Bad or Ugly? Sarcastic Dictionary (Part 1 of Many) Tags Hierarchies Twisting Rails is Risky Business Risky Business? My Take on Early Alphas Whoa, it's August 2007 Closing Comments A Postscript to "Growth at the grassroots" »» All Blog Posts
Linkage
del.icio.us/ryanlowe
technorati/ryanlowe.ca/blog Aurora Roy Jim Andrew Trasker Travis Kibbee Karen Dr. Unk Ayana Van Bloggers Joel Spolsky Robert Scoble Tim Bray Dave Winer Raymond Chen James Robertson Ruby/Rails Bloggers rubyonrails.org weblog David Heinemeier Hansson Dave Thomas James Duncan Davidson Mike Clark Jamis Buck Signal vs. Noise Tobias Luetke Amy Hoy: (24)slash7 Jeremy Voorhis Eclipse Bloggers Planet Eclipse EclipseZone Luis de la Rosa Eclipse Foundation Kim Horne Billy Biggs Ian Skerrett Mike Milinkovich Bjorn Freeman-Benson Denis Roy
Archives
|
Make a <div> not 100% wide?
Here's a question for my readers: A <div> usually takes up 100% of the width of the page. How do you make it only take up the width needed by its contents? I've tried using width:1px but that just compresses the contents -- the div literally tries to go to 1 pixel. I don't want to use a fixed width like 500px. The only workaround I have so far is to put a table around the div. The table only takes the width it needs for the contents and the div inside it only fills the table, not the whole page. An example is the artist page on FanConcert. I'd rather not have to use a table though. The solution needs to work in the major browsers, any ideas? Posted at February 23, 2006 at 02:17 PM ESTLast updated February 23, 2006 at 02:17 PM EST Comments
Could you use a span instead of a div? » Posted by: Justin Van Patten at February 23, 2006 02:52 PMI forgot to mention that I'm colouring the background and border of this div. A span full of content doesn't behave quite the same way as a div, especially when it comes to borders and backgrounds. So I can't use a span instead, unfortunately. » Posted by: Ryan at February 23, 2006 02:59 PMMy best solution: div { How do the browsers know to apply those with IE only? » Posted by: Ryan at February 24, 2006 07:54 AMIs it only understood by IE and the other browsers just ignore it? » Posted by: Jim at February 24, 2006 08:42 AM |