Is there a way to convert CSS to HTML?

J

jstammer

I'm looking for a way to convert CSS to HTML. Our company's intranet is

set up so that it strips the stylesheet out of the code. I'd like to be
able
to use existing web pages that utilize CSS but somehow convert my
stylesheet to inline styles. Is this possible?

Thank you,
Jodi
 
J

Jonathan N. Little

jstammer said:
I'm looking for a way to convert CSS to HTML. Our company's intranet is
set up so that it strips the stylesheet out of the code. I'd like to be

This makes no sense. Who's code? You mean when viewing a *public* web
site on the Internet? You can set you browser to *override* the defined
stylesheet but it does not remove or change the markup.
able
to use existing web pages that utilize CSS but somehow convert my
stylesheet to inline styles. Is this possible?

Why? You still using CSS, but that you now bloat the markup with
repetitive instances of the style properties as attributes!

Once in style sheet
P { text-indent: 1em; font-family: arial, hevetica, sans-serif; }

*vs*

<p style="text-indent: 1em; font-family: arial, hevetica, sans-serif;">
Lorem ipsum dolor sit amet...
</p>

<p style="text-indent: 1em; font-family: arial, hevetica, sans-serif;">
Suspendisse potenti. Suspendisse ...
</p>

<p style="text-indent: 1em; font-family: arial, hevetica, sans-serif;">
Pellentesque eros purus, consequat ...
</p>

<p style="text-indent: 1em; font-family: arial, hevetica, sans-serif;">
Duis dapibus, dolor eget scelerisque ...
</p>

<p style="text-indent: 1em; font-family: arial, hevetica, sans-serif;">
Suspendisse egestas tempor erat. Duis ...
</p>

<p style="text-indent: 1em; font-family: arial, hevetica, sans-serif;">
Morbi mollis. Quisque sollicitudin, ...
</p>

Make no sense!
 
H

Harlan Messinger

jstammer said:
I'm looking for a way to convert CSS to HTML. Our company's intranet is

set up so that it strips the stylesheet out of the code. I'd like to be
able
to use existing web pages that utilize CSS but somehow convert my
stylesheet to inline styles. Is this possible?

Put it into separate .css files and use <link> tags to reference them.
 
J

jstammer

Harlan said:
Put it into separate .css files and use <link> tags to reference them.

Unfortunately, it won't allow me to do that either.

Sorry if it doesn't make sense, It's hard to explain. It's a giant
intranet where I have editing rights to only specific sections. The way
this web-based editing application is set up is it only takes straight
HTML and when you hit "save" it tells you that it will strip out
anything else if you even try. Any links, even to images have to be put
in separately.

I know it would be bloated and I don't want to do it this way, which is
why I use CSS. It will work if I code it with styles within the tags.
Yes, it sucks, but that's what I have to deal with and why I would like
to be able to convert it.

Any other ideas? I read that an older version of Dreamweaver maybe
could convert it. Are there any other tools?

Thank you for your help.
 
D

dorayme

"jstammer said:
Unfortunately, it won't allow me to do that either.

Sorry if it doesn't make sense, It's hard to explain. It's a giant
intranet where I have editing rights to only specific sections. The way
this web-based editing application is set up is it only takes straight
HTML and when you hit "save" it tells you that it will strip out
anything else if you even try. Any links, even to images have to be put
in separately.

I know it would be bloated and I don't want to do it this way, which is
why I use CSS. It will work if I code it with styles within the tags.
Yes, it sucks, but that's what I have to deal with and why I would like
to be able to convert it.

Gosh what a bore if it is a lot of pages... but nevertheless, you
may have to bite the bullet. First what are we talking about? How
many pages? How complex is the css? Here is what you can do, I
give just one example, you can apply it to other css you have.

Get a good text editor with good Search and Replace multiple
pages facilities. You copy the css for say, body, from your CSS
sheet. You then get your S & R function out in the text editor
and put <body> in the first field. You then say to replace all
instances of this with <body style="....">, you paste the copy
for the ..... Might not take too long? It is not as if you have
to work on individual pages.

All this depends on stuff though. How uniform is the site? How
clean is the html in the first place and on and on.

Just some thoughts for you.
 
J

Jonathan N. Little

jstammer said:
Unfortunately, it won't allow me to do that either.

Sorry if it doesn't make sense, It's hard to explain. It's a giant
intranet where I have editing rights to only specific sections. The way
this web-based editing application is set up is it only takes straight
HTML and when you hit "save" it tells you that it will strip out
anything else if you even try. Any links, even to images have to be put
in separately.

So this is an intranet server, so when you say "only specific sections"
on the actual HTML page (link only with the body) because you use some
sort of web frontend like those "MySpace". If so that sucks. Bribe your
sysops with Doritos to allow you to FTP||SSH your files to the server.

If you have access to the HEAD portion of the HTML page then put style
within STYLE element

<head>

....

<style type="text/css">
P { text-indent: 3em; color: #ff0; background-color: #ffd; }
....
</style>
</head>
I know it would be bloated and I don't want to do it this way, which is
why I use CSS. It will work if I code it with styles within the tags.
Yes, it sucks, but that's what I have to deal with and why I would like
to be able to convert it.

Any other ideas? I read that an older version of Dreamweaver maybe
could convert it. Are there any other tools?

Where are you getting this source that you need to convert?
 
R

rf

jstammer said:
Sorry if it doesn't make sense, It's hard to explain. It's a giant
intranet where I have editing rights to only specific sections. The way
this web-based editing application is set up is it only takes straight
HTML and when you hit "save" it tells you that it will strip out
anything else if you even try. Any links, even to images have to be put
in separately.

Carpenter: Right, you want me to build a wall over there? I'll just go get
my hammer and a few nails.
Company: Hang on a bit, we don't allow hammers to be used round here. You'll
have to use this rock.
Any other ideas?

Run. Very very fast.
 
Joined
Dec 14, 2007
Messages
1
Reaction score
0
There are very valid reasons to convert CSS to HTML

Actually there are good reasons for a utility to convert a CSS document to HTML.

I just did a google search on this after copying and pasting a recipe from a fancy web page produced ordinary text in Outlook.

I began to realise that all the good CSS implemented in the page is useful for advanced browers and is of benefit to the website developer and produces great results.

However when one wants to take an extract from this document and paste it into email clients and other applications that do not handle CSS but do handle straight HTML rendering, then we have a major problem.

This problem did not exist prior to CSS, but it does exist now because it seems only browsers handle CSS but other important applications do not have anything more than a straight HTML renderer built into them.

I therefore would consider it very useful for the browser developers (Firefox, IE, Opera etc) to provide a user menu function to save the document as straight HTML without CSS. This document could then be used in other non-CSS authoring applications such as Outllook.

CSS is good, but its put all the style in CSS headers which are not recognised by legacy/current applications, leaving them to display essentially drab style-less content.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top