Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.17 KB

30.md

File metadata and controls

42 lines (28 loc) · 1.17 KB

📌 30

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.

:octocat:

<div class="parent">
	<div class="child"></div>
</div>
.parent {
	transform: translateY(100px);
}

.child {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 50px;
}

💬 Quotes

"Deciding what not to do is as important as deciding what to do." Steve Jobs

💀 Currently

  • 📖 The Passionate Programmer | 🏃 40%

🏠 back home