PDA

View Full Version : one letter styling


jax23
10-30-2009, 11:48 AM
I have a h1 tag styled with and id tag to Times Roman,set colour and size etc.... but want to change the style of one of the letters in size and colour. So made another id called #o and thought I could just wrap this round the letter like so....


<div id="header">
<h1>kate <id="o">O</id="o">rton: Glassmaker</h1>
</div>


this doesnt work, whats the correct way of doing this? many thanks

Corrosive
10-30-2009, 11:57 AM
Use a span tag...

<h1>kate <span id="o">O</span>rton: Glassmaker</h1>

domedia
10-30-2009, 02:49 PM
There is no HTML element called 'ID", you just made it up 8)
So made another id called #o and thought I could just wrap this round the letter like so....


<div id="header">
<h1>kate <id="o">O</id="o">rton: Glassmaker</h1>
</div>

d a v e
10-30-2009, 02:52 PM
don't forget though that if you're going to use it anywhere else on the page - or if you think you might later - then use a class instead of an id. Ids are unique to a page ;)

jax23
10-30-2009, 03:02 PM
that worked a treat, its just for one letter in the title so id is fine. cheers!