Archive for March, 2009
Form input width resize jump
The title won’t make sense unless you’re experiencing the issue.
I recently noticed that I had some weird behavior with input boxes in Safari (not sure if this affects other browsers). When horizontally resizing my window, the input box randomly decides to add a ton of padding below itself. We’re talking at least 50px of space here.
The issue boiled down to bad math. See if you can spot my mistake:
form {
background-color: #d6dde5;
width: 90%;
margin: 20px auto;
border: 0;
text-shadow: #ffffff 0px 1px 1px;
border: 1px solid #B7BDC4;
padding: 1% 1% 1.5% 1%;
}
form input {
font-size: 1.25em;
height: 1.5em;
padding: 1%;
width: 98%;
border: 1px solid #999999;
}
Catch it? The input is 98% wide, with 1% padding on all sides (top, right, bottom and left). This does add up to 100% of the space we allocated (98% of the form itself)….but I didn’t take the border of just 1 dang pixel around the inputs into consideration. This 1px border apparently wreaks havoc when dealing in percentages and caused the behavior I experienced.
Changing my css to read border: 0; fixed the issue.
Moral of the story: always double check your math.
100% column height on a floated div
Nerdy post alert!
I was recently working on a website project and had to create a div with a float:right; attribute. Only problem was, the div needs to be 100% of the height of the parent element. As we all know, floated elements automatically adjust their height to fit their contents.
For the Bible Tells Me So
Just finished watching For the Bible Tells Me So, a documentary that “examine[s] the ways in which conservative Christian groups have used — and sometimes exploited — holy Scripture to deny basic human rights to gays and lesbians around the world.” (Netflix summary)
There’s a quote at the end of the movie that sums it up fairly well:
I can’t for the life of me, imagine that god would say:
I will punish you because you are black, you should have been white.
I will punish you because you are a woman, you should have been a man.
I will punish you because you are a homosexual, you should have been heterosexual.
I can’t for the life of me believe that is how God sees things.
- Archbishop Desmond Tutu, Nobel Peace Prize Laureate
While the documentary was biased against those that condemn homosexuality, it presented both sides of the story frequently enough that even those opposed to homosexuality could gain something from its viewing. My review continues below…
Being grown up isn’t half as fun as growing up
Oh the Ataris.
I’m now two and a half months into my full time job life experience and it’s interesting to say the least. While I’m already missing spring, summer and winter vacations I’ve also grown accustomed to living financially independent. Boy does it feel good.