473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Dealing with overriding styles with stylesheets in Microsoft Word

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
Jul 23 '05 #1
3 2561
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/
Jul 23 '05 #2
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
Jul 23 '05 #3
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)
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tristan Miller | last post by:
Greetings. Can someone point me to a good source of nice, simple stylesheets, similar to the W3C Core Styles provided at http://www.w3.org/StyleSheets/Core/? I don't need anything fancy like...
2
by: Anna | last post by:
Hi all. I want to create a noframes version of a certain page (not written by me), that has three frames, each loading a page with few external stylesheets. If I copy the content of each...
0
by: Ian | last post by:
I've got this problem with overriding attributes on an inheritance chain where the XmlSerializer is concerned. For example: public class A { private string aWord = String.Empty(); public...
2
by: Logan | last post by:
Can the subject be done, or is setting of styles via styles sheets limited only to classic html controls? Quite obviously i am new to asp.net. thank you all.
10
by: Robert Jacobson | last post by:
Hi, I'm develing a COM add-in for Microsoft Word XP that displays a form. I'd like to have the form display using the Windows XP theme. However, neither using a manifest nor calling...
2
by: Randall Arnold | last post by:
I've written an app in VB.NET 2005 Beta that monitors temperature of several devices. I am using the ProgressBar for visual indication of temperature; all readings in expected range cause the bar...
1
by: Eric Lindsay | last post by:
I am trying to understand the differences between and uses of persistent, default and alternate styles. I have read http://www.w3.org/TR/REC-html40/present/styles.html section 14.3.2 on...
3
by: spolsky | last post by:
hi, it is possible to apply multiple styles as shown in the following example. <STYLE TYPE="text/css"><!-- BODY { background-color:salmon; } P { margin-left:20px; } .clsCode {...
3
by: A Baffled User | last post by:
I read everywhere on Microsoft forums that Styles are preferable to manual formatting. Am I understanding this correctly? When I want to change a patch of text from roman to italic, for example,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.