Is there a particular template you have when you start your CSS coding or not? For example do you have bits of code which straight away define fonts etc. Thanks, Ben.
I don't personally use templates simply because I much prefer handling everything myself. With that said, I do use Eric Meyer's CSS reset to make cross-browser designs a little easier.
You mean a CSS framework/boilerplate? There are lots of those around, but I think most people roll their own. This is what I use: index.html <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv='Content-Type' content='text/html; charset=utf-8' /> <link href='style.css' rel='stylesheet' type='text/css' media='screen' /> <title>My Site</title> </head> <body> <div id='container'> <div id='header'> <!--end header --></div> <div id='content'> <!--end content--></div> <div id='sidebar'> <!--end sidebar--></div> <div id='footer'> <!--end footer--></div> <!--end container--></div> </body> </html> Code (markup): style.css @import url('reset.css'); body { text-align: center; } /* CONTAINER */ #container { text-align: left; } /* HEADER */ #header { } /* CONTENT */ #content { } /* SIDEBAR */ #sidebar { } /* FOOTER */ #footer { } Code (markup): And I use the CSS reset that steelfrog mentioned. It's great for making browsers behave
With what steelfrog mentioned do you just put that and leave it in there or do you add bits to it? Also things like whre it says body, do i put all my body stuff in there or do i create another body tag in css?
It's best to use one style sheet as it is one less server request. I generally lazy load my css if I need more then one. Eric Meyer's is a great starting point but it is bloated. It has way overkill for tags and styles. If you use that to begin with make sure to remove tags you don't use on your site.
I mainly do joomla websites and as such buy in templates that the client chooses as base, they are pretty cheap circa $60 and I modufy the css as needed
To be blunt, I've never run into the issue of bloating. If you're going to trim fat, there are much better places to do so than in something you may encounter later on. Unless your website is getting millions of hits, the difference is quite negligible. I see your point, though.
I always start with a template and just re-style everything. It is much easier for me as I am new to css for layout. I would try these resources: opendesigns.org and freecsstemplates.org. Both have free templates you can use so long as you keep the footer link in them.
I prefer to avoid templates. I fear that if I rely on them I won't be able to show my real design skills and as a person who is constantly trying to learn new things about CSS I feel using a template would stand in the way of that. Also, sometimes some templates don't come with comments as to how some parts of the site were designed so it makes it harder for me to mess around with them.