Importe os arquivos CSS com classe!

By Leonir Zimmermann

A primeira dica é na área de CSS. Para atachar ao site arquivos de CSS externos, geralmente utilizamos a sintaxe do padrão HTML4 a seguir :

<link type=”text/css” rel=”stylesheet” href=”arquivo1.css” mce_href=”arquivo1.css”>
<link type=”text/css” rel=”stylesheet” href=”arquivo2.css” mce_href=”arquivo2.css”>
<link type=”text/css” rel=”stylesheet” href=”arquivo3.css” mce_href=”arquivo3.css”>
<link type=”text/css” rel=”stylesheet” href=”arquivo4.css” mce_href=”arquivo4.css”>

Se forem necessários diversos arquivos, repetidas vezes esta linha deve constar em meio ao HTML. Mas existe uma maneira mais ”clean” de se fazer isto:

<style type=”text/css”>
  @import url(“arquivo1.css”);
  @import url(“arquivo2.css”);
  @import url(“arquivo3.css”);
  @import url(“arquivo4.css”);
</style>

Vi alguns exemplos trabalhando desta forma, e investigando a compatibilidade, descobri que dá pra usar livre e tranquilamente, veja a tabela a seguir que mostra a compatibilidade do recurso com diversos browsers:

http://imfo.ru/csstest/css_hacks/import.php

É isto.

Deixe uma resposta