Welcome Guest, Not a member yet? Register   Sign In
Loss CSS when pass parameters
#1

[eluser]Hugo Tessaro[/eluser]
Hello,
Well, when I insert more than 1 parameter in URL, my website lose the CSS...
ex:
http://localhost/forum/board/id/2/1 (forum is a dir)
2 and 1 is parameters and when I access it, layout show without css
and http://localhost/forum/board/id/2 show with css normaly...
I tried with 2 types of function...

function id() { $this->load->view('page'); }

function id($a = null, $b = null) { $this->load->view('page'); }

What is the error?
htaccess?
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
#2

[eluser]davidbehler[/eluser]
I'm guessing you use relative paths, e.g.
Code:
<LINK REL=StyleSheet HREF="css/style.css" TYPE="text/css" MEDIA=screen>

Try using an url instead:
Code:
<LINK REL=StyleSheet HREF="<?php echo base_url().'css/style.css'; ?>" TYPE="text/css" MEDIA=screen>
#3

[eluser]tonanbarbarian[/eluser]
how are you loading the css?
can you provide the html which is loading the css file?
my guess, without any more info, would be that you are loading the css relatively rather than absolutely
i.e. if you are loading css as
Code:
<link rel="stylesheet" href="../../../../site.css" type="text/css" />
then you will have problems
if you load the css absolutely you should not have any problems
Code:
<link rel="stylesheet" href="http://localhost/site.css" type="text/css" />
#4

[eluser]Hugo Tessaro[/eluser]
wow, perfect! Big Grin
Tnx u 2!
Smile




Theme © iAndrew 2016 - Forum software by © MyBB