July 14, 200917 yr Hi all Can you have a CSS document that is too long? I'm doing a new site and the CSS seems to be neverending, is it ok if there are lots of lines? Thanks Kerstey
July 14, 200917 yr Why don't you have split it up into different secions: navigation.css contact.css etc... for each main different bit of your site if that helps?
July 14, 200917 yr Exactly what he said. I often use, and other people do too so I aren't that special, more than one CSS page. Like AdamConder says generalise them to what they belong to navigation.css heading.css body.css etc.
July 14, 200917 yr Like Adam said, split it up into seperate documents, I usually have the following: main.css which has all of the main attributes of my document, so the major structural things, star selectors and so on and so forth. formatting.css which is all of the formatting for text, anchors, images and stuff. nav.css which is for the navigation, which can sometimes be quite complicated. forms.css for any contact forms that I'm using. The good thing is that you only have to link to one document in your html page, and use the import code on that one document: <link rel="stylesheet" href="css/main.css" type="text/css" media="screen" /> So this is only linking to the 'main.css' document, but in that document you use the following code: @import url('formatting.css'); @import url('nav.css'); @import url('forms.css'); Hope that helps. If you want to take a look at my code, then you can head over to http://traxor-designs.com/css/ and have a look through my stylesheet documents. It's sometimes easier to have a first-hand view. Edited July 14, 200917 yr by traxor
July 14, 200917 yr It probably doesn't matter to have a long css file as long as you actually need all the styles, just try to create spaces and /*COMMENTS IN CAPITALS*/ occasionally so that you can find your way around more easily later.
Create an account or sign in to comment