August 5, 201115 yr Quick question. Does it matter how much CSS coding I use to style one thing on a basic multi page website? The tutorials I'm using suggests typing all the html out without any from of styling so everything sits down the left hand side, then to use div id's and CSS to stye it how you want it. I'm just worried that I have too many div id's to get the desired effect, or does it not really matter? Thanks.
August 5, 201115 yr well think why it's called a cascading style sheet, your ideal is to have things so there is the bare minimum on the final element etc Remember too that you can use classes and within ID's.
August 5, 201115 yr I'm just worried that I have too many div id's to get the desired effect, or does it not really matter? As with all aspects of web development, you should be looking at the most efficient CSS code if possible, and eliminate any unnecessary code. Just remember, the style element of a div 'id' will be applied to that div only, whereas the style element of a div 'class' can be applied numerous divs. Edited August 5, 201115 yr by oakleaves
August 5, 201115 yr Build the HTML first, then apply styles is the general principle. But it entirely depends from what starting point your coding. When I get a design, I generally get a bit of paper and map out the basic structural areas I'll need - header, nav, content, side column, content boxes, footer etc. I then code the entire thing in HTML with all text content from the design, validate it and proceed to the graphics slicing, dicing and finally the CSS. How much css is too much? Depends on the complexity of the design, however, the good old DRY principle applies here - Don't Repeat Yourself. This is why taking notes whilst looking at a design *before* coding anything is vital. Identify all areas that share common characteristics and make use of the cascade to simplify your css.
August 14, 201115 yr Author Thanks for the responses guys. I went back to my CSS sheet and trimmed it all, and in the process solved a different issue I had!
Create an account or sign in to comment