Header Tags Side By Side...

They have: 5,633 posts

Joined: Jan 1970

Hi all,

On one of my site i've got the headline that I would like half one colour and half another colour.

I'm using the following code in CSS to achieve this but for some reason it won't center itself:

h1, h2{
text-align: center;
display:inline;
}
h1{
font-family: Tahoma, Verdana, Arial;
font-size:30px;
color:#cd0303;
}
h2{
font-family: Tahoma, Verdana, Arial;
font-size:30px;
color:#000000;
}

Any suggestions?

Thank you

He has: 629 posts

Joined: May 2007

HTML

<h1>Example of a Coloured <span>Headline</span></h1>

CSS

h1 {
  font: bold 30px/1 Tahoma, Trebuchet, Arial, sans-serif;
  color: #c00;
  text-align: center;
}
h1 span {
  color: #000;
}

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

They have: 5,633 posts

Joined: Jan 1970

Thank you so very much, you're a star.
I battled with that for hours but im was useless at solving it.

Previously I had done it using html tags but I'm trying to switch over to using more CSS since the previous HTML tags are deprecated. As you can tell my CSS isn't up to scratch Wink

Thanx again webwiz

They have: 5 posts

Joined: Jun 2011

Thank you very much.I have wasted many time to solved out this stuff but now got it.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.