So basically upon resizing browser to smallest possible im still getting horizontal scroll bar for some reason. I cant have this for responsive purposes.
Any ideas?
http://www.techagesite.com/page-1work11122.htm
Another thing while im here
You will notice a email form and another div beside it with a border on it. When the browser shrinks the 2 divs collide and overlap.
Im still learning css and have tried sever approaches but nothing sticks.
Help would be greatly appreciated
The horizontal scroll bar is appearing because <ins class="adsbygoogle"> in the div #box6 has an inline width specified to 200px. To remove the horizontal scroll use the below css
#box6{
overflow:hidden;
}
EDIT: To get the desired effect as mentioned in the comment try the below css in media query for smaller screen.
The MailChimp form has width of 200px specified for its forms. This causes the right column to overlap the left section on re-sizing the window. So by setting width to the div container within the box6 and floating to left both the left and right divs will push the right section below when the screen doesn't have space to occupy both the divs side by side.
Also <ins class="adsbygoogle"> has a width of 200px given inline, so you can remove the width:45% specified for .right-column from your style sheet because this div will take the 200px width of its content.
#media only screen and (max-width: 480px) and (min-width: 321px){
#box6 .container{
width:200px;
float:left;
}
#box6 .right-column{
float:left;
}
}
Related
I'm trying to understand the case with responsive divs but I've got one problem.
As long as whole stuff is about 100% div's width it's not a big deal. But I find it difficult to add some additional features.
Here's my tiny fiddle:
[https://jsfiddle.net/yqh31d7v/][1]
The effect I'd like to gain is to fix sidebar's width (unless I define it to not) and shrink only blue div maintaing fixed margin-left at 20px.
I was trying to set width with % but it is not holding correct margin-left all the time.
So no matter what the browser width is I want to keep 300px sidebar width 20px margin left and keep blue div responsive from 0 to 700px.
P.S. I've checked some previous topics including ie. this fiddle
[http://jsfiddle.net/FXk4x/10/][2]
But adding left:20px; or margin-left:20px doesn't work.
Thanks in advance.
You currently have this css at the bottom:
#media screen and (max-width: 850px) {
#sidebar {
float:left;
margin-left:0px;
width:300px;
}
}
This is telling the browser that if the window is 850px or less then apply these rules (margin-left:0px;). So your css is working, but your viewing in the wrong screen widths to see the margin-left:20px; occur. Check these two examples:
Your exact code but in full screen (you will see the 20px margin if your screen width is higher than 850px):
https://jsfiddle.net/yqh31d7v/embedded/result/
Using a max width of 50px for the media query:
https://jsfiddle.net/yqh31d7v/1/
Ok, I have figured it out.
If you want to mix fixed and responsive floating divs you need to change position of fixed one to absolute.
I'ce updated the previous fiddle, it's more or less like this:
[https://jsfiddle.net/yqh31d7v/][1]
I am trying to create a menu using CSS, but I have a problem with its actual placement.
Right now, no matter what I tried it is always on the left side of the screen and not stretched. I would like to have it in the center and possibly stretch to 100% of the screen. I tried changing the width parameter, margins, text-align, but I always got something different than I wanted or it didnt work at all.
The menu can be seen here:
http://jsfiddle.net/98tW6/10/
As I said, all I want is to have it in the center top of the page and possibly stretched so that the background image repeats all over the screen at the top with the buttons in the center.
I think the crucial lines are within this part of the code:
div#menu
but I am not sure
Remove float and add this to the <ul>:
width:100%;
text-align:center;
Then remove the float from the <li> items and make them inline-block elements, because they are inline-block now they will respond to the text-align:center of the parent, and will be centered:
display: inline-block;
fiddle:
http://jsfiddle.net/98tW6/17/
I am working on a responsive website using the Skeleton Grid and have a left floated navigation bar div that is 100% height of the browser window. It works in all browsers I've tested except for mobile safari on the iPad. In mobile safari the navigation div is 100% of the viewport, but when you scroll down on the page the div does not stretch to the bottom of the content. [See image below].
How do I make it so that the div is 100% height on the iPad, not just 100% of the viewport?
Dev Site: http://www.id8agency.com/jeremiah
Screenshot of the problem: http://www.id8agency.com/jeremiah/jeremiah.png (as you can see the white bar on the left does not stretch to the bottom of the page once you scroll)
How it should look: id8agency.com/jeremiah/jeremiah1.png (sorry, I don't have enough reputation to post more than 2 links)
Things I've tried:
Set height and min-height to 110% (works, but creates a scroll bar on
the desktop site)
Set height to height of content (works, but not all pages will be the
same length, so creates a scrollbar on some pages where content is
shorter)
Set position:absolute and and position bottom:0px (doesn't work,
positions the div at the bottom of the viewport, not the bottom of the page)
Set meta viewport tag to height=device-height and height=1000 (breaks
the responsive functionality of the website)
Thank you for any help you can provide!
try having the .navigation element be position: fixed; and then place the the content in the right in its own wrapper (something like .content-right).
Then set these properties on the .content-right element include a media query "reset" for when everything goes to one column (XXX is the breakpoint):
.content-right {
margin-left: 240px;
}
#media screen (max-width: XXX){
.content-right {
margin-left: auto;
}
}
Why don't you put on outer div and apply the background of the sidebar (sliced so it can be repeated on the y axis) to it and repeat-y?
It will expand up to the content end and when you don't need it anymore, you can remove the background from the media queries.
The problem also appears when I set my desktop browser viewport to a small height. I think the problem is, that all the 100%-heights here are relative to the viewport, and I think you want the navigation bar to be the height of the content, not the viewport.
But possible solutions would be to set a faux column on the #container-element (see http://alistapart.com/article/fauxcolumns).
Another possibility would be to measure the height of the #container-element with jquery and assign it to the navigation-bar. Something like:
var containerHeight = $('#container').height();
$('#navigation-container').css('height',containerHeight);
(I haven't checked if it works, but I think it should.)
So most of this site so far uses auto centering (the container and nav have margin-left/right:auto) and things seem to go all well and dandy except for the footer.
When I resize the size of the window everything is filled nicely except when I scroll horizontally the footer seems to be cut off on the right side.I've read that this may be a browser bug. Though it occurs in IE and chrome and firefox so it could just be sloppy coding (I am a big newb).
Here is the css:
#footer {
background-image:url(../Images/footer_bg.jpg);
color: white;
height:300px;
padding-top:20px;
}
/*I have 4 headings with Ps that I want to display horizontally side by side*/
#footerContent{
min-width:1000px;
}
/*So I tried floating <li> inside <ul> and limiting its width, which worked fine */
#footerContent ul{
width:1000px;
margin-left:auto;
margin-right:auto;
}
#footerContent li {float:left; width:250px; }
Just to reiterate it works fine when the browser is full screened or resized. But after you resize and you use the horizantal scrollbar to scroll all the way right then the background image is cut off.
I've tried width:100%, min-width, width:1000px; but none of those seemed to work.
http://postimage.org/image/3so264fnb/
Regarding your comment about Stackoverflow being similar
(at least as of 4-29-2012)
The issue on stackoverflow seems to be that the footer contains another div element, footerwrap, that has a width: 960px set to it, but footer itself has no width setting. A div is basically designed to simply "group" block level content. It is a common misconception that a div expands with it's content. Actually, a div expands to its parent if an explicit width is set on a parent. If there is none, then it fits the browser window. This is what you (and stackoverflow) is experiencing.
To get the div to relate to the content width, you must either:
Explicitly set the width or min-width of the container. So, if stackoverflow set a min-width: 990px (the 960px of the footerwrap + the padding of 15px on each side) on the footer that wraps footerwrap, then its problem is solved.
Set the container div to float, as a floated element wraps its content.
Take a look at this example fiddle. Note the first two div's experience the same issue you are seeing. If you shrink or expand the size of the iframe window in the fiddle, the first two div's will contract or enlarge with it, but still leave blank space on the horizontal scroll. The third and fourth div's have had my fixes above applied. The fifth div is to show the fact that the inner div, if not defined in width, will expand to the width of a container that has an explicit width set.
As a side note, it may work (I have not tested in many browsers, but FF 11 worked) to actually just add a float: left to the body element in those cases where the body does not have a set width. As this example shows, it seems to be effective in causing the first two div's to behave just like the 3rd and 4th divs.
I hope this helps.
Original Answer
It is a little unclear what can be done because there is some information lacking. Here are some things to look for:
Is your background-image wide enough (or can it / should it have a background-repeat: repeat-x applied to make it wider if needed)?
Does your footer width (1000px) match your upper content width? If footer is constrained narrower than what the upper content area (or header, etc.) is allowed to be, then it's background will not align.
That's the best I can do without seeing more of your html and css for the page, and not knowing the size of the image and your intention for how it is to function.
I've got a div that has many listitems in a verticle rows (over 200). Depending on the screen resolution the container div should resize to fit the screen and create a vertical scroll bar and horizontal scroll bar for side scrolling - however; using overflow:auto or even overflow:scroll the list items are not cut to fit within the container div and a horizontal scroll bar is not added. So I have a container that is roughly 700px in width and listitems that are roughly 1000px wide and these list items are hanging over the edge of my container (on the right side) by 300px. What can I do to fix this?..here is my CSS for the container...
#report-box #report-text{
position:relative;
height:96%;
width:1200px;
overflow:auto;
font-size:12px;
color:#000;
margin:0px 0 0 0;
}
My listitems are styled in my HTML as follows:
<li class='_1' style='width:100%; float:left; position:relative;'>SOMEDATA</li>
You can probably set a max-height on the container.
I'm not sure what the problem was but instead of forcing that to work I made an additional container inside of the original container and specified overflow:auto to that and somehow it is now working.