D
D
Dmitry2014-12-10 10:16:25
Cross browser
Dmitry, 2014-12-10 10:16:25

Is there a separate top property for chrome, mozilla and ie?

There is such code
.view a:hover:after{
content:'';
position:absolute;
background: #fff url(../images/viewbg2.png) no-repeat center center;
top:-1px;
left:87px;
width:42px;
height:70px;
z-index:-1;
}
The problem is that the position of the background differs by 1 pix in chrome from other browsers.
Is it possible somehow to make a separate top property only for chrome ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kolibry1, 2014-12-11
@losttheory

can. on your page (page or index or whatever) you write:
<?php
$chrome = strpos($_SERVER["HTTP_USER_AGENT"], 'Chrome') ? true : false;
?>
is how we define a browser.
and then in php (or html, depending on what the site is on) we make an if condition:

<?php if ($chrome) { ?>
< div class="style_for_chrome">
<?} else {?>
< div class="style_not_for_chrome">
<? } ?>
ваш контент
</div>

Well, accordingly, you write two different styles in css:
.style_for_chrome {}
.style_not_for_chrome {}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question