when using the clip:rect(); property are percentages allowed. I thought they were (http://www.hypergurl.com/csstutorial10.html) but whenever I do something like, it seems to ignore the clipping, if yu change the percent to some pt, px, or em it works?!:
well that’s why I kept googling around until I found that “erroneous” site. White W3C has examples with pixels values it does say that only px values are allowed, ot that only % valuels are NOT allowed. poor documenting, me thinks. and since em and pt values work, why not percentages.
which leads me to : why would percentages make sense?
Percentages don’t make sense to me because think about it. What are the percentages basing hte percent off of? For widths when you use percents it bases it off the parents width.
What would the clip percentages base the %'s off of? No sense at all lol
W3.org doesn’t NOT say that percent values can’t be used. On the site they give acceptable values. THey don’t specifically state what value can’t be used.
so, what you are saying is that in this case:
.double{float: left; background: orange; position: relative;color:red; margin:1em;padding:1em }
.none{clear: both}
.double:after{content:attr(title); position: absolute; top:0; left:0; background: yellow; color:black; padding:1em; display: block; clip: rect(auto auto 50% auto); }
what it would calculate would be 50% of the height .double:after, which is… the same height as ( I thought, the same as .double)…
btw, when I test thsi code NOTHING happens… as if its ignoring the rule completely, which is why I thought that the err was in my use of a percent value, as the HTML validates…
The specs don’t define percentages for clip so that’s why they aren’t available.
I guess also that if percentages were allowed then they would have to have some special case applied because in the case of margins and padding percentage values refer to the width of the containing block (even for vertical margins/padding). This of course would not work for clipping in any usable way. It would need to have a meaning similar to height where a height percentage refers to the height of the element but that means there would also need to be a fixed height for this to work.
I don’t see why it couldn’t be made to work though and the specs do hint that irregular shapes may be used in the future so perhaps things will completely change.
I’ve been trying to say that but you say it clearerly
I guess also that if percentages were allowed then they would have to have some special case applied because in the case of margins and padding percentage values refer to the width of the containing block (even for vertical margins/padding). This of course would not work for clipping in any usable way. It would need to have a meaning similar to height where a height percentage refers to the height of the element but that means there would also need to be a fixed height for this to work.
I don’t see why it couldn’t be made to work though and the specs do hint that irregular shapes may be used in the future so perhaps things will completely change.
Logically if you think about it. What would percents base the percent off of? There isn’t an answer to that