mattia
mattia

Reputation: 621

wordpress take the style of the thme also in the wp admin

I have this code in the style of my theme:

html,body{
 height: 100%;
 background: red;
}

but for a strange reason, when I am in the administration area of wordpress (wp-admin) all the textareas takes this rule. I made a screenshot about this https://i.sstatic.net/DPy4H.png

any idea how I can avoid this? and in general how can avoid that the admin area takes the style of the main site?

Upvotes: 0

Views: 21

Answers (2)

Rajnish Rajput
Rajnish Rajput

Reputation: 495

WordPress Visual editor also have HTML and body So I recommended to avoid using background: red; to your HTML and body tag directly.

But if you want a solution so add this CSS to your theme.

iframe html, iframe html body
        {
            background:#FFFFFF !important;}

Upvotes: 1

Nandu
Nandu

Reputation: 325

The visual editor of wordpress(WYSIWYG) will use the themes css file to display the actual page thats gonna publish. So the solution is to remove the code styling body,html is not at all good practice, Please use styling elements not whole

Upvotes: 0

Related Questions