Basic example
example.css
transform: translateY(calc(cos(45deg) * 40px));
The cos() function returns the cosine of an angle.
transform: translateY(calc(cos(45deg) * 40px));transform: translateY(calc(cos(45deg) * 40px));transform: translateY(calc(cos(45deg) * 40px));cos() is a modern CSS feature.
Supported in current major browsers with progressive enhancement.
Bottom line: Keep a readable fallback when using newer syntax.
Continue with rgb().
CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
2 people found this page helpful