Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2011, 01:32 PM
Authorized User
 
Join Date: Feb 2011
Posts: 25
Thanks: 2
Thanked 1 Time in 1 Post
Default Can't get external css stylesheet to work

I have no idea why my html documents are not being changed by my external css stylesheet. My css stylesheet follows all the rules, no spaces, not html or body elements e.t.c. The html documents has this phrase in its <head> element <link rel="stylesheet" type="css/text" href="........./file.css" />. But nothing changes. The only time it works is when I have a <class> tag in the html document. The properties pertaining to that class are the only ones in my css stylesheet file that work, none of the others work. I have IE8, and pretty sure all of the standard styles are supported. I have tried everything, including downloading the source code, from the book Beginning HTML, XHTML, CSS, and JavaScript. The css(ch07) examples don't even work in the the source I download. The html documents don't change. Just like mine. I have no idea what to do. Any help would be grateful.
 
Old February 6th, 2011, 02:16 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Not sure exactly what to make of this...

Code:
<link rel="stylesheet" type="css/text" href="........./file.css" />.
All those dots don't seem like a valid path to me. Are you sure you're correctly referring to the CSS file *relative to the document where it's used*?

Quote:
The only time it works is when I have a <class> tag in the html document.
There's no such thing as a <class> tag. What exactly are you referring to?

Can you explain your site's structure and the exact code you're using to refer to your style sheets? It sounds to me that your paths are wrong so the browser can't find the referenced files.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 7th, 2011, 09:34 AM
Authorized User
 
Join Date: Feb 2011
Posts: 25
Thanks: 2
Thanked 1 Time in 1 Post
Default

Yeah sorry. The ......, I inserted was just to signify whatever file the css stylesheet was located. It wasn't to reference a particular file path name. My particular file path name is href="Programming 2/css/ch07_eg19" />. Again I apologize for saying <class> element. I was actually referring to the class atrribute. The only changes in my html document come from the class atributes. For example, if I had an html document with a table and the table data had a code like so: <td class="one">I have problems</td>. and in my adjoining css stylesheet, I had a list of different rules pertaining to the elments in said html document, and I had the td.one {font-family:verdana;} included. Only the td.one {font-family:verdana;} would change in the html document, none of the other rules would.
 
Old February 7th, 2011, 09:36 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I am not sure if the problem is solved now or not....
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 7th, 2011, 01:10 PM
Authorized User
 
Join Date: Feb 2011
Posts: 25
Thanks: 2
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by Imar View Post
I am not sure if the problem is solved now or not....
Thanks a lot man. It was my filepath name, got it confused, but its all sorted out now. Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
external CSS in JavaScript code webdesign Javascript 1 September 1st, 2006 04:35 PM
CSS 2 Stylesheet jainnid CSS Cascading Style Sheets 1 July 6th, 2005 01:16 AM
i need help with css stylesheet DSteven CSS Cascading Style Sheets 2 February 13th, 2005 02:10 PM
Using a CSS stylesheet with Microsoft Excel and We infosports Excel VBA 1 July 11th, 2004 10:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.