Like the title says, I would like to implement a Trello-clone as an exercise in using Bootstrap. I want to have the top menu remain constant, where as the boards (columns) scroll along the X-axis.
I have tried using something like this, where the container has all within it.
body{
overflow: hidden;
}
#board-container{
width: 100rem; // Wider than the viewport
overflow-x: scroll;
}
.board{
width: 40rem;
float: left;
}
But this isn't working.
How can I go about doing something like this? Can I do it with just HTML, and preferably with Bootstrap?
Related
I'm currently trying to create a horizontal card row for my website. The cards have a little transition where they lightly rotate and raise on hover, like so:
I want to make the row scrollable on the horizontal axis to make it responsive, but after setting overflow-x: auto; on the container, I noticed that the cards now get clipped, making the hover effect look pretty bad.
I've tried setting overflow-y: visible; on the container but it has no effect. Is there any way I can keep my cards from clipping but still leave the container scrollable?? Thanks in advance for your help.
You should wrap the elements in 2 divs. The first and inner will have a width(for horizontal scroll) that is greater than the viewport. And the second and outer div, will have a width, that is exactly the same as the viewport. The second div will then have the property overflow-x: scroll; overflow-y: hidden and it should work.
Example:
body {
width: 100vw;
height: 100vh;
}
outer-wrapper {
width: 100vw;
height: max-content;
overflow-x: scroll;
overflow-y: hidden;
}
inner-wrapper {
width: 150vw;
height: 100px;
display: flex;
}
cards {
// what ever properties you want
}
My website works on a 15 inch laptop, but whenever I resize the browser, some of the information on my website 'disappears', as I am unable to scroll (scrollbar won't appear).
I'm experiencing this problem for two of my websites (they're part of a school project).
On the first website, the sticky footer covers the content when the website is being viewed in a smaller browser window. I managed to get a scrollbar for the container part (everything except for the header and footer), but I need the scrollbar to appear on the very right side of the website, outside of the container. (only the footer will be fixed, the header will be scroll-able as well).
http://sophisticateddesign.nl/cfreport/index.html
On the second website, I need the header and butterfly to stay fixed and for everything else to be scroll-able.
http://sophisticateddesign.nl
I'm wondering if there's an easy solution as I don't have much time left for these websites to finish..
Remove overflow: hidden in html
html {
height: 100%;
margin: auto;
width: 960px;
}
Remove position: absolute for .Wrapper
For second site:
You added your main content inside header with position: fixed; height: 50px;. It's the problem.
Yeah I just tried this out if you need something to overflow the sides you should use
html{
overflow-x: hidden;
}
instead of using just overflow.
|| For anyone who encounters this problem in the future. ||
You have these CSS properties to your HTML tag.
html{
height: 100%;
margin: auto;
width: 960px;
overflow: hidden;
}
Try changing overflow to overflow: scroll
You have these CSS properties to your HTML tag.
html{
height: 100%;
margin: auto;
width: 960px;
overflow: hidden;
}
So, I've been stuck with this problem for a while now and I can't seem to find a solution.
I'm trying to make a layout consisting of (for now) 4 different content areas like so:
What I'm trying to do
I'm trying to do the following things:
Simple explanation: Content should be the only scrollable thing on the page, with the footer following right behind it if content fits on the page, fixed on the bottom otherwise.
Detailed explanation:
Fix banner and mainMenu so that they never move when page is scrolled.
Make the content scroll with a page so that:
If the content (and footer) fit on a page, no scroll is displayed.
If the scroll is needed, content goes behind the banner (not being shown) and does not appear again above it.
If the scroll is needed, content can scroll until the bottom line of it and the footer are in the visible area.
The footer should do two things:
If content and footer fit on the page, footer should stick at the bottom of the content
Otherwise, footer should be fixed on the bottom.
What I have tried
Fixing banner,mainMenu and the footer are fixed using position: fixed (and positioned accordingly). Parent div has overflow: hidden (which doesn't seem to work).
<div id='main'>
<div id='banner'>banner</div>
<div id='mainMenu'>mainMenu</div>
<div id='content'>.. some long content ..</div>
<div id='footer'>footer</div>
</div>
And
#main {
width: 960px;
height: auto;
margin: 40px auto;
overflow: hidden;
}
#main #banner {
width: 960px;
height: 100px;
position: fixed;
}
#main #mainMenu {
width: 230px;
height: auto;
display: inline;
float: left;
position: fixed;
top: 140px;
}
#main #content {
width: 720px;
height: auto;
display: inline;
float: right;
margin-top: 100px;
}
#main #footer {
width: 960px;
height: auto;
clear: both;
position: fixed;
bottom: 0;
}
The Problem
Footer does not follow content if it fits within the area
Content overflows on the top of banner
I would really prefer to do this just in CSS (if possible) and as compatible as possible (IE7+, all other major browsers).
It's really getting frustrating now.. Any help would be appreciated.
There is no conceivable way I can think of that would solve your problem by just using css. Once you have set your elements to a fixed position they are out of the flow and thus your other elements cannot conform around them.
However I did find a solution by doing two different things. For the header issue I simply added another fixed element above the main banner and set it to the color of the background. This way the content will scroll behind it and look as if it is hidden. For the footer, I set up some javascript using jQuery to see if the content overflows or not. If it does then the footer's position is set to fixed, otherwise the position is set to relative.
You can check it all out here in this demo: http://jsfiddle.net/mrQGh/4/
To test out the javascript simply delete the text until there is no more overflow and run it again.
I'm building a site with a 1700px wide JS slideshow at the top. When I publish the page, I get horizontal scrollbars since my monitor is on a 1024px resolution. How do I get the site to be centered in the browser with no horizontal scrollbars - and whatever is superfluous on either side simply isn't visible to the user?
Help GREATLY appreciated, thanks!!!
Simple solution:
body { overflow-x: hidden; }
But this will also stop people scrolling if their monitor is smaller than the main width of your site.
The real solution is to simply not have it be 1700px wide all the time. Something like the following may help, but it depends on your HTML and how your slideshow is implemented.
#slideshow { width: 100%; max-width: 1700px; }
I haven't tested this, but you may be able to get away with putting the above CSS on a container element, something like this:
#slideshow-container { width: 100%; max-width: 1700px; }
#slideshow { width: 1700px; margin: 0 auto; }
You can do this pretty easily. jsFiddle example.
As you know the size of the div, use that:
div.slideshow {
position:absolute;
padding-left:50%;
margin-left:-850px; /* 1700/2 */
}
on my website it is a div based layout when the window is reszied everything is pushed together. Such as images overlap or are moved below each other and divs also overlap each other.
How can I get it to scroll when the content of the div is greater than the window size, similar to facebook if you resize the window it prevents anything overlappting and just makes the user scroll?
body
{
background-color: #B0B0B0;
color: #ffffff;
margin-top: 0px;
margin: 0px;
}
#header
{
width: 100%;
height: 100px;
margin: 0px;
padding: 0px;
}
#content
{
width: 80%;
height: 800px;
margin-top: 50px;
margin-left: auto;
margin-right: auto;
padding: 30px;
}
<div id="header">
[Header]
</div>
<div id="content">
[Content]
<img src="image1.png" /><img src="image2.png"/><img src="image3.png" />
</div>
The html is like that but obviously with more content
Hope I haven't made this too confusing, thanks.
Just add overflow:auto; to your div.
You can also use the following if you only want x or y scrolling
overflow-x:auto;
or
overflow-y:auto;
use the overflow:scroll; to enable scrolling in the DIVs
You must add white-space:nowrap; to your body tag.
I believe you may want overflow: auto;
Here's a comparison between auto and scroll.
add the style
overflow: scroll;
to #content
This answer is pretty late, however I stumbled across this question, as I was having issues on one of my pages, where I have this Page with 30 odd inputs of various types, that are split between two tables. I was unable to scroll to see about 10 or so inputs at the bottom of the page, and could not even scroll left to right when adjusting the browsers width.
What solved my issue was:
html, body {
overflow: visible;
}
This activated my X and Y scroll bar.
I had an issue with my footer not adjusting when scrolling, it instead would just stay fixed where it was situated before scrolling. this was due to my master CSS having the footer's position set as absolute. Simple fix, just creating a new style element in the page and added
footer {
position: fixed;
min-width: 100%;
}
I hope this helps anyone looking for a solution.
As stated by user3726345 , the best option to use is the
html,body {
overflow: visible;
}
using
overflow: auto;
dosnt give the best output. then you can further adjust your footer codes to your taste.