I try to replace site menu created on flash with simple menu with image and links. I do it with CSS. Background image inserts with CSS value: background: url(/image.png)
, and menu is just list of <a>
tags (with CSS style to display it white and without underline and so on). It works fine on google chrome and IE and looks like this:
Here is header.php code (this is menu block and it's inserted on page with php include_once):
<div id="menu_container">
<div id="menu_top_level">
<a href="ru/about">О компании</a>
<a href="ru/news">Новости</a>
<a href="ru/headhunter">Вакансии</a>
<a href="ru/contacts">Контакты</a>
</div>
<div id="menu_medium_level">
<a href="ru/tariffs">Тарифы</a>
<a href="ru/fleet">Автопарк</a>
<a href="ru/corporate">Корпоративным клиентам</a>
<a href="ru/techs">Технологии</a>
</div>
</div>
Here CSS code:
#header_main {color:white; width:100%; height:76px; background: #000 url(/common/images/menuimage2.png) no-repeat center top;}
#menu_container {width: 1000px; text-align: left; }
#menu_container a {color:white;}
#menu_top_level {font-size: 14px; line-height: 17px;padding-left: 50px; float:left; clear:both;margin-top: 15px;}
#menu_top_level a {text-decoration: none; float:left; margin-right:20px;}
#menu_medium_level {font-weight:bold; font-size: 16px; line-height: 17px;padding-left: 50px; float:left; clear:both;margin-top: 10px;}
#menu_medium_level a {float:left; margin-right:20px;}
CSS connects wiht link in <head>
tag:
<link rel="stylesheet" type="text/css" href="/common/css/style.css" />
Menu block inserts on page with PHP code:
<div align="center">
<div id="header_main">
<?php include_once($_SERVER["DOCUMENT_ROOT"]."/common/tmp/header.php"); ?>
</div>
The problem is that some browsers (firefox, safari on mac) first time display menu incorrect, like this:
(CSS style for <a>
tag and background image did not work). All other parts of page displays with correct style from CSS file.
when user updates page it displays then correctly always.
Also, I can't get this error on firefox on my others machines and when I clear cache.
The question is, how to change code to be sure that it always will work correctly on any browser?