Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74846

External stylesheets with ConvertTo-Html not working?

$
0
0

I have a lot of webpages I produce using PowerShell. It would be great to make them all nice and fluffy with some CSS. If I use internal CSS all is good. It would save time and space if there was a central CSS I could use but testing the external style sheet I get no style output at all.

$Style = "<style>

<link rel = 'stylesheet'
    type = 'text/css'
    href = 'myStyle.css' />

</style>
<h2>hello</h2>
<p>hello</p>
"

ConvertTo-Html -Title "Hello" -Body $Style | Out-File test.htm

My style sheet contains

h2 {
    color: #FFFF33;
    text-align: center;
    font: italic 200% fantasy;
}

p {
    color: red;
    text-align: center;
    font: italic 200% fantasy;
}

Is it possible to use external style sheets with the ConverTo-Html cmdlet?


Viewing all articles
Browse latest Browse all 74846

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>