Arcath Posted October 5, 2009 Posted October 5, 2009 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?
p858snake Posted October 5, 2009 Posted October 5, 2009 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)
webman Posted October 5, 2009 Posted October 5, 2009 The real mistake is copying directly from Word. Copy to Notepad first to remove all formatting, then copy to the web as normal.
Arcath Posted October 5, 2009 Author Posted October 5, 2009 The real mistake is copying directly from Word. Copy to Notepad first to remove all formatting, then copy to the web as normal. yep, it would work even better if instead of typing it in word they typed it into the lovely WYSIWYG editor on the site. 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) i was afraid of that. time for some lovely REGEX in php to remove the styles
webman Posted October 5, 2009 Posted October 5, 2009 @Arcath: Yes, even better if they did that! To get the bare-basics, you might be able to use strip_tags() and then nl2br(). 1
Arcath Posted October 5, 2009 Author Posted October 5, 2009 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now