0

I have a page which uses a css file which has

html 
{
 width:100%;
}

However when that page in Iframe - it causes x-scroll.

enter image description here

But - If I remove the width attribute ( via chrome developer toolbar) OR set an invalid value like '' - it's getting fine :

enter image description here

Question :

Is it Ok to do this : ( in order to reset the value)

<head  >
      /*The original css file - I dont want to touch it*/
       <link href="<%= ResolveUrl("~/Css/style.css") %>" rel="stylesheet" type="text/css" />

    <style type="text/css">
    html
    {
        width: '' !important;
    }
    </style>

p.s.

No js solutions please.

2
  • 1
    set margin and padding as 0 Commented Dec 26, 2013 at 14:04
  • @Pranavc not working. i.sstatic.net/MCunf.png Commented Dec 26, 2013 at 14:09

1 Answer 1

2

In order to reset that value you have to use the default one for width:

html
{
    width:auto;
}

Also is not necessary to use the !important declaration.

Sign up to request clarification or add additional context in comments.

2 Comments

Regarding your second line , you said it becuase it comes "after" the original declaration( so it will win) ...right?
@RoyiNamir Is correct if the other style is called by a CSS file or comes "before" this one isn't necessary the important

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.