TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-15-2008, 09:15 PM   #1 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default Link or @import?

I finally figured out whether to use <link/>, or <script>@import css</script>!

yay
Best Practices for Speeding Up Your Web Site

Just wanted to share it with everyone, it's something that's bothered me for the longest time.
__________________
Signatures are nothing but incriminating.
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 06-15-2008, 10:42 PM   #2 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

I always use link. However, recently I've been organising my CSS files better. Now I have different CSS templates configured, and they import the CSS files I require. So I may have a CSS file called tables.css. That would load in my primary, secondary, and ternary CSS files for my HTML tables.

css Code:
@import 'tables/primary.css';
@import 'tables/secondary.css';
@import 'tables/ternary.css';
 
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 06-16-2008, 08:18 AM   #3 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 24
Thanks: 13
sidisinsane is on a distinguished road
Default

Quote:
Originally Posted by Aaron View Post
[...] <script>@import css</script>
Just a small correction. Of course you meant using
Code:
<style>@import css</style>
To prevent a "Flash of Unstyled Content" (FOUC) I usually link to a master-stylesheet - especially when I'm not adding any script-tags to my head.

In my master-stylesheet I then import other common ones - just like Wildhoney does. From a performance standpoint that might not be the best solution, but it serves me well in terms of workflow.
sidisinsane is offline  
Reply With Quote
Old 06-18-2008, 01:18 PM   #4 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

I would use <link>, and its because of some browsers like some Opera 9'ers and older IE'ers will first read then HTML structure and THEN apply the CSS and not the other way, so the website transform will be abit weird while loading =)
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 06-20-2008, 08:10 PM   #5 (permalink)
The Contributor
 
Ross's Avatar
 
Join Date: Jan 2008
Location: England, UK
Posts: 83
Thanks: 3
Ross is on a distinguished road
Default

You can always @import in the <link>'ed stylesheet so I've always had a few @import's at the top of my primary (navigation, css reset etc.) and then my core css underneath :)
Ross is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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


All times are GMT. The time now is 02:46 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design