Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website Design Forum


You are currently viewing our Website Design Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
CSS: embedded or linked?
Old 05-25-2009, 06:33 AM CSS: embedded or linked?
Novice Talker

Posts: 10
Location: Texas
Trades: 0
I never gave it much thought till just the other day. I think for simple text, embedded is ideal. Anything more complex should be linked to a style sheet. Or course, keeping the CSS in its own file keeps everything nice and tidy.

What does everyone think?
Some Beach is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-25-2009, 10:13 AM Re: CSS: embedded or linked?
Super Moderator

Posts: 1,576
Location: Kokkola, Finland
Trades: 1
ideally everything should be linked - there's hardly ever an instance i use inline stlying - maybe if i want just one item in a whole site with high specificity then i might do it... but it's good practice to put everything in an external stylesheet
davemies is online now
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 05-25-2009, 11:27 AM Re: CSS: embedded or linked?
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
Always, always linked, the point of CSS is to seperate out the content from the layout and styling. This way you only have to ever change one document. If it's inline, you've got to go through every page and make the changes.

Plus, and perhaps most importantly, linked CSS leads to smaller page sizes, which is better for the user as they load faster.
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Old 05-25-2009, 02:39 PM Re: CSS: embedded or linked?
Skilled Talker

Posts: 59
Name: Barbara
Trades: 0
I'm actually leaning toward a combination of the two. Almost everything is linked, but if there is an element that will only be used for a specific page, I embed the required style in that page. Finally if there's something that only appears once on a page, I use the html formatting codes at the line level.

Linked makes sure my entire website follows the same styles and layouts throughout all the pages.

Embedded allows me to have a few special styles for one specific web page, so I don't have to invent new names for seldom used styles.

Line level allows me to create very specific exceptions when needed for emphasis.

---

Right now I'm just starting to learn css, so I don't have any good examples. Hopefully I'll have something online in the next couple of weeks.
__________________
I am not a certified computer professional. My advice comes from personal experience and/or friends who are computer professionals. My ezine
Please login or register to view this content. Registration is FREE
Interested in Search and Rescue? Check out the Civil Air Patrol.
gistek is offline
Reply With Quote
View Public Profile Visit gistek's homepage!
 
Old 05-25-2009, 04:24 PM Re: CSS: embedded or linked?
Novice Talker

Posts: 10
Location: Texas
Trades: 0
Thanks for your replies!

I guess I forgot to mention that I typically create 1-page mini sites so everything is sorta right there in front of me. I can see though that if I had a 5-page site (or more) it would be a real pain to make formatting changes.

Speaking of linked, I was watching a video tutorial where the person was calling in image (if I remember right). The weird thing was, he was linking to it with the absolute path and was including the http:// string. I don't know if he was doing it to keep it as simple as he could for beginners or something. My impression was that if you use an http absolute path it makes another call to the server thus increasing the load.
Some Beach is offline
Reply With Quote
View Public Profile
 
Old 05-26-2009, 11:46 AM Re: CSS: embedded or linked?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Quote:
but if there is an element that will only be used for a specific page, I embed the required style in that page.
You still shouldn't put the styles in-line. Use a span with a class and put the class in the external CSS file if you have this situation.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-26-2009, 01:53 PM Re: CSS: embedded or linked?
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
Embedded vs Linked depends on your traffic.

If you have really high bounce rates (most users only see one page) then go embedded. If most users visit several pages, then go linked.

Regarding Ed Gray's comment, if embedding, be sure to use whatever your server's version of an include or template is (personally I use Sitemesh). Don't edit every page, ever.

As LadynRed stated, avoid inline styles.
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 05-27-2009, 10:20 PM Re: CSS: embedded or linked?
markAtRitetek's Avatar
Experienced Talker

Posts: 32
Name: Mark Hudson
Location: Atlanta, GA
Trades: 0
Ideally the only time you should use inline styles are if they are dynamically generated with javascript to produce some kind of effect; other than that, link it all; it's possible and after a while it's not more annoying, in fact you find out it's actually easier and makes more sense!
__________________
Mark Hudson
Ritetek Design

Please login or register to view this content. Registration is FREE
markAtRitetek is offline
Reply With Quote
View Public Profile Visit markAtRitetek's homepage!
 
Reply     « Reply to CSS: embedded or linked?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32361 seconds with 12 queries