Jump to content

Recommended Posts

Posted

Hi,

I need to set a css class if the user browser is Internet Explorer.

I tried to use the CustomCSS property, as follows:

<!--[if IE]>
 .x-mb-fa-lock {
   margin-top: 2px;
 }
<![endif]-->

Works ok in IE versions below 10, because the version 10 and 11, no longer support the conditional <! - [if IE]>

Does anyone have an idea or workaround to indicate a CSS class to be used only when IE?

 

Thanks,

 

Cristiano

Posted

Hi,

 

Can you try this?!:

 

UniMainModule ->

uses ... uniGUIClasses, uniGUITypes;
procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject);
begin
  if UniSession.IsIE then
    UniAddCSSLibrary('files/yourCSSFile.css', False, [upoPlatformDesktop]);
end;

Best regards.

Posted

 Hi Delphi Developer!

 

 I too found other possible solution below as sample, but your solution is better, thanks!

 

 CustomCSS property:

 

 /*IE9, IE10 e IE11*/

 @media screen and (min-width:0\0) {                                   
    .x-mb-fa-lock {
      margin-top: 2px;
    }  
  }
 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...