Reputation: 704
I have a relative
-positioned div, and want to align it using CSS3's lovely calc()
. It's not working.
Apologies for messy code, just mocking up a comparable design to avoid shoving the more complex code surrounding my actual project in your faces.
For some reason, this is throwing an invalid property value error, and I can't work out why. Is there any workaround?
Upvotes: 1
Views: 121
Reputation: 205987
A simple test you can do is:
left: calc(100% + 1px);
if you see it left 100% and just a tiny 1px space.... :D
https://developer.mozilla.org/en-US/docs/Web/CSS/calc (12/2013) says it all:
This is an experimental technology Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.
Upvotes: 0
Reputation: 929
It's working on my browser, but anyways try using the prefixed versions just to make sure, -webkit-calc() and -moz-calc()
Upvotes: 2