4

I'm building a login window using javascript (JQuery) which complies to very strict design guidelines; it exhaustively uses CSS-floats in order to position the screen elements. This javascript is hosted from a central location and implemented by ~1000 websites. It works very well, but there are some websites that have in their stylesheet something like this:

 img, div, input { 
       behavior: url("_include/website/js/iepngfix.htc") 
   } 

Problem is that such CSS-definitions disturbs the layout of my login window.

My javascript + css are loaded last. Is there a way I can tell in my Javascript / CSS to ignore all styles that have been loaded previously.

2
  • 1
    you can try !important on the CSS you want to try and force. Commented Nov 10, 2010 at 10:16
  • Usage of !important and fcalderan's works. Thx! Commented Nov 10, 2010 at 14:10

2 Answers 2

2

Let's suppose your window has a container class e.g. mylogin then you could try to add in queue the following css

.mylogin img,
.mylogin div,
.mylogin input {
   behavior : url(data:null);
}
Sign up to request clarification or add additional context in comments.

Comments

0

Method 1

Override styles defined in previous style sheets using !important property.

Method 2

If you are using jQuery in your code then you can clear these attributes on init() function. This will add advantage as you can still assign CSS attributes to tags in your CSS files.

$('img').css('padding', '0px');

Note: You might try using iframe for login page code. I haven't tried this but, I guess this might work.

Comments

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.