Posted by Michael J. Hudson on November 19, 2004, 7:28 am
Please log in for more thread options
I'm not sure what good attaching a stylesheet to a Microsoft Word
document does. When you save the document as an HTML file, Word
throws in all of its style and font settings into the HTML file AND
these settings override the same properties you may have specified in
your stylesheet. So, what good is it to attach a stylesheet????
I've only found one way to overcome this problem. You can append each
of the characteristics in your stylesheet with the keyword
"!important" and that will override whatever styles Word put into the
HTML document. For instance:
P { font-size: 18pt ! important }
You can also write a script to parse out the style settings from the
beginning of the document, but that just seems like more than you
should have to do to get this to work!
Anyway, just wanted to pass on the "!important" keyword solution...
since it took me a while to figure it out for myself.
-Michael
Posted by Mark Tranchant on November 19, 2004, 3:57 pm
Please log in for more thread options
Michael J. Hudson wrote:
> When you save the document as an HTML file, Word
Don't do it, then. Word doesn't generate HTML. What comes out may look
similar, and IE might have a reasonable go at rendering it, but Word is
far worse even than Frontpage at creating HTML.
--
Mark.
http://tranchant.plus.com/
Posted by Brian on November 19, 2004, 8:58 pm
Please log in for more thread options
Mark Tranchant wrote:
> Word doesn't generate HTML. What comes out may look
> similar, and IE might have a reasonable go at rendering it,
Don't be too sure. A friend once loaded his cv in Word, and saved as
HTML. The result could be viewed in Mozilla, but MSIE/Win choked on it,
displaying raw code in several sections. That one gave me a good chuckle.
--
Brian (remove "invalid" to email me)
Posted by Lachlan Hunt on November 19, 2004, 4:22 pm
Please log in for more thread options
Michael J. Hudson wrote:
> I'm not sure what good attaching a stylesheet to a Microsoft Word
> document does.
I'm not sure what good creating HTML document in Word does. When you
save the document in
> When you save the document as an HTML file, Word...
only ever writes invalid code. It can be helped if you choose Filtered
HTML, and then ignore the stupid warning message about losing MSWord
specific formatting (obviously intended to stop an average user from
producing code that is even close to valid).
It takes a little effort to clean up afterwards, but IIRC, there's only
about a dozen or so errors with Word's Filtered HTML, compared with
several hundred from the non-filtered crap with. It's the only editor
worse than FrontPage, but FrontPage isn't much better.
> I've only found one way to overcome this problem...
is to not use Word for creating HTML documents.
> Anyway, just wanted to pass on the "!important" keyword solution...
Thanks, but I prefer to use the advice I gave above.
--
Lachlan Hunt
http://lachy.id.au/ http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web