Jump to content
  • 0

CSS только для одного браузера


Ge1i0N
 Share

Question

Почему-то Google Chrome читает код моего сайта немного не так как остальные браузеры.

Как сделать так, чтобы часть CSS воспринимал только он, а остальные браузеры игнорировали?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Может быть подскажите в чём проблема? Может быть я сильно коряво сверстал?

Вот кусок кода который "барахлит"

<!DOCTYPE html>

<head>
<link rel="stylesheet" href="/templates/SporeMachinima/css/template.css" type="text/css" />
</head>

<body>
<header>
<div id="header">
<div id="robocam"></div>
<a href="http://sporemachinima.ru" title="SporeMachinima"><img src="" height="99" width="280" alt="SporeMachinima" class="logo"/></a>
<div class="loginform"><form action="index.php" method="post" name="login" id="form-login">
<div class="login_on">
Добро пожаловать, <span>Ge1i0N</span>! </div>
<div class="login_logout">
<input type="submit" name="Submit" class="button_logout" value="Выйти" />
</div>

<input type="hidden" name="option" value="com_user" />
<input type="hidden" name="task" value="logout" />
<input type="hidden" name="return" value="Lw==" />
<input type="hidden" name="option" value="com_user" />
<input type="hidden" name="task" value="login" />
<input type="hidden" name="return" value="Lw==" />
<input type="hidden" name="e6274da79fa09ca115949b1a671bb38e" value="1" /></form></div>
<nav><ul class="menu"><li class="item2"><a href="http://sporemachinima.ru/"><span>НОВОСТИ</span></a></li><li class="item3"><a href="http://forum.sporemachinima.ru/"><span>ФОРУМ</span></a></li></ul></nav>
</div>
</header>
</body>
</html>

Вот часть css которая нуждается в доработке:

body {
max-width:1007px;
min-width:1007px;
font-size:76%;
font-family:"Verdana","Helvetica",sans-serif;
line-height:1.3;
text-align:left;
margin:0 auto;
background:url(../images/bg.png)#393d3f center repeat-y;
}

/*HEADER BLOCK*/
#header {
height:139px;
width:960px;
margin:0 26px;
overflow:hidden;
background:url(../images/bg_page.png)#e7e7e7;
}
#header, #footer {
border-bottom-left-radius:27px;
border-bottom-right-radius:27px;
-moz-border-radius-bottomleft:27px;
-moz-border-radius-bottomright:27px;
}
#robocam {
height:114px;
width:72px;
position:absolute;
margin-left:27px;
margin-top:11px;
background:url(../images/robocam.png) no-repeat;
}
.logo {
margin-top:15px;
margin-left:90px;
}
.loginform {
float:right;
margin-top:-5px;
}
.loginform li,a{
height:15px;
margin-top:5px;
list-style:none;
padding-top:4px;
padding-bottom:2px;
color:#696969;
text-decoration:none;
font-size:12px;
}
.login_on {color:#696969; padding-right:10px;}
.login_on span {color:#ff713f;}
.login_logout {text-align:center;}
.button_logout {
padding:1px 3px;
background:#c7c7c7;
border:black 1px solid;
}
span .modlgn_username {
height:24px;
width:130px;
border:0;
padding-left:30px;
margin-right:-20px;
color:#7f7f7f;
font-size:11px;
font-family:"Tahoma", "Helvetica", sans-serif;
background:url(../images/form_username.gif)no-repeat 0 0;
}
span .modlgn_username:hover, .modlgn_username:focus {
color:#0177b4;
background:url(../images/form_username.gif)no-repeat 0 100%;
}
span .modlgn_passwd {
height:24px;
width:130px;
border:0;
padding-left:30px;
color:#7f7f7f;
font-size:11px;
font-family:"Tahoma", "Helvetica", sans-serif;
background:url(../images/form_password.gif)no-repeat 0 0;
}
span .modlgn_passwd:hover, .modlgn_passwd:focus {
color:#0177b4;
background:url(../images/form_password.gif)no-repeat 0 100%;
}
li.register {
padding-left:24px;
background:url(../images/button_register.png)no-repeat 0 0;
}
li.register:hover {background:url(../images/button_register.png)no-repeat 0 100%;}
li.forgot_password {
padding-left:20px;
margin-left:145px;
margin-top:-21px;
background:url(../images/button_password.png)no-repeat 0 0;
}
li.forgot_password:hover {background:url(../images/button_password.png)no-repeat 0 100%;}
nav {}
.menu {
position:relative; /*ЭТИ ДВЕ СТРОЧКИ*/
top:117px; /*ВЫЗЫВАЮТ ПРОБЛЕМУ В Chroma*/
float:right;
margin-top:-9px;
margin-right:-14px;
list-style:none;
text-decoration:none;
}
.menu li,.menu ul {
color:#0177b4;
display:inline;
padding-right:40px;
}
.menu a {
font-size:17px;
font-weight:bolder;
font-family:"Tahoma", "Helvetica";
color:#3b3b3b;
}
.menu a:hover {color:#ff713f;}

Воочию проблему можете пронаблюдать на сайте sporemachinima. ru

Edited by Ge1i0N
Link to comment
Share on other sites

  • 0

Это то меню, где написано «Новости» и «Форум». Я сначала открыл страницу в FF4b7 (ну нравится мне бетка Огнелиса) и Chrome и начал сравнивать. Так отображается совершенно одинаково, так только потом я догадался посмотреть в Опере. Вы ведь наверное под ней верстали? Я так и не понял, почему оно в опере так выравнивается, ведь не должно.

Уберите position: relative, тогда начнет правильно отбражаться в FF и Chrome, ну а потом думайте, что с Opera делать.

Да и IE6-8 тоже что-то невнятное показывает. Вам надо добавить скрипт для отображения html5 тегов в IE

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   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.

 Share

  • Обсуждения

    • Актуальные контакты: Telegram: @Nikker_web E-Mail:   tarasevich.email@gmail.com Портфолио https://www.behance.net/d4d4186e Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ    
    • Актуальные контакты: Telegram: @Nikker_web E-Mail:   tarasevich.email@gmail.com   Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ   Портфолио https://www.behance.net/d4d4186e
    • Доброго всем времени суток. Прошу помощи. Научите принципу изменения футера. Движок Xenforo. Версия 2.2.10. Стиль дефолтный. Что именно нужно в итоге на фото примере. Мой шаблон app.footer less имеет следующее значение.  .p-footer { .xf-publicFooter(); a { .xf-publicFooterLink(); } } .p-footer-inner { .m-pageWidth(); .m-pageInset(); padding-top: @xf-paddingMedium; padding-bottom: @xf-paddingLarge; } .p-footer-row { .m-clearFix(); margin-bottom: -@xf-paddingLarge; } .p-footer-row-main { float: left; margin-bottom: @xf-paddingLarge; } .p-footer-row-opposite { float: right; margin-bottom: @xf-paddingLarge; } .p-footer-linkList { .m-listPlain(); .m-clearFix(); > li { float: left; margin-right: .5em; &:last-child { margin-right: 0; } a { padding: 2px 4px; border-radius: @xf-borderRadiusSmall; &:hover { text-decoration: none; background-color: fade(@xf-publicFooterLink--color, 10%); } } } } .p-footer-rssLink { > span { position: relative; top: -1px; display: inline-block; width: 1.44em; height: 1.44em; line-height: 1.44em; text-align: center; font-size: .8em; background-color: #4682B4; border-radius: 2px; } .fa-rss { color: white; } } .p-footer-copyright { margin-top: @xf-elementSpacer; text-align: center; font-size: @xf-fontSizeSmallest; } .p-footer-debug { margin-top: @xf-paddingLarge; text-align: right; font-size: @xf-fontSizeSmallest; .pairs > dt { color: inherit; } } @media (max-width: @xf-responsiveMedium) { .p-footer-row-main, .p-footer-row-opposite { float: none; } .p-footer-copyright { text-align: left; padding: 0 4px; // aligns with other links } }  
    • Нужны сайты с примерами верстки, типа https://css-tricks.com/. Типовые приемы и нестандартные на все случаи жизни. Накидайте ссылок.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy