Частый гость
Покинул форум
Сообщений всего: 180
Дата рег-ции: Сент. 2012
Откуда: Москва, Россия
Помог: 0 раз(а)
|
Цитата:IllusionMH пишет: Алтенрион, а как фон для body?
либо объясните расположение блоков и куда и как поставить
Вот мой код CSS:
CODE ( css):
скопировать код в буфер обмена
* { margin: 0; padding: 0; } html { height: 100%; } header, nav, section, article, aside, footer { display: block; } body { font: 12px/18px Arial, Tahoma, Verdana, sans-serif; width:100%; height:100%; background: url('/n.gif') no-repeat; background-attachment: fixed; padding-top: 20px; } #foto{ margin-left:-50px; margin-top:0px; } #fotoleft{ width:370px; float:left; border: solid black 0px; } #fotoright{ width:370px; float:left; margin-right:-60px; border: solid black 0px; } .niz{ float:left; border: solid black 0px; width:630px; } .form_vopros{ padding-top:0px; float:left; border:solid black 0px; margin-right:-15px; margin-left:0px; border: solid black 0px; margin-top:5px; } .name_vopros{ margin-top:5px; float:left; margin-left:20px; border:solid black 0px; padding-left:1px; border: solid black 0px; } .button1 { height:29px; padding-left: 3px; padding-right: 3px; float:right; } .button { height:29px; padding-left: 3px; padding-right: 3px; } label{ line-height:19px; } .forms{ padding-top:3px; float:left; border:solid black 0px; margin-right:-15px; margin-left:20px; } .names{ float:left; margin-right:-40px; border:solid black 0px; padding-left:1px; } h1 { font-size: 1.7em; color: #4d4d4d; line-height: 10px; margin: 7px 0px 0px 0px; } h2 { font-size: 1.4em; color: #585858; line-height: 13px; } h3 { font-size: 1em; color: #747474; text-weight: normal; line-height: 1px; } a { color: blue; outline: none; text-decoration: none; } a:hover { text-decoration: none; } p { margin: 10px 20px 0px 5px; font-size: 1.1em; text-indent: 0px; line-height:17px; color: #454545; text-align: justify; } .otstyp_p{ padding-left: 60px; } img { border: none; } .leftimg { float:left; margin: 7px 9px 7px 0; } .rightimg { float: right; margin: 7px 0 7px 7px; } st { font-size:1.3em; font-weight:bold; } .right_italic{ font-style:italic; text-align:right; font-size:1em; } ul { list-style:none; } li a { color: rgba(43, 107, 148, 0.69); font-size: 1.3em; text-decoration:none; padding: 7px 3px; width:150px; /*height:50px; */ display:block; font-weight: normal; line-height:20px; } li a:hover { color: #a1cbec; } #total { width: 960px; height: 900px; position: relative; margin: 0 auto ; background-image: url("img/bg_total2.png"); background-attachment: scroll; background-repeat: no-repeat; } #box{ margin: 0 auto; width: 960px; position:relative; } /* .back { display:block; position:absolute; top:0; left:0; width:960px; height:1108px; z-index:-5; } */ #menu{ /*padding-top: 90px;*/ z-index: 4; } #menu2{ text-align: right; z-index: 4; } #top{ width: 960px; height: 70px; margin: 0 auto; } #top_left{ Width: 150px; height: 55px; float: left; margin-top: 10px; } #top_right{ border: 0px solid black; padding-left: 10px; Width: 790px; height: 70px; float:right; } #logo { height:40px; width: 190px; float:right; margin-top: -5px; border: 0px solid black; margin-right: 190px; } #languages { float: right; height:40px; width: 85px; border: 0px solid black; margin-top: -65px; margin-right: 0px; } #socials { float: right; height:30px; width: 100px; border: 0px solid black; margin-top: 50px; margin-right: -30px; text-align:right; } #socials a{ text-decoration:none; } #center { width: 795px; height: 100%; float: left; margin: 0 auto; } #right { width: 156px; height: 700px; float: right; } #left { border:0px solid black; padding-top: 20px; width: 150px; height: 700px; float: left; text-decoration: none; margin-left: 0px; } #center1 { width: 635px; height: 700px; float: right; padding-left: 0px; /*background-image:url(img/sechenov1.png);*/ background-repeat: no-repeat; background-position: center; background-attachment: fixed; z-index:1; } /* #center1 ul{ padding-left:5px; font-size:12px; font-family:Verdana, Arial, Helvetica, sans-serif; list-style-type:disc; margin-left:20px; list-style:none; } #center1 li{ line-height:17px; background:url(img/3.png) no-repeat; padding-left:30px; padding-bottom:5px; padding-top:0px; font-style:italic; } */ #center2 { width: 635px; height: 100%; float: right; padding-left: 0px; margin-top:40px; border: solid black 1px; background-image:url(img/planshet_mid.png); background-repeat:repeat-y; background-position: center; background-attachment: fixed; z-index:1; } #center1 h2, #center2 h2{ padding-left:30px; font-size: 1.4em } #timeless_s, #future_scientist_s, #young_scientist_s, #scientists_s, #guests_s{ margin-left:0px; margin-right:0px; z-index:1; line-height:20px; text-align:left; float:left; } #gggg{ margin-top:247px; margin-left:0px; border:solid black 0px; margin-left:-162px; } #timeless_s p, #future_scientist_s p, #young_scientist_s p, #scientists_s p, #guests_s p{ margin: 0 0 7px 0px; } #timeless_s h2, #future_scientist_s h2, #young_scientist_s h2, #scientists_s h2{ font-size: 1.4em; padding-left:30px; } #not_rec{ color: rgba(22, 22, 22, 0.54); } #spisok{ float:left; border:solid black 0px; }
Вот мой код php (если требуется, то могу привести код инклюдов, но там просто маленькие блоки которые по css стилям видно) :
CODE ( htmlphp):
скопировать код в буфер обмена
<? require("social.php"); ?> <!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="menu.css" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> <div id="box"> <img class="back" src="img/bg_total2.png" alt="back"> <div id="total"> <?php include("top.php"); ?> <div id="center"> <?php include("left_menu.php"); ?> <div id="center1"> </br><br> <p><br> <h2><center></center>Lorem ipsum dolor sit amet </h2> <br> <img src="img/BRing.png" align="left" class="leftimg"> <br> </p><p> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. <br><br> </p> <br><br> </div> </div> <div id="right"> <? include("right_menu.php"); ?> </div> </div> </div> </body> </html>
Все проблемы не входящие в css были устранены. теперь проблемы только в правильной модификации css.
1) если убрать у body height:100%; то у страниц в которых есть скрол, появится отступ вправо на 2-5 пикселей.
2) применение фона к body не очень приемлимо, так как есть некоторые элементы которые как бы прячутся частично за него,
Суть в том, что этот фон выполнен как некая большая арка, и в осном касается правого , левого и верхнего блоков а в остальном он прозрачен. и находиться он должен не в самом 0 или -1... по z-index...
3) Если есть возможность, то вообще очень желательно сделать полную фиксацию сайта, от скролла, чтобы скролился только блок center1 и скролился под блок top.
Основная структура блоков приведена на изображении. Прикреплено изображение (Нажмите для увеличения)
Отредактировано модератором: Мелкий, 10 Октября, 2012 - 09:16:19
|