Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1066325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:59:51+00:00 2026-05-16T19:59:51+00:00

My question is specifically what I’m after, but I’m also interested in ‘general rules’

  • 0

My question is specifically what I’m after, but I’m also interested in ‘general rules’ around how to preserve styles when opening an HTML page in Word. More information on my context follows.

The HTML file being opened in Word has <link ... /> elements including stylesheets. everything displays normally in a browser.

So far I discovered that elements with multiple classes don’t have their styles carried over, nor anything nested, when based on an element with multiple classes.

Consider this:

<p class="class1">This <span class="class1 class2">is my</span> text.</p>

.class1 { color:green; }
.class2 { color:orange; }

.class1.class2 { color:red; }

.class1.class2,
.class1 { color:blue; }

Results in:

  1. p is green because its first declaration holds
  2. p is not blue because that declaration is part of an ‘invalid’ multi-class declaration (!)
  3. span is orange because its first declaration holds
  4. As with point 2. span is not red, nor blue, because of the ‘invalid’ multi-class declarations

As a result of the above findings, I ended up wrapping my elements in another element, always with a single markup class name, and formating things successfully on that basis.

Note that it’s fine to manipulate elements with Javascript, adding/removing extra class names as required, Word is only interested in the actual markup in the HTML file it is trying to parse.

What I didn’t figure out is how to get relatively linked CSS background images to show up when HTML files are opened by Word. I usually use the shortcut: background:transparent url(../img/icon-audio-16.gif) left top no-repeat; which didn’t work (yes, checked my paths), but then neither did a blow-by-blow breakdown:

background-color:transparent;
background-image:url(../img/icon-audio-16.gif);
background-position:left top;
background-repeat:no-repeat;

I asked on SU.com as well, best I got so far was “Because MS Word isn’t a browser? – Nifle”, who pretty much just missed the point.

Yup…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T19:59:51+00:00Added an answer on May 16, 2026 at 7:59 pm

    To any interested parties, this seems to sum everything up: http://msdn.microsoft.com/en-us/library/aa338201(office.12).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.