I am CSS-disabled. I've been trying to use it for almost a decade, and still can't figure out how floats work properly [floats is just an example].
Is there a site that walks开发者_C百科 through various real-world layout patterns?
You can take a look at these sites:
http://css.maxdesign.com.au/floatutorial/
http://www.smashingmagazine.com/2007/05/01/css-float-theory-things-you-should-know/
http://css-tricks.com/all-about-floats/
Read The Zen of CSS Design.
Its a book on design in general, but reading it will show you how to get into the correct "mindset" for using CSS in design (including floats, absolute, relative, etc).
It really depends on how you want to start learning CSS, here is a random URL giving you some key 5 approaches:
- http://www.makeuseof.com/tag/top-5-sites-to-learn-some-css-programming/
I would suggest doing something like, beginning a layout, learning something like position
and how it works, or tackling as you mentioned floats
.
There is a lot to learn, and my experience is, you should tackle one element at a time.
Otherwise if you want a dummy proof start, look at a video tutorial site like lynda.com (I know many people scoff at it, but it works for beginners just fine).
Then again if you don't want to pay for training/video, google for your css topics.
I did learn a lot from CSS Play: http://www.cssplay.co.uk/
Floats seems strange partly because they are :) and partly because designers were forced into using and abusing them because of poor support of everything else, esp. the display property! When you've the choice between table layouts and floats ...
Check what you can do with display: table-cell
or display: inline-block
(the latter is cross-browser if you tell IE6/7 to use display: inline
plus anything giving hasLayout to it like width
or zoom: 1;
), it could save you a few headaches.
I'm sure you can find lots of CSS tutorials online, but I've found most of them usually will tell you how to achieve a certain result without explaining how or why it works. Then when something doesn't work as intended in a certain browser or certain configuration, you're left scratching your head. Instead, go run down to your local mega bookstore and see if you can find a book called CSS Mastery by Andy Budd and just give it one good read through. On my first read, my CSS improved greatly. On my second read of the 2nd edition of that book, I came to understand a lot of the weird nuances. Go check it out.
精彩评论