Hi i have the big problem is that all browsers positioning differently.
Each template in the center of the other shows do not represent correctly.
Say When a person opens the site instead of the template.
One side shows less over another.
I did some work at my computer it all works in all browsers.
I do not understand what I was doing wrong the first time for me after all this is so.
I tried the other browsers and fonts and change the screen size.
Does not fix the problem.
Why is this happening for all browsers ?
Also tried to use position: absolute, but nothing works, too.
Maybe you can look at my website and see what you see it correctly or in bad what I am doing wrong and why it works for me correctly using a different position: absolute or relative or all browsers ?
just on the other computers browsers do not show correctly positions
Here is my code can you fix it cuz i didn't understand what where to create div container inside wrap or where ?
html,body{
background-color: #181818;
color: #fff;
height: 100%;
width: 100%;
overflow-x: hidden;
overflow-y: auto;
}
*{
padding: 0;
margin: 0;
}
.wrap{
position:absolute; bottom: -1px; top: 10px;
margin-left: 4%; *margin-left: 5%;
margin-right: 4%; *margin-right: 5%;
}
.time{
color: #fff;
font-size: 8pt;
font-weight:bold;
position:absolute; top: -2px; left: 943px; width: 150px;
position:absolute; *top: 3px; *left: 930px; width: 150px;
}
.top{
width: 1024px;
height: 30px;
padding-left: 20px;
line-height: 25px;
background: #444;
background:transparent url('top.png'); background-repeat: repeat-x;
-webkit-border-top-right-radius: 10px;
-khtml-border-radius-topright: 10px;
-moz-border-radius-topright: 10px;
border-top-right-radius: 10px;
-webkit-border-top-left-radius: 10px;
-khtml-border-radius-topleft: 10px;
-moz-border-radius-topleft: 10px;
border-top-left-radius: 10px;
}
.header{
width: 1044px;
*width: 1024px;
height: 150px;
background: #333;
position:relative; bottom: 10px;
background:transparent url('head.png'); background-repeat: repeat-x;
}
.menu{
width: 1024px;
height: 45px;
background: #474747;
padding-left: 20px;
position:relative; bottom: 11px;
background:transparent url('menu.png'); background-repeat: repeat-x;
}
.list {
position:absolute; left: 20px; top: 1px;
}
.content{
width: 1024px;
height: 1200px;
background: #000;
padding-left: 20px;
background: #111;
position:relative; bottom: 10px;
}
.aprasymas{
position:absolute; top: 10px; width: 350px;
}
.forma{
position:absolute; top: -3px; left: 720px;
position:absolute; *top: 1px; *left: 700px;
background:transparent url('forma.png'); background-repeat: no-repeat;
width: 312px; height: 157px;
}
.imgbox{
position:absolute; top: 10px;
}
.photo{
position:absolute; top: 150px; left: 590px; width: 441px; height:141 *top: 60px; *left: 570px;
background:transparent url('photo.png'); background-repeat: no-repeat;
}
.photo2{
position:absolute; top: 280px; left: 590px; width: 441px; height:141 *top: 60px; *left: 570px;
background:transparent url('photo.png'); background-repeat: no-repeat
}
.photo3{
position:absolute; top: 410px; left: 590px; width: 441px; height:141 *top: 60px; *left: 570px;
background:transparent url('photo.png'); background-repeat: no-repeat;
}
.phototekstas{
position:relative; top: -15px; left: 90px; width: 300px;
position:relative; *top: -16px; *left: 85px; *width: 380px;
color: #fff;
font-size: 10pt;
font-size: *8pt;
padding: 3em;
}
.footer{
width: 1024px;
height: 35px;
background: #333;
padding-left: 20px;
position:relative; bottom: 10px;
background:transparent url('footer.png'); background-repeat: repeat-x;
-webkit-border-bottom-right-radius: 10px;
-khtml-border-radius-bottomright: 10px;
-moz-border-radius-bottomright: 10px;
border-bottom-right-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
-khtml-border-radius-bottomleft: 10px;
-moz-border-radius-bottomleft: 10px;
border-bottom-left-radius: 10px;
}
.copyright{
color: #aaa;
position:absolute; width: 310px; left: 835px; bottom: 12px;
position:absolute; width: 310px; *left: 820px; *bottom: 13px;
font-size: 8pt;
}
#-moz-document url-prefix() {
.copyright {
position:absolute; width: 310px; left: 810px; bottom: 12px;
}
}
#-moz-document url-prefix() {
.phototekstas {
position:relative; top: -18px; left: 90px; width: 300px;
}
}
#-moz-document url-prefix() {
.time {
position:absolute; top: 1px; left: 945px; width: 150px;
}
}
#-moz-document url-prefix() {
.forma {
position:absolute; top: 1px; left: 720px;
}
}
/* will be red only in google chrome */
#media screen and (-webkit-min-device-pixel-ratio:0) {
.time{position:absolute; top: 3px; left: 950px; width: 150px;}
}
/* Opera */
#media not screen and (1) {
.time {
position:absolute; top: -2px; left: 950px; width: 150px;
} /* OP 11 */
}
This is the main what i'm positioning all template without hard work.
.wrap{
position:absolute; bottom: -1px; top: 10px;
margin-left: 4%; *margin-left: 5%;
margin-right: 4%; *margin-right: 5%;
}
Here's my link: http://mrblackscripts.3owl.com/
Create a relatively-positioned "container" div, then set absolutely positioned objects inside of that div.
That will absolutely position the elements on the page. However, it is probably not best-practice.
Related
just practicing with css dropdown. In the following code, the .container div (blue colored one) contains the child dropdown div .dropdown (green colored one, I have disabled this color to avoid confusion). The container div is perfectly horizontally aligned to its above div .content-small (red colored one). Since I want the position and margins of all the div's to be mantained whenever I scale down the browser window, I used left: 41.66%; in percentage so that the container div should stay aligned to its top red div.
The container div stays aligned, but whenever the window is scaled down to lowest size, the container div shifts slightly to the right. PLEASE see the attached screenshot. Why is that?
*{
box-sizing:border-box;
}
html,body {
margin: 0px;
height: 100%;
width: 100%;
left: 0px;
top: 0px;
background-color: rgba(0,0,0,1);
padding: 0px;
}
a {
color: rgba(0,0,0,1);
text-decoration: none;
}
a:hover {
color: rgba(0,0,255,1);
}
.wrapper {
height: 600px;
max-width: 960px;
margin-left: auto;
left: 0px;
top: 0px;
background-color: rgba(204,204,204,1);
margin-right: auto;
position: relative;
padding: 0px;
margin-top: 0px;
}
.content {
position: relative;
box-sizing: border-box;
height: 100%;
max-height: 200px;
max-width: 600px;
background-color: #FFF;
margin-right: auto;
margin-left: auto;
margin-top: 0px;
left: 0px;
right: 0px;
font-size: 32px;
text-align: center;
border: 3px solid rgba(0,0,0,1);
border-radius: 15px 15px 0px 0px;
width: 100%;
}
.content-small {
max-width: 100px;
height: 100%;
max-height: 50px;
background-color: rgba(255,0,0,1);
position: relative;
margin-right: auto;
margin-left: auto;
border: 3px solid rgba(0,0,0,1);
top: 5px;
margin-top: 10px;
}
.content-small:hover + .container, .container:hover{
visibility: visible;
}
.container{
visibility: visible;
height: 100px;
max-width: 100px;
background-color: rgba(204,102,255,1);
position: absolute;
left: 41.66%;
}
.dropdown {
/* [disabled]background-color: rgba(0,255,0,1); */
/* [disabled]border: 3px solid rgba(255,0,0,1); */
width: 100px;
height: 100%;
max-height: 50px;
position: relative;
margin-right: auto;
margin-left: auto;
top: 3px;
}
<div class="wrapper">
<div class="content">
<div class="content-small">Home</div>
<div class="container">
<div class="dropdown"></div>
</div>
</div>
</div>
That's because you're saying left: 41.66%;, which is not an accurate way to center. Instead, use this:
CSS
.container {
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
}
*{
box-sizing:border-box;
}
html,body {
margin: 0px;
height: 100%;
width: 100%;
left: 0px;
top: 0px;
background-color: rgba(0,0,0,1);
padding: 0px;
}
a {
color: rgba(0,0,0,1);
text-decoration: none;
}
a:hover {
color: rgba(0,0,255,1);
}
.wrapper {
height: 600px;
max-width: 960px;
margin-left: auto;
left: 0px;
top: 0px;
background-color: rgba(204,204,204,1);
margin-right: auto;
position: relative;
padding: 0px;
margin-top: 0px;
}
.content {
position: relative;
box-sizing: border-box;
height: 100%;
max-height: 200px;
max-width: 600px;
background-color: #FFF;
margin-right: auto;
margin-left: auto;
margin-top: 0px;
left: 0px;
right: 0px;
font-size: 32px;
text-align: center;
border: 3px solid rgba(0,0,0,1);
border-radius: 15px 15px 0px 0px;
width: 100%;
}
.content-small {
max-width: 100px;
height: 100%;
max-height: 50px;
background-color: rgba(255,0,0,1);
position: relative;
margin-right: auto;
margin-left: auto;
border: 3px solid rgba(0,0,0,1);
top: 5px;
margin-top: 10px;
}
.content-small:hover + .container, .container:hover{
visibility: visible;
}
.container{
visibility: visible;
height: 100px;
max-width: 100px;
background-color: rgba(204,102,255,1);
position: absolute;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
}
.dropdown {
/* [disabled]background-color: rgba(0,255,0,1); */
/* [disabled]border: 3px solid rgba(255,0,0,1); */
width: 100px;
height: 100%;
max-height: 50px;
position: relative;
margin-right: auto;
margin-left: auto;
top: 3px;
}
<div class="wrapper">
<div class="content">
<div class="content-small">Home</div>
<div class="container">
<div class="dropdown"></div>
</div>
</div>
</div>
JSFiddle
I have in my design a fixed head and sidebar and in the content area which is able to scroll I have a 3 column layout.
Now I want the 2 sidebars in my content area scrolling when there is enough content but then when its at bottom then the sidebars should be fixed and only the content in the middle should then scroll.
Here for a better understanding a high quality concept
.
Is this possible without JS and if yes how ?
Thanks for every help :)
body {
background: #e1eae7;
}
.sidebar {
z-index: 100;
position: fixed;
height: 100%;
width: 150px;
background: rgba(47,160,178,1.0);
background-repeat: no-repeat;
background-position: bottom;
padding-top: 40px;
}
.header {
width: 100%;
background: #cf5c41;
background-repeat: repeat;
background-size: 38px 133px;
height: 40px;
background-position: 0px 39px;
box-shadow: 0px 1px 3px;
position: fixed;
z-index: 1000;
}
.content {
position: fixed;
top: 41px;
bottom: 0px;
left: 150px;
right: 0px;
overflow-y: scroll;
padding-bottom: 10px;
}
.one {
width: 22%;
min-width: 150px;
min-height:100px;
float: left;
padding-top: 10px;
background:red;
}
.two {
width: 56%;
min-width: 400px;
min-height:100px;
float: left;
padding-top: 10px;
background:green;
}
.three {
width: 22%;
min-width: 150px;
min-height:100px;
float: left;
padding-top: 10px;
background:orange;
}
.clear {
clear:both;
}
<div class="header"></div>
<div class="sidebar"></div>
<div class="content">
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
<div class="clear"></div>
</div>
If you the remove padding from your three colomns, add a child div to each for padding, give them a height of 100%, an overflow-x of scroll and give content a fixed position, all 3 columns will have a height of 100% and scroll independently.
body {
background: #e1eae7;
}
.sidebar {
z-index: 100;
position: fixed;
height: 100%;
width: 150px;
background: rgba(47,160,178,1.0);
background-repeat: no-repeat;
background-position: bottom;
padding-top: 40px;
}
.header {
width: 100%;
top: 0px;
left 0px;
position: fixed;
background: #cf5c41;
background-repeat: repeat;
background-size: 38px 133px;
height: 40px;
background-position: 0px 39px;
box-shadow: 0px 1px 3px;
position: fixed;
z-index: 1000;
}
.content {
position: fixed;
top: 41px;
bottom: 0px;
left: 150px;
right: 0px;
height:100%;
max-height:100%;
min-height:100px;
}
.one {
width: 22%;
min-width: 150px;
float: left;
background:red;
}
.two {
width: 56%;
min-width: 400px;
min-height:100%;
float: left;
background:green;
}
.three {
width: 22%;
min-width: 150px;
float: left;
background:orange;
}
.column {
height:100%;
max-height:100%;
min-height:100px;
overflow-x: scroll;
}
.column .inner {
padding-top: 10px;
}
.clear {
clear:both;
}
I am trying to place my leftbody and rightbody over top of my MidBody but it doesnt seem to work. I thought placing the Midbody to relative and the left and right bodies to absolute with a z-index would help but it doesnt. So i am clueless right now. Any help would be greatly appreciated.
.Header {
background-color: #CCCCCC;
width: calc(100%-16px);
height: 100px;
border-radius: 5px;
}
.MidBody {
background-color: #141414;
width: calc(100%-16px);
height: 850px;
margin-top: 3px;
border-radius: 5px;
position: relative;
}
.footer {
background-color: #CCCCCC;
width: calc(100%-16px);
height: 50px;
margin-top: 5px;
border-radius: 5px;
}
#leftbody {
background-color: #F1F1F1;
width: calc(50%-16px);
height: 425px;
float: left;
margin-left: 3px;
position: absolute;
z-index: 1;
}
#rightbody {
background-color: #F1F1F1;
width: calc(50%-16px);
height: 425px;
float: right;
position: absolute;
z-index: 1;
}
<div class="Header"></div>
<div class="MidBody">
<div id="leftbody"></div>
<div id="rightbody"></div>
</div>
<div class="footer"></div>
I changed
float:left; -> left:0;
float:right; -> right:0;
and
width:calc(50%-16px); -> width:50%;
Final css :
.Header {
background-color:#CCCCCC;
width: calc(100%-16px);
height: 100px;
border-radius: 5px;
}
.MidBody {
background-color:#141414;
width: calc(100%-16px);
height: 850px;
margin-top:3px;
border-radius: 5px;
position: relative;
}
.footer {
background-color:#CCCCCC;
width:calc(100%-16px);
height: 50px;
margin-top: 5px;
border-radius: 5px;
}
#leftbody {
background-color:#F1F1F1;
width:50%;
height:425px;
left:0;
margin-left: 3px;
position: absolute;
z-index: 9999;
}
#rightbody {
background-color:#F1F1F1;
width:50%;
height:425px;
right:0;
position: absolute;
z-index: 9999;
}
<div class="Header"></div>
<div class="MidBody">
<div id="leftbody"></div>
<div id="rightbody"></div>
</div>
<div class="footer"></div>
Use position: fixed; instead of position: absolute;
I am having problem, aligning the div on 3rd box, Result will be like below.
HTML
<div class="hbox">
<div class="h1"></div>
<div class="h2"></div>
<div class="h3"></div>
</div>
CSS
.hbox
{
float: left;
width: 323px;
height: 188px;
margin: 88px 0 0 5px;
background:url("http://oi59.tinypic.com/96j3g0.jpg") no-repeat;
}
.h1
{float: left;
position: relative;
width:62px;
height:62px;
border-radius:100%;
left: 79px;
top: 24px;
z-index: 2; background:#000;}
http://jsfiddle.net/1mmj24ny/
try pseudo-element :before his code DEMO
.hbox
{
float: left;
width: 323px;
height: 188px;
margin: 88px 0 0 5px;
background:url("http://oi59.tinypic.com/96j3g0.jpg") no-repeat;
position:relative;
}
.hbox:before {
background: none repeat scroll 0 0 #fff;
content: "";
height: 115px;
left: 27px;
position: absolute;
top: 58px;
width: 282px;
z-index: 10;
}
.h1
{float: left;
position: relative;
width:62px;
height:62px;
border-radius:100%;
left: 79px;
top: 24px;
z-index: 2; background:#000;}
.h2
{float: left;
position: relative;
width:62px;
height:62px;
border-radius:100%;
left: 79px;
top: 24px;
z-index: 2; background:#ccc;}
.h3
{float: left;
position: relative;
width:62px;
height:62px;
border-radius:100%;
left: 79px;
top: 24px;
z-index: 2; background:#ff0000;}
Just a quick fix. Add a div with bg white inside .hbox
CSS
.white_div {
position: absolute;
width: 282px;
height: 110px;
background: #fff;
bottom: 17px;
left: 27px;
z-index:100;
}
DEMO
try this
.hbox {
float: left;
width: 323px;
height: 188px;
margin: 88px 0 0 5px;
background: url("http://oi59.tinypic.com/96j3g0.jpg") no-repeat;
position: relative;
}
.hbox:before {
background: none repeat scroll 0 0 #fff;
content: "";
height: 115px;
left: 27px;
position: absolute;
top: 58px;
width: 282px;
z-index: 10;
}
.h1 {
float: left;
position: relative;
width: 62px;
height: 62px;
border-radius: 100%;
left: 79px;
top: 24px;
z-index: 2;
background: #000;
}
.h2 {
float: left;
position: relative;
width: 62px;
height: 62px;
border-radius: 100%;
left: 79px;
top: 24px;
z-index: 2;
background: #ccc;
}
.h3 {
float: left;
position: relative;
width: 62px;
height: 62px;
border-radius: 100%;
left: 79px;
top: 24px;
z-index: 2;
background: #ff0000;
}
<div class="hbox">
<div class="h1"></div>
<div class="h2"></div>
<div class="h3"></div>
</div>
I'm trying to build a menu (see fiddle). I have text box which will be hidden in some cases, shown in some cases, so divs below that should adjust the position when textbox is hidden. The listitems div contains lot of list items. The bottom div should be at the bottom of the screen. maindiv's position should be fixed. Menu area div at the end cannot be removed. Something with the style definition is messed up, I cannot scroll down to the last item. Is there a way to do it without assigning specific height for listitems div?
I'm trying to get something like this. http://tinypic.com/r/1t0sat/6
Any hints or pointers will be helpful. Thanks!
I have tried to update your css according to your requierment. Check it. I hope you find your solution.
#mainDiv {
bottom: 0px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
position: relative;
min-height:100%;
height:auto !important;
z-index: 30;
box-shadow: 5px 5px 5px #888;
background-color: rgb(0, 87, 71);
}
#mainDiv .MainContentArea {
width: 100%;
height: 100%;
height:auto !important;
min-width: 240px;
min-height:100%;
}
#mainDiv .HeadingArea {
left: 0px;
top: 0px;
height: 16px;
right: 0px;
padding-top: 8px;
padding-right: 8px;
padding-bottom: 8px;
padding-left: 8px;
white-space: nowrap;
background-color: rgb(96, 76, 91);
}
#mainDiv .InputArea {
left: 0px;
top: 0px;
height: 30px;
right: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
white-space: nowrap;
}
#mainDiv .SubTitleArea {
left: 0px;
top: 0px;
height: 16px;
right: 0px;
padding-top: 12px;
padding-right: 8px;
padding-bottom: 12px;
padding-left: 8px;
white-space: nowrap;
}
#mainDivSearch input[type='text'] {
width: 220px;
height: 30px;
padding-top: 0px;
padding-right: 22px;
padding-bottom: 0px;
padding-left: 3px;
}
#mainDiv input[type='checkbox'] {
vertical-align: bottom;
}
#mainDiv .ContentArea {
left: 0px;
top: 0px;
height: 100%;
}
#mainDiv .MenuArea {
width:100%;
height: 28px;
text-align: center;
bottom: 0px;
padding-top: 6px;
padding-right: 6px;
padding-bottom: 6px;
padding-left: 6px;
white-space: nowrap;
position: absolute;
background-color: rgb(216, 176, 131);
}
#ContentListArea {
width: 100%;
height: 100%;
}
#ContentListArea .Options2Area {
left: 0px;
top: 0px;
height: 16px;
right: 0px;
padding-bottom: 6px;
margin-top: 10px;
margin-right: 15px;
margin-bottom: 0px;
margin-left: 18px;
vertical-align: top;
border-bottom-color: #afafaf;
border-bottom-width: 1px;
border-bottom-style: solid;
}
#ContentListArea .ListItemsArea {
left: 0px;
top: 32px;
right: 0px;
bottom: 0px;
overflow: auto;
padding-top: 6px;
padding-right: 6px;
padding-bottom: 6px;
padding-left: 18px;
}
.ItemList li {
padding-bottom: 4px;
display: block;
list-style-type: none;
}
.ItemList li .ItemArea {
height: 15px;
}
.ItemList li .ItemDetail {
left: 0px;
top: 0px;
white-space: nowrap;
}
.ItemList li .ItemLabel {
padding-top: 8px;
white-space: nowrap;
}
textarea, select, input[type=text] {
width: 99%;
overflow: auto;
}
body, html
{
height: 100%;
min-height: 100%;
}
Replace this line <div id="mainDiv" style="left: 198px; top: 101px; display: block;"> with <div id="mainDiv" style="left: 198px; display: block;"> and remove <div class="MenuArea"></div>
you need to set height for #ContentListArea .ListItemsArea in the style as below
#ContentListArea .ListItemsArea {
left: 0px;
top: 32px;
right: 0px;
bottom: 0px;
overflow: auto;
padding-top: 6px;
padding-right: 6px;
padding-bottom: 6px;
padding-left: 18px;
position: absolute;
height: 193px;/*change this according to your need*/
}
fiddle demo http://jsfiddle.net/krish/vhFX3/1/
replace your own code fragment with mine in CSS
#ContentListArea .ListItemsArea {
left: 0px;
top: 32px;
right: 0px;
bottom: 0px;
overflow: auto;
padding-top: 6px;
padding-right: 6px;
padding-bottom: 6px;
padding-left: 18px;
//position: absolute;
height: 200px;
}
give it an appropriate height so that it can scroll within that height.