Welcome Guest, Not a member yet? Register   Sign In
I am having a weird issue with CSS.
#11

[eluser]InsiteFX[/eluser]
Try leaving the base_url blank '' CodeIgniter will try to figure it out for you.

You can also try this:
Code:
<link rel="stylesheet" href="<?php echo base_url('css/style.css'); ?>">

If the css is working in the other browsers but messing up then it is a browser problem,
some browser you neeed to make adjustments on the css for it work on all.

Like with IE you usally end up create a special css file just for it!
#12

[eluser]Aken[/eluser]
Or he doesn't have the URL helper loaded, and it threw a notice error which messed up the HTML.
#13

[eluser]InsiteFX[/eluser]
True!

Here is an example with chrome on the CI forums here it will take and drop down the
advanced search button below the search text field!
#14

[eluser]codelogic[/eluser]
[quote author="InsiteFX" date="1338357401"]Try leaving the base_url blank '' CodeIgniter will try to figure it out for you.

You can also try this:
Code:
<link rel="stylesheet" href="<?php echo base_url('css/style.css'); ?>">

If the css is working in the other browsers but messing up then it is a browser problem,
some browser you neeed to make adjustments on the css for it work on all.

Like with IE you usally end up create a special css file just for it!
[/quote]

Okay, so this does not work, with my base_url typed in and left blank. I wonder why.

Also, Aken, this
Code:
<link rel="stylesheet" href="/main/test/CI/css/style.css?<?php echo time(); ?>">

worked, it is displaying correctly across all browsers.

Edit: What do you mean by URL helper loaded?
#15

[eluser]InsiteFX[/eluser]
Do a view source in your browser and look at that link to see how ci did it for you!

echo base_url();
#16

[eluser]InsiteFX[/eluser]
CodeIgniter Users Guide - URL Helper

I autoload it session and database because I always use them!
#17

[eluser]codelogic[/eluser]
[quote author="InsiteFX" date="1338358278"]Do a view source in your browser and look at that link to see how ci did it for you!

echo base_url();
[/quote]

I get this error, Fatal error: Call to undefined function base_url()
#18

[eluser]InsiteFX[/eluser]
Then you do not have the url_helper loaded!

Autoload the url_helper in ./application/config/autoload.php

under helpers.
#19

[eluser]codelogic[/eluser]
[quote author="InsiteFX" date="1338362522"]Then you do not have the url_helper loaded!

Autoload the url_helper in ./application/config/autoload.php

under helpers.
[/quote]

Ah, yes, that was it!




Theme © iAndrew 2016 - Forum software by © MyBB