Jump to content
xisto Community
Sign in to follow this  
l337 Nurse Pedestrian

Benefits Of Seperate Css read more inside

Recommended Posts

Hey I was wondering some stuff when you are designing web pages. What are the benifits of putting CSS right inside your page you are working on, like before the <body>, instead of creating a seperate CSS document to go with the page you are working on, and vice-versa. I hope you guys get what I'm talking about. I may be missing something, but I think it's kind of useless to have a a seperate .css file, instead I implement it inside my document. Any answers or opinons would be appreciated. Hope I was clear enough.

Share this post


Link to post
Share on other sites

I know what you are saying. There really isn't a good reason to put in on the page that I can think of. It is easier, you don't have to create a .CSS file, but other than that I'd say it's better to use an external reference.

Having an external style sheet makes it so you can use the same style on on all your pages and you can update formating for the whole site much faster; just change one .CSS file, not every web page. I personally use an external style sheet on my web site It's much easier in the long run.

Share this post


Link to post
Share on other sites

According to HTMLDog.com, having the stylesheet seperate from the actual XHTML or HTML file also is in accordance to the whole separation of presentation and content idea.Basically your HTML or XHTML file should only have content-based information, and your CSS stylesheet is all the presentational information. Having them in two places helps to even more demarcate your content and your presentation.

Share this post


Link to post
Share on other sites

I've found a very good site a few days back. It discusses page design using TABLES and then re-creates the same page using CSS and thus experimentally proves to you how CSS is way more advantageous than tables. Good tutorial too.

 

You can find it here: https://www.sitepoint.com/tables-vs-css/

Share this post


Link to post
Share on other sites

say you created a website, and it was all pretty and everything with a nice colour scheme and all... but after some time, you decide you want your site to look different... and i think THIS is the MAIN advantange of having external stylesheets. All you have to do is open up the stylesheet and change the properties and such, instead of going through EACH of you pages and changing each one seperately, leaving you open to tons of errors and missed areas. I personally use classes and IDs and such for every bit of content in a webpage, coz that way an external stylesheet just makes it SO easy to change the ENTIRE look and style without having to go through each page. It's amazing, and that's why its good to have your stylesheets external. It also makes it easier if you want to add or change little bits of style in your pages, and it just helps keep the overall site neat and organised. Plus, you dont have to keep repeating yourself page after page with the same codes and styles. If you know how to use all the properties and such in a stylesheet, then you'll come to see that you can change the entire LOOK of a page just by messing with external CSS. Easy!

Share this post


Link to post
Share on other sites

I have to say I pretty much agree with what everybody's been saying about the pros of having an external style sheet, though I think most people are thinking about this in terms of sites probably 15-20 webpages in span. Me, I have at least four or five of my sites that number 50+ pages....external style sheets REALLY come in handy there, although it could be said to be a toss up if you're intergrating PHP coding into the layout in which you're using style sheets. I dunno...what do ya'll think? Do style sheets work better externally when working with a PHP format, or do they work better internally?

Share this post


Link to post
Share on other sites

Basically your HTML or XHTML file should only have content-based information, and your CSS stylesheet is all the presentational information. Having them in two places helps to even more demarcate your content and your presentation.

<{POST_SNAPBACK}>


Word. Having separate CSS stylesheet and writing XHTML is kind of a step towards semantic web from your behalf. "Getting used to the idea".

 

 

I personalyl like to have multiple separate CSS files. For example, I have a file called menu.css which I include (or to be accurate, link) in every page I have a side menu on my site. It is so easy to use the same classes and have identically looking menus on all my pages. And when I want to change colours or fonts or what ever its one file edit.

 

I usually also have a "generic" css fle in which I have the setting that usually every page has. Such as links (I like to have similar links in every page) and bottom copyright div class.

Share this post


Link to post
Share on other sites

I actually have "screen.css" and "print.css" so I can have one set of CSS for screen layouts (normal day-to-day browser usage) and one for printing only (without menu, in serif font, text extends to whole of page).I do wish they'd make a decision on the screen reader and accessibility CSS.

Share this post


Link to post
Share on other sites
I always keep my CSS in a seperate file... Just like mini_m said, when you want a little change, it's definitely easier when it's in a seperate file. Especially for someone like me... I end up changing my site layout and colors every month! Going from a black and grey site to a lime green and teal one is a pretty big pain when you have to go and change all the tags. And all a css file really is is the same one you put in your head tags.. just without the style tag!

Share this post


Link to post
Share on other sites

I actually have "screen.css" and "print.css" so I can have one set of CSS for screen layouts (normal day-to-day browser usage) and one for printing only (without menu, in serif font, text extends to whole of page).

<{POST_SNAPBACK}>


This is really good idea. I have several pages with "screen.css" but then never bothered to a a printable version. Generally speaking using different style sheet for different medias (in addition to paper and desktop screen, for example PDAs) is something that I like as coding style.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.