Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change body background color in an iframe using one css file

Tags:

html

css

iframe

Using a iframe where I call a site from my webspace, Using one css file with body {background-color: #222}.

The iframe src also use this CSS file. The Problem is that the body in the iframe need another background-colour.

tried

iframe>body { background-color: #other }

Any idea or suggestions?

like image 630
Denny Mueller Avatar asked Apr 24 '12 13:04

Denny Mueller


1 Answers

I assume the iframe takes up a smaller portion of your site. In that case I would advice you to simply use a div with the same size of the iframe is loaded, and giving this div the proper background-color.

OR: include a style property in the source of the iframe page:

<head>
    <style>body {background-color:#COLOR}</style>
</head>
like image 160
Daan Twice Avatar answered Sep 21 '22 15:09

Daan Twice