You are on page 1of 22

The Wonderful World of Bugs

by Andy Budd of Clearleft.com


1

Hacks
by Andy Budd of Clearleft.com
2

How many people feel they use too many hacks?

and how many people feel that use too few?


by Andy Budd of Clearleft.com
3

Hacks have been given a bad name


literally
by Andy Budd of Clearleft.com
4

Wouldnt be here today if it wasnt for CSS hacks

by Andy Budd of Clearleft.com

Sadly, hacks have become synonymous with CSS

by Andy Budd of Clearleft.com

It doesnt have to be this way

by Andy Budd of Clearleft.com

Bug Fixing
by Andy Budd of Clearleft.com
8

Browsers are buggy

but not as buggy as wed like to think

by Andy Budd of Clearleft.com

Bugs come from lots of places


Syntactic errors Specicity clashes Overly complicated code Browser bugs Incomplete understanding of the
CSS specication

by Andy Budd of Clearleft.com

10

Andys rst law of bug xing


keep it simple (stupid)

by Andy Budd of Clearleft.com

11

Andys second law of bug xing

always assume its your fault


by Andy Budd of Clearleft.com
12

Andys third law of bug xing


prevention is better than cure

by Andy Budd of Clearleft.com

13

Andys fourth law of bug xing

offence is the best form of defence


by Andy Budd of Clearleft.com
14

Andys fth law of bug xing


isolate the problem

by Andy Budd of Clearleft.com

15

Andys sixth law of bug xing

use hacks only as a last resort


by Andy Budd of Clearleft.com
16

Using Hacks Sensibly


by Andy Budd of Clearleft.com
17

Types of Hack
Hacks that rely on parsing bugs Hacks that rely on unsupported or
misinterpreted CSS

by Andy Budd of Clearleft.com

18

Good hacks
Are valid Only target older browsers Are ugly?

by Andy Budd of Clearleft.com

19

Responsible hacking
Use hacks sparingly Only add a small number of hacks to
your main CSS stylesheets

Better to lter hacks into separate Always comment your hacks

by Andy Budd of Clearleft.com

20

Questions?
by Andy Budd of Clearleft.com
21

Thanks you!
by Andy Budd of Clearleft.com
22

You might also like