16 replies [Last post]
Jenni
Jenni's picture
Offline
Enthusiast
Seattle
Last seen: 11 years 36 weeks ago
Seattle
Joined: 2007-03-09
Posts: 115
Points: 0

Hi,

I created a style sheet for this page, when I link to it in the code the styles in the stylesheet are not being applied to the xhtml:

http://www.wisetopic.com/photos/photo.aspx?userid=66&imageid=298

*Notice that the font for the Image Title is not styled. If you click the "Leave Comment" link the comment box there is not styled either...

I copied and pasted the exact same style inline (into a style code block in the body) on this page and it works fine:

http://www.wisetopic.com/photos/phototest.aspx?userid=66&imageid=298

Click on the "Leave Comment" link now - it has the style it is supposed to have.

The CSS for the first page is here: http://wisetopic.com/photos/css/common.css

Any ideas on why the style in the style sheet are being ignored???

Thank you.

Phreestyle
Phreestyle's picture
Offline
Enthusiast
Australia
Last seen: 4 years 46 weeks ago
Australia
Timezone: GMT+8
Joined: 2007-05-12
Posts: 235
Points: 6

Hey Jenni,

Hey Jenni,
you've got some weird *beep* happenin' at the start of your stylesheet. vis:

div, p, a, span, input, textarea {
font-family: Trebuchet MS, Arial, Verdana, sans-serif;
}

Have you tried using an absolute path to your stylesheet? That might be a fruitful place to start troubleshooting. There may be a problem with your file heirarchy. Are you using server side .asp includes?

Life's a journey. Enjoy the trip.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

I think that that "weird

I think that that "weird **beep***" has been mentioned before? it's a byte order mark (BOM) you're saving your files all of a sudden as utf-8, save as plain ANSI

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Jenni
Jenni's picture
Offline
Enthusiast
Seattle
Last seen: 11 years 36 weeks ago
Seattle
Joined: 2007-03-09
Posts: 115
Points: 0

Hi Phreestyle. That is so

Hi Phreestyle.

That is so weeeeeiiird! Where are those funky characters coming from? I assume you saw them in the common.css file? I deleted the whitespace and resaved it. Maybe that fixed those problems...

So does it still look weird when you go here?: http://wisetopic.com/photos/css/common.css

Ok I hard coded the URLs in per your suggestions. They now look like this:

That did not seem to help at all on this page:

http://www.wisetopic.com/photos/photo.aspx?userid=66&imageid=299&imageDetails=False

What an annoying problem! I've been banging my head on this for a couple days.. I dunno what else to look at :/ I'm stmped and about ready to rebuild it from scratch.......

JQ

Phreestyle
Phreestyle's picture
Offline
Enthusiast
Australia
Last seen: 4 years 46 weeks ago
Australia
Timezone: GMT+8
Joined: 2007-05-12
Posts: 235
Points: 6

Nope they are still

Nope they are still there.

You should probably investigate Hogo's suggestion. Check out the settings on whatever editor or upload systems you are using. Something is obviously awry.

Life's a journey. Enjoy the trip.

Jenni
Jenni's picture
Offline
Enthusiast
Seattle
Last seen: 11 years 36 weeks ago
Seattle
Joined: 2007-03-09
Posts: 115
Points: 0

OK, THansk for your advice

OK, THansk for your advice Hugo. I opened up the common.css file in notepad and removed the whitespace around that first tag. I can't think of any other way of saving the file as plain ANSI. Is that the best way of saving as ANSI as opposed utf-8.

I still can't see the funky characters in the css still. I looked at the source in notepad, Visual Studio (which prolly is what messed it up) and the Source Viewer in FireFox.

Also, in FireFox I dont see ny kind of formatting now whatsoever. It looks ok in IE. I cleared the cache in FF by going to Tools > Clear Private Data > Cache (checked) then "Clear Private Data Now". Even after I flush the cache and hit refresh I'm no seeing any style on either of those pages..

Why am I having these stupid weird problems w/this page??

Thank you.

Jenni
Jenni's picture
Offline
Enthusiast
Seattle
Last seen: 11 years 36 weeks ago
Seattle
Joined: 2007-03-09
Posts: 115
Points: 0

By the way - thanks to you

By the way - thanks to you too Phreestyle!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Jenni are you seriously

Jenni are you seriously writting/editing and saving in notepad? the actual windows Notepad!

If you are coding you should be using a code editor only( not sure whether 'Visual studio' counts as one!); all true code editors will allow you to see any character marks in a file.

In notepad you need to do 'save as' from file menu and check what the bottom 'drop down' says for 'file encoding', you want it set to 'ANSI'.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Jenni
Jenni's picture
Offline
Enthusiast
Seattle
Last seen: 11 years 36 weeks ago
Seattle
Joined: 2007-03-09
Posts: 115
Points: 0

LoL - Not sure if Visual

LoL - Not sure if Visual Studio counts as one. That's rich! I love it...

Jenni
Jenni's picture
Offline
Enthusiast
Seattle
Last seen: 11 years 36 weeks ago
Seattle
Joined: 2007-03-09
Posts: 115
Points: 0

hmm hmm hmm. You truly were

hmm hmm hmm. You truly were right - the common.css file was saved as UTF-8. I went ahead and saved it as ANSI, flushed out my cache, and tried the original page that has the stylesheet reference again and still, its not picking up the formatting in the stylesheet.

I'm trying to think what else the problem can be.... The "Common.css" file is the the last referenced style sheet in the head tag, so it is not getting over written by other styles. The style sheet validates. I just commented out all the javascript on that page, so I know its not interfering with the css (there is a funky "style swapper" script in there, but its commented out now)

ARGH! :curse:

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Jenni same problem - iirc -

Jenni same problem - iirc - as before, you have style block in your body section of the page, it probably won't effect the problem but please sort that out so that your page validates.

re the stylesheet having disabled javascript also just try removing the title attribute so that it's not a 'preferred' sheet but a 'persistent' one and move it before the 'alternate' ones, just to ensure that these aren't factors in things.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Jenni
Jenni's picture
Offline
Enthusiast
Seattle
Last seen: 11 years 36 weeks ago
Seattle
Joined: 2007-03-09
Posts: 115
Points: 0

So what code editor do you

So what code editor do you use Hugo?

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

At the moment HTML-kit as

At the moment HTML-kit as I'm trying to get used to the full capabilities of it's customizable potential.

Apologies for the unintentional slur on Visual Studio Smile

So have you sorted the stylesheet?

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Jenni
Jenni's picture
Offline
Enthusiast
Seattle
Last seen: 11 years 36 weeks ago
Seattle
Joined: 2007-03-09
Posts: 115
Points: 0

Hugo is my new hero.

Bloody hell Hugo - that did the trick!! I removed the "title" attributes from teh style sheet declarations and moved the common.css file to the top of the list - that seemed to fix it. I would have never ever ever figured that out on my own - and everyone on my team was like *daaaar*.

I am forever in your debt. I guess what they say is true - "Learn of the skillful; for he that teaches himself has a fool for his master." In this case you're the skillful and I am the fool (but hey whats new right).

I'll have to check out HTML-kit. I'm not a Visual Studio fan really... I mean its an amazingly complex tool that does a whole heck of a lot, but for CSS its not really super great. But you can't really "hate" Visual Studio - right? I mean, Its a tool... that'd be like saying "I hate hammers, but screwdrivers totally rule!" If you want to cut something you don't use a screwdriver... If you write .NET code I would hope you'd try stay away from notepad.

In appreciation of your help here is a picture of me dressed as a pirate:

Cheers!

Phreestyle
Phreestyle's picture
Offline
Enthusiast
Australia
Last seen: 4 years 46 weeks ago
Australia
Timezone: GMT+8
Joined: 2007-05-12
Posts: 235
Points: 6

Morning, I'm glad you got

Morning,
I'm glad you got your problem sorted out.

I too use HTML-kit as a code editor (and ftp manager) and would recomend it to anyone. And, it is free.

BTW, I like your site a lot.

cheers

Life's a journey. Enjoy the trip.

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 36 weeks 5 days ago
Joined: 2004-06-30
Posts: 9668
Points: 801

Arrrrr

"Learn of the skillful; for he that teaches himself has a fool for his master"

I'll have to remember that, it's a good one Wink

For the record I pretty much exclusively use notepad or notepad2 for all my coding, which is mainly CSS/HTML and some ASP stuff.

Verschwindende wrote:
  • CSS doesn't make pies

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Great pic I've been

Great pic Smile

I've been learning from a fool for a long time probably why it's been a struggle Smile

For interests sake and if you have time it would be worth establishing the exact cause of the problem i.e with the stylesheet call in the new position add back in the title attribute as it was, ergo was it in actual fact a problem with the multiple whitespace seperated words in the attribute? both 'persistent' and 'preferred' stylesheets are supposed to be read, only 'alternate' sheets are overlooked until actually requested.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me