You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Safari CSS H1 font color ignored - when will Apple fix simple CSS rendering

When will Apple fix the most basic of CSS rendering on Safari?
body
This is an abbreviated listing of CSS file:
-------start css---------- body {
background-color: #660099;}
P , UL {
color: #FFFF00;
text-indent: 16pt;
font-family: Arial, Helvetica, sans-serif;
}
H1, H2, H3, H4 {
color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
}
----------end css
The text color works fine in P (paragraphs) but NEVER works using Safari for (h1,h2,h3,h4 headings)

The code is perfect, according to specs and rendered exactly the same using dreamworks and BBEdit. The code is NOT the problem. Only Safari doesn't color the text of the headings.

When will Apple fix this problem? It's been there since day one. It's really the most basic of CSS style usage.

all mac models Mac OS X (10.4.8)

all mac models Mac OS X (10.4.8)

all mac models Mac OS X (10.4.8)

Posted on Feb 27, 2007 3:18 PM

Reply
8 replies

Feb 27, 2007 4:49 PM in response to petethelen

I've never had a problem with Safari not rendering CSS for H1 elements, or anything else along those lines.

Here's a test page I just set up using your CSS snippet:

http://home.comcast.net/~rmrshop/testh1css.html

In my Safari, the headline (H1) is white against the purple page background, as the CSS specifies:

User uploaded file



Do you have a live page where this is not working for you? Can you provide a link, so others try to determine what the problem is?

Feb 27, 2007 8:08 PM in response to petethelen

Your problem is here:

P I {
color: #99FF00;
font-style: italic;
: 1px 1px 1px 1px }
H1, H2, H3, H4 {
color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
}

That bit I've highlighted in red isn't valid, and so the stylesheet isn't being read any more beyond that point, thus dropping the header styling that follows.

I tested that by uploading the HTML and CSS files to the following link (minus images, obviously) and just omitting that one invalid line of CSS:

http://home.comcast.net/~rmrshop/test2h1css.htm

As you can see, the headers are now white, as desired. Apparently Safari is being fussier about the invalid line of code and balking at that point, while other browsers are being more forgiving.

I'm guessing that line of code just has a property name dropped, perhaps "margin" or "padding"?

A good way to catch problems like this is to check your pages using the W3C HTML validator and CSS validator. The CSS validator catches this error.

15" MacBook Pro 2.0GHz/100GB (7200rpm)/2GB RAM; Windows XP Pro on Parallels Mac OS X (10.4.8) 400MHz G4 (Sawtooth); Airport network; 60GB iPod photo; Dell-in-the-Closet

Feb 27, 2007 8:11 PM in response to petethelen

thanks for your help. I have debugged this many times, but since every browser ( i test with 6 windows browsers and 8 mac browsers) except safari rendered it properly for the past year, I made the mistake of thinking that the code was fine. (however, i feel safari should be at least as forgiving as the rest of the competition too) yet, it was clearly, my typo.
pete

all mac models Mac OS X (10.4.8)

Safari CSS H1 font color ignored - when will Apple fix simple CSS rendering

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.