Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 05, 2016, 08:35:53 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: CSS File Content "Vanishes" on Ubuntu Machine  (Read 2233 times)

raybeere

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 94
    • View Profile
    • Read more about this member.
    • Donate to Member
CSS File Content "Vanishes" on Ubuntu Machine
« on: November 06, 2012, 12:27:31 PM »
I do know this isn't a bug or a problem with Ubuntu as such, but I couldn't think of a short subject that encapsulated my problem any better. And I'm probably missing something obvious, but I have tried to figure this out myself.

To set up the background, I have a set of HTML files which use a custom CSS file. These files are not online, they are for my own use, on my own machines or a USB stick. They contain most of the writing I've done (and will contain the rest when I get the time to add the rest of the files). On Windows XP, under Firefox, they work fine. (The last I checked, the formatting was broken in Opera, but that's presumably because each browser implements the HTML codes differently.) On my PortableApps USB sticks, they work fine. So the relative paths seem to be correct.

Now, I've also copied exactly the same files over to a ThinkPad running Ubuntu. And, although the HTML is there, and the links work, the CSS has no effect at all, in any browser. So I did what I could to track down what was going wrong. I installed Firebug, and it shows the the line calling the CSS file is working - but the CSS file appears totally empty in Firebug as if it contains no style info at all. So I assumed I might have saved it in a text format Linux doesn't like, so I opened up the file in a text editor in Ubuntu, then resaved it. The problem persists... At this point, I'm going crazy.

As I said, I'm probably missing the blatantly obvious. But if any of you can guess what is giving me so much trouble here, with what is meant to be a simple, universal set of files, I'd appreciate some advice. Specifically, if at all possible, I want to be able to use these files on a CD or a USB stick in any OS, without having to tweak them for each one. The fact they don't work perfectly in every browser isn't such a big issue, since Firefox is common enough for my purposes. But these are supposed to be an emergency backup set of all my manuscripts, and the fact I can't make them work as intended is driving me insane.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #1 on: November 06, 2012, 02:25:13 PM »
So, you can view the CSS contents fine with a text editor, it's just when loading through a browser that it doesn't work? Can you load the CSS in the browser with a file:// url?
- carpe noctem

raybeere

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 94
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #2 on: November 06, 2012, 04:28:24 PM »
So, you can view the CSS contents fine with a text editor, it's just when loading through a browser that it doesn't work? Can you load the CSS in the browser with a file:// url?

I'll have to give that a try. I'm logged into my Windows machine right now, but when I get a chance to fire up the Ubuntu machine, I'll see what happens and post the result here. (What is "supposed" to happen, since I've never tried loading a CSS file that way. Does it just display as text?)

40hz

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,768
    • View Profile
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #3 on: November 06, 2012, 04:35:04 PM »
Linux is case sensitive when it comes to text. Are you being careful about capitalization?

Consider the following:

<link rel="stylesheet" media="screen" type="text/css" href="styles/my.css" />

The file my.css is not the same file as My.css or MY.CSS as far as Linux is concerned.
 8)

raybeere

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 94
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #4 on: November 06, 2012, 09:52:43 PM »
Linux is case sensitive when it comes to text. Are you being careful about capitalization?

Consider the following:

<link rel="stylesheet" media="screen" type="text/css" href="styles/my.css" />

The file my.css is not the same file as My.css or MY.CSS as far as Linux is concerned.
 8)

OK, I understand that - but Firebug made it clear that it considered the file was there, it just showed up as blank. So I don't think that's the problem, unless I'm misunderstanding something you're saying. Which is possible, considering the week I've had...

40hz

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,768
    • View Profile
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #5 on: November 07, 2012, 08:59:34 AM »
You might possibly have some non-visible garbage lurking somewhere in the CSS file that's causing problems. Does that happen with every browser in Ubuntu or just Firefox. If it's every browser it's something with the file. If it's just FF then there's something with Ubu's FF customization that's pooching things.

If the CSS file isn't too elaborate (or long) have you tried retyping it in Ubuntu?

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,220
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #6 on: November 07, 2012, 09:18:40 AM »
This may sound silly, but try opening it up in another text editor and saving it. Check the file for "anomalies".

I've seen files where a single character would just wreak total havoc. I forget exactly that the hex for it was, but, it might be worth a try to resave it in another editor.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

raybeere

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 94
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #7 on: November 07, 2012, 11:12:43 AM »
Linux is case sensitive when it comes to text. Are you being careful about capitalization?

Consider the following:

<link rel="stylesheet" media="screen" type="text/css" href="styles/my.css" />

The file my.css is not the same file as My.css or MY.CSS as far as Linux is concerned.
 8)

OK, I understand that - but Firebug made it clear that it considered the file was there, it just showed up as blank. So I don't think that's the problem, unless I'm misunderstanding something you're saying. Which is possible, considering the week I've had...

It turns out, this was the fix. :-[ That was the only file where I'd messed up the case - and what really fooled me was the fact Firebug wasn't reporting it as not found, just showing it as empty...

When I went to open it up in Firefox, I had to navigate to the file, and that's when I noticed the error. Well, I did say I was probably missing something obvious. ;)

And, thanks, everyone for making suggestions and getting me thinking about this.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #8 on: November 07, 2012, 11:16:53 AM »
Heh, filename case was the first thing I thought of, but didn't bother mentioning it because you said FireBug showed the file as loading :)
- carpe noctem

raybeere

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 94
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #9 on: November 07, 2012, 11:20:48 AM »
This may sound silly, but try opening it up in another text editor and saving it. Check the file for "anomalies".

I've seen files where a single character would just wreak total havoc. I forget exactly that the hex for it was, but, it might be worth a try to resave it in another editor.

It doesn't sound silly to me. In this case, it turns out it wasn't the fix - see above - but I've had other files where a single character or code would lead to seemingly impossible results. I tried the most barebones text editor I could find, in the hope it would strip anything like that out, then never considered it might not have.  :-[ Which has me feeling silly, even though it wasn't the problem. In my defense, I've had a lot going on the past few months, and between six weeks of a nasty case of bronchitis, massive stress, and frequent migraines, I suppose I shouldn't expect myself to remember everything I "should" have considered. But, no, it doesn't sound silly to me at all.

(I've had so many problems that I only resolved when I tried "silly" solutions. I once wrote a BatchRunner routine for Windows that utterly refused to work the way I expected it to - when I finally found the fix, it not only completely contradicted the way the documentation said the command was supposed to be interpreted - not much surprise there - but the way it was interpreted was so contrary to all reason, the only way I ever even thought of trying it out was because I ran the thing, observed the results, and guessed what it must be assuming, then tweaked it from there. And I once had an HTML file that behaved as if it were possessed by malicious demons, all because of a code that somehow got in there which was literally invisible to and ignored by most editors. I think it was Notepad++ I finally opened it up in and saw this weird code, deleted that, and all the trouble went away.)

raybeere

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 94
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #10 on: November 07, 2012, 11:21:37 AM »
Heh, filename case was the first thing I thought of, but didn't bother mentioning it because you said FireBug showed the file as loading :)


I still don't understand that, but since everything is working now... I intend to leave well enough alone. :D

40hz

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,768
    • View Profile
    • Donate to Member
Re: CSS File Content "Vanishes" on Ubuntu Machine
« Reply #11 on: November 07, 2012, 12:15:44 PM »
In my defense, I've had a lot going on the past few months,

Understood. No shame in that.

But this left me puzzled so I got to thinking...

I think with Firebug it didn't actually load anything which is why it displayed a blank from within the calling page. You asked for a non-existent (under Linux naming convention rules) element and it displayed what it found. In this case nothing - as in null. Which isn't quite the same thing as a blank page - which is technically something. Maybe it creates an empty file on the fly if it can't locate the one being requested?

A "stylesheet not found" error message would have been a lot more helpful, but whatcha gonna do?

Stuff like that happens to me all the time. I can successfully troubleshoot the most bizarre Windows server problem over breakfast. But then I'll make the dumbest typo imaginable for a common command in a two line script I've written before lunchtime. Or fix something really complex, run a test, catalog the fix, archive a copy, pop it on a USB key, invoke it on the live machine as a final test and verify it works there  - and then forget to write the changed file to disk on the machine it's supposed to run on. After the script's termination, or following the next reboot, the old script loads and the problem I just "fixed" is back. And I'm sitting there like a dork thinking  "Swell! What else just broke?"

Happens to all of us.  :-[

Try not to think about it too much. :)

Hope you're feeling better! :Thmbsup:
« Last Edit: November 07, 2012, 02:53:05 PM by 40hz »