I'm so embarrassed that I forgot this projects for a couple of weeks But here I am again. These last weeks had been a mess in Brazil due to the elections. I usually work on elections and I plan to write about it soon.
But let's talk about code: recently I faced a bug related with position: fixed
and transform
. Basically, I have a parent
div with a transform
property applied. Inside of it, there is a child div with fixed
position. The problem is: when you apply transform
to an element, it creates a new context and the fixed children elements start to behave as if they had absolute
position.
Sad! Probably it's a bug between browsers. I got the bug in Google Chrome but in Internet Explorer, the behavior was the expected.
<div class="parent">
<div class="child"></div>
</div>
.parent {
transform: translateY(100px);
}
.child {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 50px;
}
"Deciding what not to do is as important as deciding what to do." Steve Jobs
- 📖 The Passionate Programmer | 🏃 40%