Welcome Guest, Not a member yet? Register   Sign In
External CSS adding problem
#1

[eluser]Hasan Iqbal[/eluser]
If I write the css inside the view page's head section, it works fine. But when I write the same code in an external css file and link it to the view page, the css doesn't appear any more. I have checked the source of the view page in firefox, to make sure that the link points correctly to the css file and it does.

I'm getting my head out..
Please guys, help..
Thanks in advance..
#2

[eluser]toopay[/eluser]
[quote author="Hasan Iqbal" date="1310653855"]If I write the css inside the view page's head section, it works fine. But when I write the same code in an external css file and link it to the view page, the css doesn't appear any more. I have checked the source of the view page in firefox, to make sure that the link points correctly to the css file and it does.

I'm getting my head out..
Please guys, help..
Thanks in advance..[/quote]

What exactly you mean of "the css doesn't appear any more"? Did you mean images from that css doesn't appear...or?
#3

[eluser]Hasan Iqbal[/eluser]
What I meant is that the css doesn't affect the view anymore. Say, I have set the font size for 70px in the css file, but the size won't change in the view page.
#4

[eluser]toopay[/eluser]
Oh. Did you load several css files? And are you sure you've load each css in a right sequence?
#5

[eluser]John_Betong_002[/eluser]
Quote:If I write the css inside the view page’s head section, it works fine. But when I write the same code in an external css file and link it to the view page, the css doesn’t appear any more. I have checked the source of the view page in firefox, to make sure that the link points correctly to the css file and it does.
Just noticed that you are already checking the source file using Firefox.

When viewing the source file, click on the CSS link and the CSS file should open in a new browser tab or window.

 
 
#6

[eluser]Hasan Iqbal[/eluser]
It does, I mean, clicking the link in firefox window source, the css file opens. But I don't understand why it's now working in the view file.
#7

[eluser]John_Betong_002[/eluser]
Try adding and or changing something obvious such as the body style='background-color:#f00'.

Try source and CSS validation:

http://validator.w3.org/

http://jigsaw.w3.org/css-validator/

 
 
#8

[eluser]cideveloper[/eluser]
can you show the view file code where you link to the css. When you click the link in firefox view source, do your changes show up? try linking to the css with the below code.

Code:
<link rel="stylesheet" href="<?=base_url()?>assets/css/style.css?rand=<?=rand();?>" type="text/css" />

This way you will not get a cashed version. Maybe that is what is happening.
#9

[eluser]toopay[/eluser]
[quote author="Hasan Iqbal" date="1310653855"]If I write the css inside the view page's head section, it works fine. But when I write the same code in an external css file and link it to the view page, the css doesn't appear any more. [/quote]
What was i think is the css loaded correctly, then maybe it just because a sequence matter (if you load several css file, make sure you have correctly assigned its sequence respectively, so that one css file not overide the other). You can show your view file to confirm that.




Theme © iAndrew 2016 - Forum software by © MyBB