Click to See Complete Forum and Search --> : why different CSS?
captain spanky
02-28-2007, 05:29 PM
i notice that some pages have a seperate css stylesheet whilst others have all the info embedded within the page... why is this? just user preference? :)
Probably lack of knowledge, usually mixed with the use of a GUI editor, like Dreamweaver.
Stylesheets should always be external. That will allow the stylesheet to be cached, thereby reducing page load times, and will also allow you to edit a stylesheet to make changes throughout the entire website.
If you're using a GUI editor though, it will probably put your stylesheet in the head, by default. Dreamweaver will do this, and you need to know a tiny bit of coding, or know how to use the Styles Palette properly, to get it to behave otherwise (it's a lot faster to change this with a bit of code, than with DW's palette).
Jackimalyn
02-28-2007, 05:50 PM
Agreed ^^ I'll use internal style sheets if Im only writing one page for something, not a whole website. Or if one page is completely different from the rest of your site, you can just have the css in the head instead of llinking it to the main style sheet (but that would be dumb anyway to have a page on your site so different that doesnt make any sense. It would just confuse the viewer...) Anyway... keep them external. (Which like Ned said, is possible in DW, you just have to know how to use your tools properly.)
captain spanky
02-28-2007, 09:57 PM
ok... time to be honest here...
I'm building a site and i've put together various things from books and tutorials but Ive ended up with some bits of the css in an external sheet and some bits in the actual page. I've tried putting it all in the style sheet but for some reason some things won't work? why is this? specifically things like colours of links and background images...
I sometimes use a combination. Especially if I'm dealing with a variation on a certain page, the internal styles overwrite the external, so that's handy. If it's a "global" style, it needs to be external so updates happen site-wide. But it depends on what you're doing.
In your case it's possible your problems are related to specificity or order.
reuber1
02-28-2007, 10:34 PM
External, by choice and by the forceful hand of ASPDNSF.
Cyan_Ide
03-02-2007, 03:56 PM
Captain Spanky: Yeah, that's usually what happens to me, except (bad habit I'm trying to break) I also take it a step further and do inline styles quite a bit. I'll usually code the main page and then pull the styles out of that to make the external sheet.
*is a naughty, naughty CSS coder. :( *
Captain Spanky: Yeah, that's usually what happens to me, except (bad habit I'm trying to break) I also take it a step further and do inline styles quite a bit. I'll usually code the main page and then pull the styles out of that to make the external sheet.
*is a naughty, naughty CSS coder. :( *
Do you mean internal styles (those that sit in the <head>) or inline styles? Because I think it's GOOD practice to build your stylesheet internally, it helps with productivity quite a bit.
Cyan_Ide
03-02-2007, 05:20 PM
Do you mean internal styles (those that sit in the <head>) or inline styles? Because I think it's GOOD practice to build your stylesheet internally, it helps with productivity quite a bit.
No, unfortunately. Inline, as in using <p style> and spanning and such. :(
I'll fix it when I realize I'm doing it, but oftentimes I don't catch myself.
Psygon
03-02-2007, 06:38 PM
No, unfortunately. Inline, as in using <p style> and spanning and such. :(
I'll fix it when I realize I'm doing it, but oftentimes I don't catch myself.
I do that when I'm trying to get a feel for how something will work, often it's quicker for me then to put it in an external style sheet... I'm not great at CSS so sometimes it's trial and error to get layouts working exactly how I want them :)
At the end of the project I'd usually have all my styles externally tho', once I've cleaned my pages up... it's probably not the most efficient way to do something but it works for me and I guess that's what counts. :)
I do that when I'm trying to get a feel for how something will work, often it's quicker for me then to put it in an external style sheet... I'm not great at CSS so sometimes it's trial and error to get layouts working exactly how I want them :)
At the end of the project I'd usually have all my styles externally tho', once I've cleaned my pages up... it's probably not the most efficient way to do something but it works for me and I guess that's what counts. :)
I dunno. I think personally that there's only so much you can do with Photoshop in the "design" phase. I like to get it to a certain point and then experiment with really rough code to see how it's going to look in practice. I admire people that can do this in linear fashion (photoshop > slice > code > test > launch). I do a lot of back and forth in the beginning.
Probably not efficient, you're right. But I'm a fusser, that's probably the larger issue. lol But I digress.
reuber1
03-02-2007, 06:54 PM
Firefox's Web Developer toolbar is always handy for this...nothing like testing CSS in real-time (why does it always make my background graphics disappear though?).
joshil3
03-02-2007, 07:03 PM
ok... time to be honest here...
I'm building a site and i've put together various things from books and tutorials but Ive ended up with some bits of the css in an external sheet and some bits in the actual page. I've tried putting it all in the style sheet but for some reason some things won't work? why is this? specifically things like colours of links and background images...
I've had some trouble with this as well. If you want to move everything to an external sheet from the actual page, you need to make sure of where you are placing it in the external stylesheet. My problem with this came from not paying attention to exactly where I placed it, and code towards the bottom takes preference (ie. if you have conflicting codes, the stuff farther down is what you're going to get).
Also if your background-images aren't showing up properly, double check the path once you place it in the stylesheet. The other day I forgot that my stylesheets were in a different folder than my html pages and nothing was showing up. :D Quite frustrating!