HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
My FIRST .css - but NOT WORKING in Microsoft IE!!???
Post new topic   Reply to topic    HTML Help Forum Index -> CSS
View previous topic :: View next topic  
Author Message
scudder



Joined: 27 Jul 2006
Posts: 6
Location: Florida

PostPosted: Thu Jul 27, 2006 2:35 pm     My FIRST .css - but NOT WORKING in Microsoft IE!!??? Reply with quote

Hello!! I'm a NEWWWWW HTMLer!! I am basically totally SELF-TAUGHT having created my first webpage back in 1997 by trial and error, "borrowing" code from various sites and reading about the basic tags and formatting on the internet. The SECOND site I ever made was about 2 years ago and that was very very basic as well....fonts, links, tables, images, colors, background colors, font sizes...

I recently took on the task of creating another website for a friend and researched the internet to brush up on my rusty HTMLing. I was running into some font and table problems when I found this <htmlcodetutorial> website here!! I paid SPECIFIC attention to the "Break the <FONT...> Habit" section, read ALL the pages, "readied" my HTML for use with an EXTERNAL style sheet and created my VERY FIRST .css!!!

I uploaded the CSS to my host server and everything SEEMED fine at home...after a little tweaking for formating that I did not intend or did not correctly define. HOWEVER, when I checked the pages I uploaded at work, the formating result was NOT CORRECT and NOT THE SAME as when I checked at home!!!

AT HOME I was creating the HTML pages and the CSS on my PowerBook and VIEWING the uploaded pages with the latest version of Apple's Safari. AT WORK I tried to look at the website using a PC and Microsoft IE (don't know the version) and NONE of the formatting defined in the CSS that I uploaded worked!!! Images were in place, tables in place but NO background color or font choice or italics or link hover or font size formatting or any classes I defined....NO FORMATTING defined on the .css appeared!!

I came home and tried my wife's computer in our office (a Dell PC). IE on here computer had the SAME result as work...NO FORMATTING!! But, INTERESTINGLY, her Netscape browser (version 8.0) **DID** have most of the formatting I created with the CSS show CORRECTLY!!

So, my question....why isn't IE reading my CSS?? I THOUGHT I "readied" my HTML correctly and created the CSS correctly!!

Below please find the text of my .css file. I have also included the "<head>" information from my index page. I (believe I) followed all the steps for readying my HTML and creating a .css but not sure why IE doesn't like what I did!

Thank you all VERY MUCH for your help!!

Scott

-------------------------------

(my .css text from just a plain text file and uploaded as such)

body
{
background:#000000; color:#999999; font-family:"Trebuchet MS"; font-style:italic;
}

a:link {color:#999999}
a:visited {color:#999999}
a:active {color:#FFCC00}
a:hover {color:#FFCC00}

marquee
{background:#FFCC00; color:#000000; font-style:italic; font-size:120%
}

.linktable
{
text-align:left; font-style:normal; font-size:125%;
}

.yellow
{
color:#FFCC00;
}

--------------------------

(my "readied" HTML <head> portion with code/DOCTYPE info suggested by htmlcodetutorial.com; <title> and <meta> descriptions removed for easy reading)

<!DOCTYPE html PUBLIC "-//W3C/DTD HTML 4.01 Transitional//EN">

<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">

<link REL="stylesheet" TYPE="text/css" href="alan.css">
</head>
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Thu Jul 27, 2006 5:38 pm     Reply with quote

What exactly is not working?

_________________
Corey
Loud Info | Loud Worx | Merchant Account Blog
scudder



Joined: 27 Jul 2006
Posts: 6
Location: Florida

PostPosted: Thu Jul 27, 2006 5:52 pm     Reply with quote

Corey Bryant wrote:
What exactly is not working?


To quote from the middle of my original post above:

Quote:
AT HOME I was creating the HTML pages and the CSS on my PowerBook and VIEWING the uploaded pages with the latest version of Apple's Safari. AT WORK I tried to look at the website using a PC and Microsoft IE (don't know the version) and NONE of the formatting defined in the CSS that I uploaded worked!!! Images were in place, tables in place but NO background color or font choice or italics or link hover or font size formatting or any classes I defined....NO FORMATTING defined on the .css appeared!!

I came home and tried my wife's computer in our office (a Dell PC). IE on here computer had the SAME result as work...NO FORMATTING!! But, INTERESTINGLY, her Netscape browser (version 8.0) **DID** have most of the formatting I created with the CSS show CORRECTLY!!



So, on Microsoft Internet Explorer **NOTHING** is working!!...ZERO formatting...no font selection, no italics, no black background, no hover-over yellow links, no link font size 125%...NONE of my .css formatting choices.

BUT ALL the formatting from the .css file *DOES WORK* as viewed through my Safari browser and Netscape browser.

For some reason, MIE seems to be IGNORING the formatting directives in my .css. And since this is my VERY FIRST .css I ever created, I don't know if it is my syntax or MIE needs some special instruction to associate the .css file or what!

Thanks SO MUCH for your help!!

Scott
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Fri Jul 28, 2006 3:06 am     Reply with quote

I get confused when the codes are not used to separate everything for some reason and miss a few things from time to time.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<style type="text/css">
body
{
background:#000000; color:#999999; font-family:"Trebuchet MS"; font-style:italic;
}

a:link {color:#999999}
a:visited {color:#999999}
a:active {color:#FFCC00}
a:hover {color:#FFCC00}

marquee
{background:#FFCC00; color:#000000; font-style:italic; font-size:120%
}

.linktable
{
text-align:left; font-style:normal; font-size:125%;
}

.yellow
{
color:#FFCC00;
}
</style>
</head>

<body>
test
</body>

</html>
Worked for me just fine. Your DOCTYPE is a bit incorrect, that might be the issue.

_________________
Corey
Loud Commerce | Loud Worx | Merchant Account Blog
scudder



Joined: 27 Jul 2006
Posts: 6
Location: Florida

PostPosted: Mon Jul 31, 2006 5:01 pm     Reply with quote

Hi Corey...

Thank you VERY much for your help and suggestions. I tested your test page as well and it worked for me too!

I do have a couple followup questions if you don't mind...forgive me, I'm VERY new at this!! Smile At first, I was thinking of dissecting the changes that you might to figure out ON MY OWN how each change affected the successful rendering of my HTML page, however, there were a few too many variables so I'm just going to ask the questions I had in mind Smile

(1) The original DOCTYPE I copied *VERBATIM* from the htmlcodetutorial.com CSS information sections http://www.htmlcodetutorial.com/style/_SETUP.html but you mentioned that it was a "bit incorrect". I was wondering what the REASONS were for using your DOCTYPE (which worked!) and my original (which did not) and the "iso" vs. "windows" charset change that you made??

(2) In my original post above, you might have noticed that I was *ATTEMPTING* to create and use an external .css file but failed. I saw that you utilized an Embedded Stylesheet between the <head> tags. I was hoping to AVOID the need to embed style code at the top of EACH AND EVERY one of my pages...hence the external .css attempt. FIRST, do you suggest/prefer an Embedded Stylesheet format?? SECONDLY, if you do not necessarily prefer or suggest that format, HOW do I use the <link REL=...> tag to properly point to my .css file?? I tried to use *YOUR* DOCTYPE and other changes while at the SAME TIME trying to point the browser to the .css file with my original <link REL="...> tag and the page, once again, did not render correctly...it only rendered correctly when I used your Embedded format WITHOUT my <link REL"...> tag. There must be either a problem with my syntax or I am simply confused about how to point the page to the .css file. This is ALL that I had in my header portion of my original HTML:

Quote:
<link REL="stylesheet" TYPE="text/css" href="alan.css">


I think I defined/named an External Stylesheet but failed to POINT the webpage to the .css for use!! How do I THEN point a page to the "alan.css" StylesheetI created??

THANKS SO MUCH FOR YOUR TIME!!

Scott
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Tue Aug 01, 2006 2:55 am     Reply with quote

scudder wrote:
(1) The original DOCTYPE I copied *VERBATIM* from the htmlcodetutorial.com CSS information sections http://www.htmlcodetutorial.com/style/_SETUP.html but you mentioned that it was a "bit incorrect". I was wondering what the REASONS were for using your DOCTYPE (which worked!) and my original (which did not) and the "iso" vs. "windows" charset change that you made??
DOCTYPES are very particular. They let the browser know that you are using, etc. If you do not use a DOCTYPE, IE will go into quircks mode and a lot of times the display will be exactly hat you want, but it will not be correct.

As far as the charset, that was the one I have been using for quite some time. Character encoding might help you out some on that.
scudder wrote:
(2) In my original post above, you might have noticed that I was *ATTEMPTING* to create and use an external .css file but failed. I saw that you utilized an Embedded Stylesheet between the <head> tags. I was hoping to AVOID the need to embed style code at the top of EACH AND EVERY one of my pages...hence the external .css attempt. FIRST, do you suggest/prefer an Embedded Stylesheet format?? SECONDLY, if you do not necessarily prefer or suggest that format, HOW do I use the <link REL=...> tag to properly point to my .css file?? I tried to use *YOUR* DOCTYPE and other changes while at the SAME TIME trying to point the browser to the .css file with my original <link REL="...> tag and the page, once again, did not render correctly...it only rendered correctly when I used your Embedded format WITHOUT my <link REL"...> tag. There must be either a problem with my syntax or I am simply confused about how to point the page to the .css file. This is ALL that I had in my header portion of my original HTML:

Quote:
<link REL="stylesheet" TYPE="text/css" href="alan.css">


I think I defined/named an External Stylesheet but failed to POINT the webpage to the .css for use!! How do I THEN point a page to the "alan.css" StylesheetI created??
Your style sheet would be
Code:
body
{
background:#000000; color:#999999; font-family:"Trebuchet MS"; font-style:italic;
}

a:link {color:#999999}
a:visited {color:#999999}
a:active {color:#FFCC00}
a:hover {color:#FFCC00}

marquee
{background:#FFCC00; color:#000000; font-style:italic; font-size:120%
}

.linktable
{
text-align:left; font-style:normal; font-size:125%;
}

.yellow
{
color:#FFCC00;
}
and then you save this as maybe alan.css and reference it as you did. I used an internal style sheet so all the code would be there without brreaking it up.

_________________
Corey
Loud Info | Loud Worx | Merchant Account Blog
scudder



Joined: 27 Jul 2006
Posts: 6
Location: Florida

PostPosted: Tue Aug 01, 2006 4:30 am     Reply with quote

Quote:
<link REL="stylesheet" TYPE="text/css" href="alan.css">


I tried to link with PRECISELY the above syntax but was having trouble. Worse comes to worse, I'll just leave the formatting style as Embedded within the <head> tag, get the site functioning and worry about changing to an External Stylesheet at a later time.

Thanks SO MUCH for your time!!

Scott
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Tue Aug 01, 2006 6:30 am     Reply with quote

Is alan.css in the same folder as the HTML page? If so, can you give an URL to the HTML page?
_________________
Corey
Loud Commerce | Loud Worx | Merchant Account Blog
scudder



Joined: 27 Jul 2006
Posts: 6
Location: Florida

PostPosted: Tue Aug 01, 2006 6:53 am     Reply with quote

Yes. I tried putting the alan.css file in the SAME folder as the webpage. Also tried putting it in the same page as the index.html page.

I'm also pretty sure I tried the FULL html in the format:

Quote:
<link REL="stylesheet" TYPE="text/css" href="http://www.......com/alan.css">


Other than putting that <link REL=...> tag above in the <head> section of my page and putting the .css in the proper folder, is there any other HTML command I need to put in a page to tell the broswer to use the .css file?? Is the format of my <link REL=...> tag proper??
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Tue Aug 01, 2006 7:20 am     Reply with quote

The syntax is correct - I use almost the same:
Code:
<link rel="stylesheet" href="includes/style.css" type="text/css" />
I use lower case and close the tag since I am doing XHTML but since you are using HTML, yours is fine.

Once you get it on the web, let's try it and give the URL to the HTML page and maybe there can be more to decipher

_________________
Corey
Loud Commerce | Loud Worx | Merchant Account Blog
scudder



Joined: 27 Jul 2006
Posts: 6
Location: Florida

PostPosted: Tue Aug 01, 2006 12:38 pm     Reply with quote

Corey...

Thanks for your offer to look at my HTML page but it appears I was able to get the page to properly refer to the External .css file!! I enjoy trying to "figure out" any problems with my pages so I tried a few things and was able to get it to work.

Perhaps you could look below to see what I did to make it work and, maybe, EXPLAIN why the change worked for me??

So, my problem was with the page not rendering correctly with IE. In a prior post, you created a test page with my .css style information as an Embedded Stylesheet and that page DID work in IE. I was able to get it to work in IE as well but when I again attempted to reference and External Stylesheet, I again ran into IE problems.

So my original reference link was:
Quote:
<link REL="stylesheet" TYPE="text/css" href="alan.css">


You said you use lowercase and close the tag with XHTML but mine was OK as is...I still changed my reference link to ALL LOWERCASE as well but that didn't help.

I also tried a FULL HTML link rather than the relative "alan.css" reference but that did NOT work either.

Then I made a change to the following reference link:
Quote:
<link rel="stylesheet" href="alan.css">


I TOOK OUT the _type="text/css"_ portion of my original reference link because...I don't know...it seemed REPETATIVE to the changes YOU made with reworking my DOCTYPE info and when you added a SEPARATE <style type="text/css"> tag.

So, that last change I did...removing the "type="text/css" in the link rel tag WORKED. The page properly rendered in IE!

So, any clue why it worked?? Did I just get LUCKY or is there some sort of reason?? I would prefer to UNDERSTAND why it worked because, if I just got "lucky," it is possible that with more complicated pages or .css styles, my luck might RUN OUT and cause problems again.

That being said...so far so good!! Smile

Scott
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Tue Aug 01, 2006 12:41 pm     Reply with quote

Well you might try the lowercase type instead of TYPE. But without seeing a lot more, I do not know

_________________
Corey
Loud Info | Loud Worx | Electronic Payment Gateways
Leew



Joined: 02 Aug 2006
Posts: 2

PostPosted: Wed Aug 02, 2006 1:50 pm     CSS of page not showing up when posted Reply with quote

Hi Corey,

Just read through your posts with Scott in Florida and I have much the same problem. I am, apparently, using embedded stylesheets. I'm just trying to put up a little landing page for the company I'm an affiliate with.

I'm using Front Page (carefully) and all my formatting and pics show up beautifully until I upload them then nothing when I view page online.

Both HTML landing page and css page are in same location at root under main URL and all pics and background is in images dir correctly.

You can see my code in "source" for
<link rel="stylesheet" href="bottled_water.css" type="text/css">

This is address where page is http://www.grabyourinfo.com/bottled_water.html.
Can you shed any light? I'm not HTML trained (no kidding - ha) but once I learn something it's added to my tool box.

Thanks in advance,
Lee
Clearwater, FL
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Thu Aug 03, 2006 4:37 am     Reply with quote

As far as I can tell, this has nothing to do with CSS, but your images. When I go to http://www.grabyourinfo.com/images/bottle.jpg it wants to show some image and does not tell me file is not found. The image might be corrupt or the server might not know how to display the correct mime type on the image

The CSS looks like it works just fine with the exception of the background image which goes above to what I was saying. It is showing a background color, etc

_________________
Corey
Loud Commerce |
Loud Worx | Loud Ads
Leew



Joined: 02 Aug 2006
Posts: 2

PostPosted: Thu Aug 03, 2006 7:04 am     FTP transfer pics corruption Reply with quote

Thanks Corey,

Duh, I had my FTP program set to ASCII only for a specific purpose and forgot to set it back to AUTO.

Now all's well now. Very Happy Sometimes you just need an exterior person to say "look at this".

Lee
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> CSS All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial