• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to insert Css file correctly ?

#1
[eluser]ludo31[/eluser]
I don't know how to explain my problem but I create a template where there are header-content-and footer

and in the header I insert the link to css file like that :

Code:
<head>
        
       <link rel="stylesheet" media="screen" type="text/css" href="<?php   echo base_url();?>css/principal.css" />  
    
  
    <link rel="stylesheet" media="screen" type="text/css" href="<?php   echo base_url();?>css/960.css" />
    <link rel="stylesheet" media="screen" type="text/css" href="<?php   echo base_url();?>css/reset.css" />
    <link rel="stylesheet" media="screen" type="text/css" href="<?php   echo base_url();?>css/text.css" />
  
  
  <link rel="stylesheet" media="screen" type="text/css" href="<?php   echo base_url();?>css/affichage.css" />
    <link rel="stylesheet" media="screen" type="text/css" href="<?php   echo base_url();?>css/style/jqzoom.css" />
        
        
         <title>
     <?php if(isset($title)) echo $title ; ?>
     </title>                      
      
    </head>


my own css file is in principal.css : before , the background of body is blue ;
Code:
body {background-color:blue;}

when I try it in Firefoxand another navigator it works , after when I try to set the background in green for example :


Code:
body {background-color:green;}

and when I try it in firefox , in the first time the background stay blue and we must refresh again and then it changes to green and it's the same fot the other navigator

so when I work in netbeans , in the line where I insert the link to css file there is a message like that :

Code:
<link rel="stylesheet" media="screen" type="text/css" href="<?php   echo base_url();?>css/principal.css" />

the message

Code:
bad value "css/principal.css" for attribute "href" on element link : Whitespace in path
syntax of IRI reference:
any url. for example '/hello','#canvas',or'http://example.org/'.
characters should be represented in NFC and spaces should be escaped as ' '.

the "/>" syntaxt on void elements is not allowed (this is an HTML4-only error.)
and at the begin of my header.php I write that :

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            "http://www.w3.org/TR/html4/loose.dtd">

what's the problem ??? I would like to applicate css change just the moment when we open the file

thanks


#2
[eluser]CroNiX[/eluser]
try putting your custom css files after the 960 grid css files. The 960 files could be overriding your custom css because they are loaded after.

I don't use netbeans, but it seems the error is trivial because it is ignoring the php part and only seeing your 'css/principal.css' as what is entered in the href. However, that doesn't matter when the php gets served as the href will appear properly formatted.

#3
[eluser]ludo31[/eluser]
may be the solution is like that because before there is may be a space when we write href...

Code:
$linkcssentete = array(
          'href' => 'css/linkcssentete.css',
          'rel' => 'stylesheet',
          'type' => 'text/css',
          'media' => 'screen'
);

echo link_tag($linkcssentete);

and I make it the same for the grid and all css files and it works

thanks


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.