-
Имеется шаблон на 1000px, он резинится до 1280px. Поэтому необходимо чтобы два объекта А и B на разрешении 1000px скрывали половину себя за экраном. Соответственно на разрешении свыше 1280px они были бы видны на все 100px. Объект А интегрировался успешно при помощи отрицательного margin-left, а вот правый как не стараюсь вылазит горизонтальная прокрутка.
У объекта А и B position: absolute; width: 100px; height: 50px;
Вопрос, как мне скрыть половина объекта B, чтобы при этом не появлялась горизонтальная полоса прокрутки?
И как вообще позиционировать объект вне экрана без появления полос прокрутки?
[Only registered and activated users can see links. Click Here To Register...]
-
Например так:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-script-type" content="text/javascript" />
<title>Test</title>
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="styles/try.css" />
</head>
<body>
<div id="container">
<div id="left"></div>
<div id="right"></div>
</div>
<div id="center"></div>
</body>
</html>
</div>
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
overflow: auto;
}
body {
min-width: 1000px;
overflow: hidden;
}
#container {
width: 1000px;
margin: 0 auto;
position: relative;
height: 100px;
}
#left {
border: red dotted 1px;
width: 100px;
position: absolute;
left: -50px;
top: 0;
}
#right {
border: red dotted 1px;
width: 100px;
position: absolute;
right: -50px;
top: 0;
}
#center {
border: green dotted 1px;
width: 100px;
margin: 0 auto;
}
</div>
-
Благодарю.
Внедрил вот эту конструкцию, все стало как надо.
Код:
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
overflow: auto;
}
body {
min-width: 1000px;
overflow: hidden;
}