OK so I'm creating my first page and hit a brick wall here. I have a side navigation bar, main top navigation bar with containers below that for content. My problem is that the navigation bar on the left (seems) depicts the position of the carosel viewer container below the thre mini containers below the top navigation bar. EG The central containers begin at the lowest point of the navigation bar on the left.
See Images:
I'm trying to place the blue image carousel container directly below the three central mini containers but the highest up the page it will place itself is the bottom most point of the left side navigation bar. I'm very new to web page design this is not my thing and would like some help here.
I have copied the code into JS BIn for you to take a look at, I also notice there that the three mini contatiners below the top navigation bar are longer than my web page view so maybe it's those that are causing the problem and not the side nav bar??
JSBin link:
http://jsbin.com/dimekupo/1/watch?html,css,js,output
http://jsbin.com/dimekupo/1/edit?html,css,js,output
Many thanks
I wasn't able to get your code example to work for some reason but I but together a simpl example. This looks like a problem with floating. If you add float:left to your sidebar's CSS and float:right to the CSS of the carousel and the main content container that weird spacing should disappear.
Here's an example of what I'm talking about.
http://jsfiddle.net/7QzAu/3/
CSS
body {
width:900px;
margin:0 auto;
font:26pt Georgia;
color:#fff;
text-align:center;
}
#sidebar {
float:left;
width:200px;
height:400px;
background:Red;
}
#content {
width:700px;
float:right;
height:350px;
background:blue;
}
#below {
float:right;
width:700px;
height:200px;
background:green;
}
HTML
<div id="sidebar"></div>
<div id="content"></div>
<div id="below"></div>
Related
I have a menu that slides in from offscreen. There's no horizontal scrollbar showing, but you can still slide the screen manually (in IE and Chrome, not Firefox) and see the offscreen div in the horizontal overflow. Obviously, I really want it hidden.
A simple example (without the javascript to make the offscreen div slide in) can be seen at https://jsfiddle.net/7g0x96hs/ and below:
<div id="maintext">I'd like the footer to display below, but the offscreen div to the left to not be visible by scrolling.</div>
<div id="footer"></div>
<div id="offscreen"></div>
body{
overflow-x:hidden;
}
#footer{
position:absolute;
top:1000px;
width:100%;
height:10px;
background-color:#000000;
}
#offscreen{
position:absolute;
width:100%;
height:100%;
z-index:1200;
background-color:#000000;
right:-100%;
top:0;
}
How can I ensure the user cannot manually move the page horizontally? overflow-x:hidden on the body (or a wrapper div) doesn't work... Seems to be the vertical scroll that's causing the problem.
Thanks!
I am having a problem regarding some layout design tasks. Actually I want to achieve a certain layout design, but since I don't quite understand the position property of CSS, it's a bit difficult for me to do this. Here's the link to what i am actually trying to do.
I want an area or container whose position will be fixed as designed in above mention linked. In this web layout design, the left side of the web page is position: fixed: it's not moving and when i scroll the right side of the page it is scrolling down. So i need the same functioning for my web page.
(Sorry for my bad English i am little bit passive at it)
For that you use the position:fixed attribute in your CSS.
You would make a sidebar that does not scroll like this:
HTML
<body>
<div id="sidebar">
This is fixed to the side of the page!
</div>
<div id="main">This Scrolls!</div>
</body>
CSS
#sidebar{
position:fixed;
top:0px;
left:0px;
width:400px;
height:100%;
background:red;
}
#main{
width:100%;
height:100%;
background:lightblue;
text-align:center;
}
EXAMPLE
I am currently working on a website design using the 960 grid system and came across a small snag in the final moments of the design.
Ultimately, I just want to set my header and footer bars to be 'fixed' on the page, so that they will remain stationary even when the rest of the page is scrolling. Here is a great example of a fixed navigation bar.
http://ryanscherf.net/
Mine wont be vertical, but you get the point.
The problem that I am coming across is that the header works perfectly, and exactly the way I suspect it will. Here is the HTML for my header
<div id="header">
<p>
ATS Logo
</p>
</div><!--end header-->
and the css to make it stretch and fix the position
#header
{
background:grey;
width:100%;
height:65px;
position:fixed
/*padding:15px;*/
}
This solution works exactly the way i want it too. However, when i apply the same exact settings to the footer, it causes undesired results.
Here is a fiddle to show what I mean. You will have to uncomment the 'position:fixed' line for the footer to see what i mean.
http://jsfiddle.net/s4cWP/
and full screen
http://jsfiddle.net/s4cWP/embedded/result/
Its worth noting that in addition to using my own css (located at the top of the jsFiddle!) i am using the 960 reset grid and 960 12 column style sheet.
I would really appreciate a push in the right direction. Is there something im not accounting for here?
Thanks!
I'm assuming you want the footer to always appear like the header: JSFiddle.
New #footer:
#footer
{
background:grey;
width:100%;
position:fixed;
bottom:0;
left:0;
}
Also, due to overlapping, I added padding to the bottom of the #container:
#container
{
padding-top:75px;
padding-bottom:30px;
}
On my companys website http://www.ensorbuilding.com , the middle content always overlaps the left menu, sometimes the right menu overlaps the other two.
The code looks like this
<aside id="left_menu"></aside>
<section id="content"></section>
<aside id="right_menu"></aside>
I have used many javascript auto height fixes but none of them seem to have worked?
Can anybody shed some light into this?
Thankyou!
Haven't seen your code but if I made it, I would affect to the three parts (both menus and content) a fixed width.
For instance in CSS:
#left_menu{
float:left;
width:200px
}
#right_menu{
float:left;
width:200px
}
#content{
float:left;
width:600px
}
Elements' height does not matter for your issue.
I am making a web project http://conatus.in/alumniconnect/index.php?page=about
I need to have a floating right sidebar, to accommodate different panels for facebook, news etc.
However, the right sidebar is not working properly. Right sidebar's div id is "sidebarright". CSS is
#sidebarright {
float:right;
}
The contents are posted just above the main panel (<div id="content">)
Left sidebar <div id="sidebar"> with following css is working good.
#sidebar {
float:left;
width:250px;
}
I tried several combinations using firebug and dragonfly, but just cant make the right sidebar to properly float.
Use position:fixed; That makes your sidebar float when you scroll too.
I finally used
#sidebarright {
float:right;
}
When I added more content on the right div it float:right started working...