Web Development Thread, Force a font in Coding and Web Development; is it possible to force a font down through all styles?
im having a problem where font declerations from word ...
5th October 2009, 12:28 PM #1
Force a font
is it possible to force a font down through all styles?
im having a problem where font declerations from word are being passed into a schools website. and i know that if i spend my afternoon fishing out all the style declerations from the page sources it will be fine untill they copy another word doc in and i have this problem all over again. so is it possible to force a style to go down all the levels and over ride any stlyes declared on the fly?
5th October 2009, 12:36 PM #2
nope, its the way css ordering works, for example spans and such will over ride whatever is applied before. unless you possibly try the add the css link/import at the end of the document.... (i haven't tried that so it might not work)
5th October 2009, 12:39 PM #3
The real mistake is copying directly from Word. Copy to Notepad first to remove all formatting, then copy to the web as normal.
5th October 2009, 12:48 PM #4
yep, it would work even better if instead of typing it in word they typed it into the lovely WYSIWYG editor on the site.
Originally Posted by webman
i was afraid of that.
Originally Posted by p858snake
time for some lovely REGEX in php to remove the styles
5th October 2009, 12:50 PM #5
@Arcath: Yes, even better if they did that!
To get the bare-basics, you might be able to use strip_tags() and then nl2br().
Thanks to webman from:
Arcath (5th October 2009)
5th October 2009, 02:07 PM #6
Thanks, been looking into it, word seems to use every method of deinining styles known to man, and the source is a nasty thing. I can strip out the word c**p but then alignment etc... bear no ressemblent to what it looks like in the editor (cause that still has word formatting).
im just gonna have to go through all the pages one at a time and fix the formatting and then put a big thing above the editor about pasting from word
By mossj in forum Graphics Requests
Last Post: 4th July 2009, 11:42 PM
By Pashers in forum Coding
Last Post: 4th February 2009, 03:36 PM
By RabbieBurns in forum How do you do....it?
Last Post: 5th December 2008, 09:38 AM
By maniac in forum General Chat
Last Post: 19th December 2007, 02:09 PM
By WithoutMotive in forum General Chat
Last Post: 25th May 2007, 12:31 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)