IE giving small divs a minimum height
JUN
12
2006
I ran into a funny problem recently. I had to build an odd layout for a new website at work that involved text following a bending curve. Well, I just gave different padding to each of the <p> tags to accomplish the flowing effect. There were also divider lines between each paragraph that were shorter horizontally than the paragraphs. So, to get around this, I figured I could just create a div with a set width, a height of 2px, and a border-bottom. Of course, this worked fine in all browsers. . . except IE.
For some reason, the div in IE defaulted to a height of around 10px. This was very odd seeing as how I specified a height of 2px in the CSS. Well, after some playing around and a little Google-ing I figured out the problem. Apparently, IE will override the height property if the line-height is greater than the height. So, to get around this little problem, simply set your line-height to a value equal to or less than the desired height of the div.
Here is my code:
.line {
width: 218px;
height: 2px;
line-height: 1px;
border-bottom: 1px solid #CED9DF;
}
Update: After some more research into the problem, it turns out that IE 6 thinks the height of your div is only as small as your font-size. So, instead of setting your line-height to zero or a small number, set your font-size, like so:
.line {
width: 218px;
height: 2px;
font-size: 0;
border-bottom: 1px solid #CED9DF;
}
Live
MAY
28
2006
The blog is now live! I wrote this to get some practice with Ruby on Rails. The whole process was suprisingly easy. Rails does almost all of the work, so it only took me about two weeks to get the whole thing built in my spare time. Even a chunk of that time was spent designing the layout. I'm not very creative, so I had to look at a lot of other blogs before I could get enough ideas to rip off.
To fill it out a little bit, I've copied over around 12 posts from an old LiveJournal that I used last year when I was in France for two months.
Tagged: rails
Home at Last
FEB
20
2005
Yesterday was my flight back to the US. And of course, it wouldn't be a true international flight for me unless at least seven things went wrong. I started the morning in Beauvais, a small town about an hour north of Paris. We were there because Lauren was flying to Scotland to visit her cousin and her flight left from the airport there instead of in Paris. Also, her flight left really early in the morning, so we spent the night there to make it easier. Well, after she left, I had to take a taxi to the train station in Beauvais. I got out pretty easy because someone else from the hotel had to go the the station too, so we split the cost of the cab. Once I got there, catching my train to Paris was no problem. We even arrived on time. Even in Paris things went smoothly. I caught the train to the airport, no problem. I got to the airport in time, checked in, and at the proper time I boarded the plane.
"Wow," I thought as I sat on the plane waiting to take off, "this is actually going pretty well for once." Of course, that's where everything fell apart. The captain informed us that the hydraulic lift used to load our baggage onto the airplane had broken. Our bags got loaded fine, but they couldn't get the machine away from the plane for us to take off. Well, after about half an hour they fixed it and we took off. The captain assured us we would still land at the scheduled time. Naturally, that didn't happen. We were about 20 minutes late landing. Because our flight had come from France, my luggage didn't automatically get forwarded to my connecting flight. I had to go to the baggage claim, get my luggage, go through customs, then re-check my bags. Keep in mind that because of our delayed take-off I had exactly a one-hour window before my connecting flight left.
So, I go to the baggage claim area and wait patiently. After at least 30 minutes of waiting, the bags finally start to appear. None of them are mine. I keep looking at my watch nervously. I have 20 minutes before my flight leaves, still no bags. I have 15 minutes before my flight leaves, still no bags. I decide "screw it," I'd rather be home than have my bags. I take off running through the airport. I assumed that the gate for my connecting flight will be nearby and 15 minutes will be ample time to make it there. Wrong again. It's all the way across the airport. I ran non-stop until I reached the gate. . . . . . . . five minutes after the plane had left.
By this time, I just want it all to end. I go back to the American Airlines ticket counter and they get me booked on a Delta flight to Atlanta that leaves in an hour. I go check-in with Delta. "I may actually get home tonight," I say to myself. I proceed through the Delta security check. I guess because I haven't had a haircut in a few months and haven't shaved in a week, they think I look like some kind of security threat. I get the full work-up. They thoroughly go through each of my bags. They pat me down, wave the metal detector over every inch of my body, make me take off my shoes, take off my belt, and empty my pockets. Despite this lengthy delay, I still get to the gate on time to board the plane. On the entire airplane, there were maybe 20 other people besides me.
I get to Atlanta on time and my mom is there to meet me. If you recall though, my luggage is still in Chicago because I didn't have time to claim it. So, I have to go to the other side of the airport once I arrive to file a missing bag report with American. Once there, they tell me that since Delta brought me to Atlanta, they have to find my bags for me, even though American is in possession of them. So, I walk back to the other side of the airport and file the claim with Delta. To their benefit, they were a lot more efficient than American. Where it took more than a week for American to return my lost bags in France, Delta had them back to me today (less than 24 hours).
It's good to finally be home.
School
FEB
13
2005
Thursday afternoon I went with Lauren to one of her schools to watch her teach two classes. The little kids (they were between 10 and 12) seemed very confused by my arrival. They all just stared at me and a couple asked Lauren if I was her husband. I sat in the back of the room for both classes, and all during the lessons the kids would intermittently turn around and just stare at me.
After the second class, it was time for recess. We stood outside with a couple of the other teachers watching all of the crazy little bastards run wild. After recess was over, one of the classes Lauren teaches invited us to stay and have some chocolate cake for one of the student's birthday. Well, while we were eating, I guess the students got up their nerves because they started asking me a million questions. . . . in French. About eight of them backed me into a corner all speaking at once asking things like 'do you know spider-man?' 'do you know batman?' 'do you know Spongebob?' 'have you been to Paris?' 'have you been to New York?' I couldn't even answer them because I couldn't understand five people speaking at once.
As we left, two of the little boys shook my hand and all of the students taking English were saying 'goodbye' with very heavy accents.
Stickin It to the Man
FEB
05
2005
We walked downtown today to run errands and we ran into a sea of people. Evidently, there was a protest today about something or other. There were seriously around 800 people carrying flags, chanting, and marching straight down the middle of the street. This really hurt us because the tram that we usually use to get around wasn't running in the middle of town because of all these jackasses. We got a flyer from some dude handing out propaganda. Evidently, liberal politics have been hurting the job market. So, there were a ton of pissed off people.
Popular Posts
Search
Tags
actionmailer activerecord ajax apache apple barcamp caching capistrano centos code golf css db delete eager loading ebay email attachment erb flash ftp fun generators get haml helpers ie sucks javascript jquery lightbox lost merb net ftp paperclip passenger php plexus post presentation rails rails machine railsconf redesign rest rjs routes rss ruby ruby on rails safari script sinatra symfony text replacement tips tutorial twitter xhtml
Projects
© 2010 Travis Roberts. All rights reserved.