Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I cheated on a small site I was working on and used a site builder (Web Dwarf by Virtual Mechanics) to save time. I didn't realize it at the time, but this builder specifies the width, height and positions using CSS EMs.

Is there an automated tool out there that will read through the CSS and convert each EM to a percentage so it will display correctly on wide screens as well?

Any help would be great! Thanks.


Here is the CSS:

http://pastebin.de/14055

share|improve this question
    
This question should be asked in <a href="stackoverflow.com/">Stack Overflow</a> for better results in case your question was not answered. –  Christopher Feb 14 '11 at 19:30
add comment

2 Answers 2

A CSS em is calculated based on the size of the font you are using, so conversion to some arbitrary percentage value isn't something you can automate. If you wanted you could do some simple percentage calculations of your own by dividing your container element's EM width by the widths of subelements and so-on, but there is no way for an automated tool to do this sort of job.

share|improve this answer
    
I added the CSS code to the post above. Maybe you could look over it and tell me exactly what to do? –  Zac Brown Jan 21 '11 at 2:24
    
Maybe if I saw the full web page somewhere I could help you better. Without HTML code I'm just guessing at what each of the #Oobj IDs contain. As it is, I would divide every width: and left: value by the largest width+left value (which is 98.7 I believe), then multiply that by 100 to calculate percentage. So: left: 82.10em; width: 6.10em becomes left: 83.18%; width: 6.18% Overall though I think this approach will look strange, I'd recommend learning HTML/CSS and going through this yourself to make sure it looks right. –  Just Jake Jan 21 '11 at 6:16
add comment

Try to use this tool. You need to paste your css code and it automatically convert to em, px, % or pt. But be careful, this tool has some limitations.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.