Всем по привету! Ребята помогите пожалуйста, уже голова трещит никак не могу это исправить! Есть html шаблон : (все по учебнику для чайников) разделил код на две части header.php и main.php, создал index.php с кодом: <? include ("header.php"); ?> <? include ("main.php"); ?> получается вот такая беда(( :
вот header.php: HTML: <!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> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="templatemo_style.css" rel="stylesheet" type="text/css" /> <script language="javascript" type="text/javascript"> function clearText(field) { if (field.defaultValue == field.value) field.value = ''; else if (field.value == '') field.value = field.defaultValue; } </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> </head> <body> <div id="templatemo_header_wrapper"> <div id="templatemo_header"> <div id="site_title"> <a href="#"></a> <span></span> </div> <div class="cleaner"></div> </div> </div> вот main.php: HTML: <div id="templatemo_menu_wrapper"> </div> <div id="templatemo_content_outer_wrapper"> <div id="templatemo_content_inner_wrapper"> <div id="tempatemo_content"> <div class="side_column_w200 margin_right_20"> <div class="section_w170_p15"> <div class="header_02"> Search</div> <form action="#" method="get"> <input type="text" value="Enter keyword here..." name="q" size="10" class="inputfield" title="searchfield" onfocus="clearText(this)" onblur="clearText(this)" /> <input type="submit" name="Search" value="Search" alt="Search" class="submitbutton" title="Search" /> </form> <div class="cleaner"></div> </div> <div class="cleaner"></div> </div> <!-- end of left side column --> <div class="content_column margin_right_20"> </div> <!-- end of content column --> <div class="cleaner"></div> </div><!-- end of content --> </div> <!-- end of inner content wrapper --> </div> <!-- end of outer content wrapper --> <!-- Free Website Templates by www.TemplateMo.com --> </body> </html> --- Добавлено --- вот style.css: часть1 Код (CSS): body { margin: 0; padding: 0; line-height: 1.5em; font-family: Georgia, "Times New Roman", Times, serif; font-size: 12px; color: #000000; background: #ffffff; } a:link, a:visited { color: #004358; text-decoration: none; font-weight: normal;} a:active, a:hover { color: #004358; text-decoration: underline;} p { margin: 0px; padding: 0px; } img { margin: 0px; padding: 0px; border: none; } .cleaner { clear: both; width: 100%; height: 0px; font-size: 0px; } .margin_bottom_10 { clear: both; width: 100%; height: 10px; font-size: 1px; } .margin_bottom_20 { clear: both; width: 100%; height: 20px; font-size: 1px; } .margin_bottom_30 { clear: both; width: 100%; height: 30px; font-size: 1px; } .margin_bottom_40 { clear: both; width: 100%; height: 40px; font-size: 1px; } .margin_bottom_50 { clear: both; width: 100%; height: 50px; font-size: 1px; } .margin_bottom_60 { clear: both; width: 100%; height: 60px; font-size: 1px; } .margin_right_20 { margin-right: 20px; } .margin_right_40 { margin-right: 40px; } .fl { float: left; } .fr { float: right; } .divider { background: url(images/templatemo_divider.jpg) bottom repeat-x; } #templatemo_container { width: 990px; margin: 0 auto; } #templatemo_header_wrapper { width: 1200px; margin: 0 auto; background: url(images/templatemo_header_bg.jpg) center top no-repeat; } #templatemo_header { clear: both; width: 990px; height: 320px; margin: 0 auto; background: url(images/templatemo_header_bg.jpg) center top no-repeat; } #templatemo_header #site_title { float: left; width: 180px; height: 50px; margin: 205px 0 0 75px; padding: 25px 20px 0 20px; font-size: 40px; color: #000000; } #templatemo_header #site_title a{ color: #000000; text-decoration: none; } #templatemo_header #site_title span { display: block; margin-top: 10px; margin-left: 5px; font-size: 12px; } /* menu */ #templatemo_menu_wrapper { clear: both; width: 1200px; height: 50px; margin: 0 auto; background: url(images/templatemo_menu_bg.jpg) top center no-repeat; } #templatemo_menu { width: 957px; height: 50px; padding: 0 0 0 33px; margin: 0 auto; } --- Добавлено --- вот style.css: часть2 Код (CSS): #templatemo_menu ul { margin: 0px; padding: 0px; list-style: none; } #templatemo_menu ul li{ padding: 0px; margin: 0px; display: inline; } #templatemo_menu ul li a{ float: left; display: block; height: 35px; width: 156px; margin-right: 3px; padding-top: 15px; text-align: center; font-size: 14px; text-decoration: none; color: #000000; font-weight: bold; outline: none; } #templatemo_menu li a:hover, #templatemo_menu li .current{ color: #ffffff; } /* end of menu*/ /* content */ #templatemo_content_outer_wrapper { clear: both; width: 1200px; margin: 0 auto; background: url(images/templatemo_content_bg_repeat.jpg) repeat-y; } #templatemo_content_inner_wrapper { width: 1200px; margin: 0 auto; background: url(images/templatemo_content_bg.jpg) top center no-repeat; } #tempatemo_content { width: 900px; padding: 0 45px; margin: 0 auto; background: url(images/templatemo_content_bg.jpg) top center no-repeat; } .side_column_w200 { float: left; width: 200px; padding-top: 80px; } .content_column { position: relative; float: left; width: 400px; padding: 0 30px; padding-top: 80px; background:url(images/templatemo_middle_col_bg.png) repeat-y; } .header_01 { font-size: 20px; color: #004358; font-weight: bold; margin-bottom: 10px; } .header_02 { font-size: 16px; color: #004358; font-weight: bold; padding-bottom: 10px; margin-bottom: 10px; background: url(images/templatemo_divider.jpg) bottom repeat-x; } .header_03 { font-size: 12px; color: #32697a; font-weight: bold; margin-bottom: 5px; } .header_04 { font-size: 12px; color: #000000; font-weight: bold; margin-bottom: 10px; } .header_03 a{ color: #32697a; font-weight: bold; } --- Добавлено --- вот style.css: часть3 Код (CSS): .section_w170_p15 { width: 170px; padding: 0 15px; margin-bottom: 30px; } .side_column_w200 form { margin: 0px; padding: 0px; } .inputfield { height: 16px; width: 160px; padding: 2px 5px; margin: 0 0 10px 0; font-size: 12px; font-variant: normal; line-height: normal; } .submitbutton{ float: right; margin: 0px; padding: 0 6px 3px 6px; cursor: pointer; font-size: 12px; text-align: center; vertical-align: bottom; white-space: pre; } #message_input { background:#FFFFFF none repeat fixed 0 0; border:1px solid #BBBBBB; display:block; height: 80px; margin-top:5px; padding:5px; width: 160px; margin-bottom: 5px; } .side_menu { list-style: none; padding: 0px; margin: 0 0 0 0; } .side_menu li { padding: 0; margin: 5px 0; } .side_menu li a { display: block; color: #ffffff; padding: 2px 10px; background: #999; } .side_menu li a:hover { text-decoration: none; background: #666; } .section_rss_twitter a{ display: block; width: 170px; padding: 20px 0 0 0; font-size: 16px; font-weight: bold; color: #004358; } .section_rss_twitter a:hover { text-decoration: none; } .section_rss_twitter a span { font-size: 12px; margin-top: 5px; display: block; letter-spacing: 5px; } .rss a{ background: url(images/rss_icon.png) right bottom no-repeat; } .twitter a{ background: url(images/twitter_icon.png) right bottom no-repeat; } .news_section { padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid #999; } .post_section { clear: both; padding-bottom: 20px; background: url(images/templatemo_divider.jpg) bottom repeat-x; margin-bottom: 20px; } .post_section p { margin-bottom: 20px; } .post_info { font-size: 14px; margin-bottom: 20px; }
уф - давай разделим =) PHP: <? include ("header.php"); ?> echo "<hr>"; <? include ("main.php"); ?> помотришь где будет пустота - до черты или после - если после надо смотреть 2 файл в самом начале ... и по нему двигать <hr> после какого то дива будет прыгать строка - ее и надо изучать
У тебя в стилях может быть проблема, попробуй везде где есть height:0px добавь min-height:0px; и еще может быть вторая проблема, ты не добавил стили для очистки, то-есть когда ты пишешь свойство float:right; то его нужно еще очищать что бы как раз не было вот этого промежутка. Будут еще вопросы пиши.