Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Question about CSS in Internet Explorer

I have an idea that I imagine is possible to make.

In a CSS file I need to put:

height: 50px;

If the browser is Internet Explorer, and

height: 45px;

if the browser is Chrome or Firefox.

How can I do this?

like image 858
anvd Avatar asked Dec 22 '22 16:12

anvd


1 Answers

A special tag can be use as below:

<style type="text/css" media="screen">
   .yourTag { weight: 45px; }
   /*Normal browsers*/
</style>

<!--[if IE]>
<style type="text/css" media="screen">
   /*IE*/
   .yourTag { weight: 50px; }
</style>
<![endif]-->

NB: IE understands element's weight with borders, when other browsers don't.

like image 64
enguerran Avatar answered Jan 17 '23 08:01

enguerran