Why Are... (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


Giomanach -> Why Are... (1/23/2005 13:13:36)

...the browsers just ignoring my CSS?

HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>iDefence - Internet Abuse Report: Prevent Abuse, Report Abuse</title>
<link rel="stylesheet" href="01.css" type="text/css" />
</head>
<body>
<div id="page">
<div id="head">
<img src="images/main.gif" alt="iDefence" width="200" height="54" align="middle" /> - Internet Abuse Resource: Prevent Abuse, Report Abuse 
</div>
<div id="nav">
<a href="#" title="Home">Home</a> | <a href="#" title="Report Abuse">Report Abuse</a> | <a href="#" title="Resources">Resources</a> | <a href="#" title="Contact Us">Contact Us</a>
</div>
<div id="content">
</div>
</div>
</body>
</html>


CSS:

html, body{
	margin: 4px;
	background: #E5E5E5;
	text-align: center;
}

#page{
	margin: 0 auto;
	text-align: left;
	background: #FFF;
	border: 1px solid #000;
	width: 750px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}

#head{
	color: #BBB;
	font-size: 18px;
	font-weight: bold;
	font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
	padding: 5px;
}

#nav{
	background: #FFF url(images\navback.gif) repeat-x;
	text-align: center;
	height: 20px;
}

#nav a:link{
	background: transparent;
	padding-left: 20px;
	padding-right: 20px;
	padding-top: 4px;
}


Please say it isn't me...

It all Validates as XHTML 1.0 Trans and CSS validates without warnings.....

Dreamweaver displays it fine...so does FrontPage, but the browsers? [img]http://tcwozere.co.uk/smileys/banghead.gif[/img]

The page displays as it should, but the nav DIV, only the left and right padding on the links works, nothing else, the filenames on the images are right, everything as far as I can see is right....

TIA

Dan




jaybee -> RE: Why Are... (1/23/2005 15:21:56)

Looks OK to me but I can't upload the screenshots. For some reason it's saying I can only have 6kb! ? ! ???????

I'll attach them in a PM or if that won't work I'll mail them.




Giomanach -> RE: Why Are... (1/23/2005 15:55:42)

Try looking at this:

http://giomanach.wm-talk.com/iDefence

the nav should have a dark red gradient background on it: http://www.giomanach.wm-talk.com/iDefence/images/navback.gif




jaybee -> RE: Why Are... (1/23/2005 16:01:44)

quote:

#nav{ background: #FFF url(images\navback.gif) repeat-x;


[sm=lol.gif][sm=lol.gif]

try putting the \ the other way round.

url(images/navback.gif)




Kitka -> RE: Why Are... (1/23/2005 16:13:31)

quote:

For some reason it's saying I can only have 6kb!


I'm getting the same restriction - I thought it used to be 50kb? There's not much you can do with 6kb these days [:o]




jaybee -> RE: Why Are... (1/23/2005 16:34:12)

Oh well at least it's not just me then. [:D]




Giomanach -> RE: Why Are... (1/23/2005 17:25:06)

quote:

try putting the \ the other way round.

url(images/navback.gif)

OK then
Why does it work on this stylesheet, and not the one above?


edited for content by c1sissy 01/23/05




c1sissy -> RE: Why Are... (1/23/2005 21:20:35)

Dan, Jaybee is correct in how this needs to be written. Not sure why its working on one sheet and not the other. However, she is correct.

And Please, keep your comments nice as they are only trying to help you.[;)]




Giomanach -> RE: Why Are... (1/24/2005 4:02:17)

That's really odd....

All the stylesheets I've done to date, apart from this one, that refer to images etc, have all had the reference images\name.gif not the other way round and have worked...

That's the reason why I ignored that bit (the validator also doesn't pick it up)

Oh well, I'll make a mental note for future....

Dan




c1sissy -> RE: Why Are... (1/24/2005 7:06:18)

quote:

have all had the reference images\name.gif


Dan, if you are really studying this correctly, you would know that the way that you have that set up is incorrect. And please, if you are going to post for help, accept the help that is offered to you without a tude. People are only answering your posts to help you, not belittle you.[;)]




Giomanach -> RE: Why Are... (1/24/2005 7:20:03)

Deb, my remark was more out of sarcasm rather than offence....

I'm still confused as to why it's worked before and not now[&:]




Kitka -> RE: Why Are... (1/24/2005 7:35:06)

Hi Deb,

I think that cultural differences might be at work here.

<edit>Message edited. I would have prefered to delete it, but I'm denied that for some reason. [:o] [>:] </edit>




c1sissy -> RE: Why Are... (1/24/2005 8:13:26)

quote:

my remark was more out of sarcasm rather than offence


But, sarcasm can be offensive, and for people who visit to get information, it doesn't look helpful to find things like this. Just my opinion as a mod.[;)]




jaybee -> RE: Why Are... (1/24/2005 10:07:34)

Completely ignoring the name calling incident, 1 because I didn't see it and 2 because I'll send him something unpleasant through the post...

To answer Dan's question about \ /

Check out any live stuff where you think you had a \ and see if it still is. I've noticed that if you type \ into a lot of editors, they very kindly turn it into a / when you save the page.




Giomanach -> RE: Why Are... (1/24/2005 10:11:10)

Including Notepad? [:D]




c1sissy -> RE: Why Are... (1/24/2005 10:13:26)

quote:

I've noticed that if you type \ into a lot of editors, they very kindly turn it into a / when you save the page.


But, if as I suspect, he is handcoding, this wouldn't be the case. Unless, in some cases he is using an editor, and others he is hand coding, which would be the difference in what he is talking about in regards to some of them working and this one not?

Dan, just trying to figure this out for you. What did you do different with this one, that you didn't do with the others that you are saying worked?




Giomanach -> RE: Why Are... (1/24/2005 10:18:41)

Notepad and Dreamweaver are my main two, I do have Top Style Lite, but I don't use it...




jaybee -> RE: Why Are... (1/24/2005 10:28:47)

quote:

Unless, in some cases he is using an editor, and others he is hand coding,


That was my point.

Dreamweaver will convert it, notepad won't.




jaybee -> RE: Why Are... (1/24/2005 10:31:54)

Have you seen the ads at the top of the page. Classic! I just love ebay and google in partnership.

Check out the 3rd one down....

[image]local://upfiles/9075/C54C05189DBC41BCB9DC684C4B1EBE4A.gif[/image]




Giomanach -> RE: Why Are... (1/24/2005 10:34:54)

No dreamweaver wont [:D]

That stylesheet originally posted was hand coded in DW, not Notepad, I was using it for the ease of switching between CSS & HTML & Preview. DW leaves it as you type it. It doesn't even pick it up as a validity error. But if you use the "Browse" function of DW to locate the image, it does use images/ not images\

I've done it like that all the time before and it's worked, so my question now, is why?

\ is mainly used for directory structure, and the majority of browsers flip it round to correct the typo

Again, why has it worked on previous stylesheets for all, and not this one.




Giomanach -> RE: Why Are... (1/24/2005 10:39:29)

Ok, I've just looked through all the previous stylesheets I;ve done, and two contain the / - and they work (in IE only, before I met FF etc)....

So, it's something that's happening in browser development....case closed...




c1sissy -> RE: Why Are... (1/24/2005 10:53:43)

[sm=lol.gif][sm=lol.gif][sm=lol.gif]
Discount and used style sheets on EBAY? too much, did you check it out to see what they offered?




jaybee -> RE: Why Are... (1/24/2005 12:58:09)

quote:

So, it's something that's happening in browser development


Found the following in Browser techs after a quick search

quote:

Web addresses never contain backslashes. Newer browsers will silently correct this error, but older ones may not.




Giomanach -> RE: Why Are... (1/24/2005 13:44:26)

[img]http://www.anorenn.com/forum/html/emoticons/huh.gif[/img]

I'm gonna leave it at that......




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.109375