-4

in a css file I have this code

mainTitle.abc {
    text-align: center;
    font-family:"Babylon5 Hollow";
    color: #93ff00;
    font-size: 50px;
    font-weight: bolder;
}

and in my html file I use it like this:

<body>
    <div style="text-align: center;">
        <mainTitle class="abc">The Web is the future</mainTitle>
    </div>
</body>

IE11 Displays the intended text in the predefined format, but Safari does not display the text in the wanted format. What am I doing wrong?

Sampson
  • 265,109
  • 74
  • 539
  • 565
  • 1
    What is "the wanted format" and what does it look like instead? – deceze Jan 01 '14 at 17:30
  • Safari 4.x.x is a very old browser - does it support custom HTML tags? Have you tried this in a current (i.e. V7+) Safari? –  Jan 01 '14 at 17:33
  • I checked http://www.apple.com/safari/, but there is no download link there, and the only downloads I found were NOT from Apple. – Incongruous Jan 09 '14 at 13:16

1 Answers1

1

There is no tag called <mainTitle> as far as I know, so this will work in newer browsers, but not older ones like Safari 4.1.x

Try changing those to the appropriate header (<h1>...<h6>), I'm guessing you want <h1> here, so use this code

<body>
<div>
    <h1 class="abc">The Web is the future</mainTitle>
</div>

And in your CSS

h1.abc{
    text-align: center;
    font-family:"Babylon5 Hollow";
    color: #93ff00;
    font-size: 50px;
    font-weight: bolder;
}

See also Why does CSS Work with Fake Tags?

Community
  • 1
  • 1
scrblnrd3
  • 7,228
  • 9
  • 33
  • 64
  • You also don't need `text-align: center` on both the `div` and the `h1`. It's probably alright *just on the heading*. – Sampson Jan 01 '14 at 17:34
  • Custom HTML tags are a feature of HTML5. The code is valid for later browsers, but possible not for an old Safari like v4.x.x –  Jan 01 '14 at 17:35
  • Well I wanted to leave as much the same as the original, but I'll remove that because inline CSS sucks – scrblnrd3 Jan 01 '14 at 17:35