Malik
Новичок
НЕМНОГО УПРОСТИЛ ПЕРВОНАЧАЛЬНУЮ ВЕРСИЮ!!
HTML:
CSS:
Я решил занести блок с классом top_content в отдельный файл (top_content.php ) с помощью include
И вот что получилось
HTML:
CSS: такой же как и в первом случае
top_content.php:
И после этого над блоком top_content появляется какой то зазор.
Объясните пожалуйста откуда он взялся и как от него избавиться!
И еще в коде перед блоком top_content появляются кавычки !
Посмотрите вложенные изображения
HTML:
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Документ без названия</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="in_body">
<style type="text/css">
.top_content{
border-top:3px solid #666;
border-bottom:3px solid #666;
background-image:url(img/structure/0001.gif);
height:40px;
width:1000px;}
.top_content td{
text-shadow: 2px 2px 2px black;
color:#999;
font-family: Verdana, Geneva, sans-serif;
font-weight: bold;
font-size:14px;
margin:0;
border-left:1px solid #666;
border-right:1px solid #000;
}
.top_content td:first-child{
border-left:none;
}
.menu_block{
font-family:Arial,sans-serif;
text-align:center;
padding:12px;
height:16px;}
.menu_block:hover{
box-shadow: 0 0 10px rgba(0,0,0,0.5) inset;
color:#CCC;}
</style>
<div class="top_content">
<table width="500" height="40" border="0" cellpadding="none" cellspacing="none" align="right">
<tr>
<td></td>
<td><a href=''><div class='menu_block'>Главная</div></a></td>
<td><a href=''><div class='menu_block'>Текст</div></a></td>
<td><a href=''><div class='menu_block'>Природа</div></a></td>
<td><a href=''><div class='menu_block'>Телепорт</div></a></td>
<td><a href=''><div class='menu_block'>Портал</div></a></td>
<td><a href=''><div class='menu_block'>Контакты</div></a></td>
</tr>
</table>
</div>
<div class="content">
<table width="1000" border="0" cellpadding="none" cellspacing="none">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</div>
</body>
</html>
PHP:
/* CSS Document */
body{
margin:0;
padding:0;
}
table{
border-spacing:0;}
a{
text-decoration:none;
color:inherit;}
.in_body{
margin-top:0;
width:1000px;
margin:auto;
}
.content{
}
И вот что получилось
HTML:
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Документ без названия</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="in_body">
<? include 'blocks/top_content.html';?>
<div class="content">
<table width="1000" border="0" cellpadding="none" cellspacing="none">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</div>
</body>
</html>
top_content.php:
PHP:
<style type="text/css">
.top_content{
border-top:3px solid #666;
border-bottom:3px solid #666;
background-image:url(img/structure/0001.gif);
height:40px;
width:1000px;}
.top_content td{
text-shadow: 2px 2px 2px black;
color:#999;
font-family: Verdana, Geneva, sans-serif;
font-weight: bold;
font-size:14px;
margin:0;
border-left:1px solid #666;
border-right:1px solid #000;
}
.top_content td:first-child{
border-left:none;
}
.menu_block{
font-family:Arial,sans-serif;
text-align:center;
padding:12px;
height:16px;}
.menu_block:hover{
box-shadow: 0 0 10px rgba(0,0,0,0.5) inset;
color:#CCC;}
</style>
<div class="top_content">
<table width="500" height="40" border="0" cellpadding="none" cellspacing="none" align="right">
<tr>
<td></td>
<td><a href=''><div class='menu_block'>Главная</div></a></td>
<td><a href=''><div class='menu_block'>Текст</div></a></td>
<td><a href=''><div class='menu_block'>Природа</div></a></td>
<td><a href=''><div class='menu_block'>Телепорт</div></a></td>
<td><a href=''><div class='menu_block'>Портал</div></a></td>
<td><a href=''><div class='menu_block'>Контакты</div></a></td>
</tr>
</table>
</div>

И еще в коде перед блоком top_content появляются кавычки !

Посмотрите вложенные изображения