Welcome to WebmasterWorld Guest from 184.108.40.206
Forum Moderators: not2easy
can safely assume validation is not going to solve this because I remember it hasn't when I have been validating once upon a time.Validation may not solve the problem, but invalid code introduces variables that can make it impossible to identify and therefore resolve the actual issue.
It's just a waste of time.
I trust this link will express my feelings about validation:
@alt131; I haven't rejected the idea of defining line-height on individual divsJust to clarify, it's the input - and must be !important (which is usually something to avoid) to override any default stylesheet setting.
By erasing the margin values and using padding on container div seemed to reduce the inaccuracy.And that has the sound of margin collpasing - which would exdplain why I couldn't reproduce the issue here, and makes it even more intersting. Is it possible to post some more html and css for the surrounding elements?
Feeding your enemy's url into the validator so you can snicker about the number of errors is a time-honored form of innocent entertainment.
By obvious analogy, insurance is a waste of money. I hate to think how many thousands I've thrown down the tubes over the years, just to cover eventualities that didn't happen.
So the function of !important is overriding default stylesheet settings then. Doesn't that apply automaticly when you define your own values?Not quite - the cascade assigns a "weight" to rules, and !important gives a rule more "weight", so usually it will be applied unless your own rules ahve a greater weight or specificity.
I've seen it in use before but never understood it. Isn't that the same function of reseting css (http://meyerweb.com/eric/tools/css/reset/?Again, not quite. A reset will only "reset" rules that have a lesser weight. Useful reading on this is the cascade (section 6.4) [w3.org]. A reset relies on having greater weight, usually because it is applied last. However, !important will mostly retain greater weight, so won't be over-ridden.
Well, actually I don't understand what do you mean by "weightdid you read the explanation at the link I posted above? That should explain it, but if not, another way of understanding is to think of real weights - it really is this simple :). Say you have 100 items. The first weighs 1kg, the second weighs 2kgs, and so on up to 100kg. Obviously the item that weighs 100kgs has a greater "weight" than the thing that only weighs 1kg. In css different types of style sheets, and different types of rules are given a "weight" - and the rule with the greatest (largest) "weight" is applied.
you're basicly saying the reset function simply overrides the previous rules while !important makes them unoverridible. Did I get that correct?Usually yes - as explained in the recommendations I linked to, a rules "weight" will depend on the cascade, and also specificity. However, as a general guide, !important will usually have a greater "weight" - so as you say - will be "unoverridible".