ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Internal or External CSS

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    ASPdev.org Forum Index -> JavaScript / DHTML / HTML / CSS
View previous topic :: View next topic  
Author Message
raven



Joined: 31 Jan 2006
Posts: 41

PostPosted: Tue Jan 31, 2006 6:04 pm    Post subject: Internal or External CSS Reply with quote

I would guess almost everyone uses external CSS files to include their css with their webpages. That being said I still see people including them in the code itself. In fact I came across an otherwise really nice portal script called MKPortal that used to include the CSS right in the code. It made for extremely bloated pages.

Is there ANY reason for not putting CSS in an external file?
_________________
Programmers do it in code
Back to top
View user's profile Send private message
raven



Joined: 31 Jan 2006
Posts: 41

PostPosted: Wed Feb 01, 2006 2:09 am    Post subject: Reply with quote

I did some research to answer my own question but thought I would go ahead and share it:

The C in CSS is for "Cascading" and the closer to an element the style definition is the more prominent a role it plays.

The only really good reason for inline style is to override a style defined at a higher level. If you find this being done repetitively for the same reason then it is probably a good idea to go with a class or id definition instead.
_________________
Programmers do it in code
Back to top
View user's profile Send private message
x-raysteve



Joined: 01 Feb 2006
Posts: 53

PostPosted: Sat Feb 04, 2006 5:07 am    Post subject: Reply with quote

I do not know of any real good reason not to use an external file. It gives you a lot more flexibility when managing your attributes. You can even share files between different pages, which is very common. Sure you could include it in a header file, but that is much less clean, and actually bloats your source.
Back to top
View user's profile Send private message
Stitch



Joined: 07 Feb 2006
Posts: 43

PostPosted: Thu Feb 09, 2006 10:58 pm    Post subject: Reply with quote

If you just have 1 page running off of that stylesheet, then you might as well have it be internal.

If you have multiple pages running off of one stylesheet then you should have it be external and have all the pages link to it. That way your code will be cleaner, and your site will load much more quickly.
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
ComDriver



Joined: 06 Mar 2006
Posts: 8

PostPosted: Mon Mar 06, 2006 5:47 pm    Post subject: Reply with quote

I use an external style sheet, it keeps my code tidier and it means I don’t have to go to every page in my site and change one ting detail, I can just change it in the external style sheet and bingo, I’ve got a uniform look across every page in my site.
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Mon Mar 06, 2006 8:55 pm    Post subject: Reply with quote

I always use external CSS file. I hate to make changes in several places, when one will suffice Smile
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
rose



Joined: 21 Feb 2006
Posts: 29

PostPosted: Tue Mar 07, 2006 5:15 am    Post subject: Reply with quote

Yes, it just creates more work if you do it internally.

Usually I will develop one page with internal CSS.
Then when I have finished the development, I will ship that over to an external file to make for easy changes later on:)
Back to top
View user's profile Send private message
bongo



Joined: 07 Mar 2006
Posts: 11

PostPosted: Tue Mar 07, 2006 12:43 pm    Post subject: Reply with quote

i actually used to using internal css even though i'm making lots of web pages. It's not much trouble after all as you can copy and paste for the rest of the pages too..
Back to top
View user's profile Send private message
James



Joined: 20 Feb 2006
Posts: 24

PostPosted: Fri Mar 10, 2006 12:08 am    Post subject: Reply with quote

But what happens when you want to amend something in the CSS?
You then have to go through every single page to do this. It's very tedious.

yes you can use a search and replace function, but why bother when it can be done in one shot with an external file?
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Fri Mar 10, 2006 10:24 am    Post subject: Reply with quote

I think we all agree that the external CSS is the way to go. I'm closing this thread.
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    ASPdev.org Forum Index -> JavaScript / DHTML / HTML / CSS All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial