123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|358|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Off Topic -> HTML vs Coders Logic

Tue, 29 May 2012, 12:11
spinal
Proper coding and html/css don’t seem to work the same way the simplest things seem wrong to me.

-=-=-
Check out my excellent homepage!
Tue, 29 May 2012, 12:11
9572AD
html/css is "markup". Mental dilemma solved. Also, a lot of it is very wrong. I gave up in the early days of html4, and it doesn't look to be any better today.

-=-=-
All the raw, animal magnetism of a rutabaga.
Tue, 29 May 2012, 12:15
JL235
-hugs HTML-

The different sections make a lot of sense to me. When I used to use Java, it was always a pain, due to how much stuff I had to code to make a simple GUI.
Tue, 29 May 2012, 12:41
HoboBen
Outside of the more advanced CSS tricks, I've found that 99% of problems can be solved by

* never using em units
* never put width & padding or height & padding into the same CSS rule.

That at least gets things looking the same in different browsers

-=-=-
blog | work | code | more code
Tue, 29 May 2012, 14:03
JL235
Hoboben never put width & padding or height & padding into the same CSS rule.

I presume because it gets added on? You can change that behaviour using 'box-sizing', which is much more natural.

The code to do this is:

There is also a '-webkit' version, but Chrome and Safari support the non-webkit prefix, so it's just not needed. It is however still needed for FF.

Border-box is also what IE was doing when it famously get got border sizes wrong, although it wasn't actually standardized for all elements at the time, so it was neither right or wrong. Personally, I think IE got it right, padding should erode inward by default, as this is how most designers think about a layout.