Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Cascading Style Sheets _ Can I change the font style of of an existing page with css?

Posted by: johnminkough Feb 26 2012, 06:43 PM

Hi

I'm a css novice.

I have 40 or so html pages that look like this:

http://johnminkoff.com/forward.html

They all use the Abadi font. I want to change them all to the Courier font.

If I understand how this works, I should be able to create a stylesheet which will specify a different font,
and if the page head section has code linking it to that stylesheet, the desired font will be displayed on the page.

So far my efforts to accomplish this haven't worked out.

Right now the word
'Abadi" occurs countless times in the code. Changing all that manually in 40 pages is not sounding appealing.

Am I on the right track here? Any tips on coding?

Thanks.

Posted by: Darin McGrew Feb 26 2012, 07:53 PM

QUOTE
Am I on the right track here? Any tips on coding?
Yes, it sounds like you're on track.

Yes, you've scattered <span style="..."> tags all over your markup. Yes, you're going to need to change all that markup on all your pages.

Whether you need to change all that markup on all your pages manually depends on the tools you use. Some editors include tools to make the same changes in multiple places, in multiple files. Some scripting languages can be used to make such changes automatically too.

Whether you make the changes manually or automatically, the key is to do what you can so you don't need make similar changes again if possible. Convert the pages to structural markup, with all the style specified in shared, linked style sheets.

Posted by: johnminkough Feb 26 2012, 11:11 PM

Thanks. Someone reminded me of the old "find-and-replace" technique. Seems like a manageable solution for
the time being.

Do plan to build future pages on more sound principles.

Posted by: Frederiek Feb 27 2012, 02:26 AM

QUOTE
Someone reminded me of the old "find-and-replace" technique. Seems like a manageable solution for
the time being.

Indeed, and it would even be a better solution, if your editor can use that technique on multiple files at once (batch find-replace).

Posted by: pandy Feb 27 2012, 10:07 AM

Actually, it wouldn't be much more work to remove those attributes (and sometimes the tags they are used with) and replace them with classes and IDs so you can use an external style sheet. But if you plan to rewrite the whole site I don't know if I would bother with either. Better start with the rewrite.

P.S. Courier is extremely hard to read on screen, me thinks.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)