Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I finished coding this website using bootstrap and now I have this issue regarding that horizontal scroll which was not supposed to happen. This is my first website using boostrap.
I tried using 'divide et impera' by removing snippets of code in order to find the issue. The horizontal scroll disappeared when I removed pretty much the entire content / website so I suppose it is related to the main container ?
I can't seem to figure out the problem, been banging by head against the wall for the past few hours.
Not to take anything away from #Tulio Castro, as putting overflow-x: hidden; on the body should fix this. This is a hacky fix, however, in that it doesn't fix the problem itself, rather, it fixes a currently visible consequence of the problem. I figured you might want to know the actual problem--why this is happening and what you can do better.
First let me say that bootstrap is a delicate system: Every time you apply your own styles, you'll need to be checking to make sure your styles don't clash with bootstrap's.
So here are the fixes:
You can run this jQuery when the horizontal scrollbar is visible, and it will tell you which elements are causing the overflow:
$('*').filter(function() { return $(this).width() > $('body').width(); });
In your case, it will return three culprits, all of them .row elements:
1) The first .row needs to be nested in a .col-xs-12 element. You can't have a .row as an immediate child of a .row element in bootstrap.
2) The second .row has a parent with class .partneri. You applied custom CSS to this parent element, which broke bootstrap. In this case, bootstrap wanted 10px of padding on the right and left, but your CSS took this away:
.parteneri
{
....
padding: 10px 0 10px 0;
}
Change this to
.parteneri
{
....
padding: 10px;
}
And you should be fine.
3) The third .row has the same thing. The parent with class .sub-footer breaks bootstrap's padding. Change
.sub-footer
{
border-top: 2px solid #f8f8f8;
padding: 10px 0 4px 0;
}
to
.sub-footer
{
border-top: 2px solid #f8f8f8;
padding: 10px 10px 4px 10px;
}
And you're set. Best of luck.
I saw this horizontal scroll in apple iphone 4, just solve this, just define thiss css:
html,body{
overflow-x:hidden;
}
Hope it helps
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
The footer is at the bottom as intended on my Home page and Form page. But something is causing the footer to appear at the top of my Gallery page. I'm assuming it's an issue with specificity or one of my selectors. But I'm new to this and so far everything I've tried hasn't resolved the issue.
My footer code is basic so something else must be forcing it to the top. I checked the Gallery ID's and none of them appear to be effecting my footer element.
footer {
background:#333333;
color:#FFFFFF;
padding:10px;
}
/* || gallery-items */
.gallery-item {
text-align:center;
width:300px;
height:300px;
margin:10px;
background-color:#ADD8E6;
border:10px solid #333333;
border-radius:4px;
float:left;
object-fit:contain;
}
/* || gallery item hover */
.gallery-item:hover {
border-color:#03A9FC;
}
Here is a link to my Replit. I apologize for not being able to asses what the root of the issue. This is my first week doing CSS styling.
Your .gallery-item has float: left; this means that those elements don't get "considered" as taking any space when rendering the other elements on your page. You can put a div with a style clear: both (in your case only clear:left will work) between your gallery and your footer elements to fix this
Add overflow: hidden; on #gallery-content
#gallery-content{
overflow: hidden;
}
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
This is what I have so far:
body {
padding: none;
background: green;
}
.layoutTable {
width: 100%;
height: 100%;
border: 2px solid black;
position: fixed;
background: red;
margin: 0;
padding: 0;
}
.bodyStyle,
html,
.layoutTable {
margin: 0px;
padding: 0px;
}
<table class="layoutTable">
<tr>
<td>
<!-- japaneseclass Schedule -->
</td>
</tr>
</table>
The output:
I ran this code in IE11 and there is a gap between body and table, I don't know how to remove this, and the design breaks on zoom.
All HTML document by default have a margin surrounding all four corners of it. As desirable as margins are in most cases, sometimes they with your design, such as a header bar that spans the entire page horizontally. In this tutorial I'll show you the two techniques most commonly used to remove the document's margins, so content presses right against the edge of the window.
<body bgcolor="green" style="padding:0;margin:0">
Codepen http://codepen.io/noobskie/pen/avVQQy?editors=110
This seems to remove the gap between your elements all you need to do was add padding:0; & margin:0; to the body tag i'm not sure what you mean when you say the design breaks whenever you zoom though can you explain?
Also it seems redundant to have a separate class for body ie bodystyle(assuming thats what your using that for) when you can just use body as a selector itself
I think you just forgot to attach your bodyStyle class in your CSS to the body tag in your HTML...
<body bgcolor="green" style="padding:none;" class="bodyStyle">
It's always a good idea to do a 'browser reset' as all browsers treat this gap differently. That's why you should add the following css:
* {
margin: 0;
padding: 0;
}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I put up a test site for a client to look at for a proof of concept, and when cross checking browsers I noticed a white line that was not supposed to be there.
http://artistelisabeth.com/ (loads correctly in all other browsers except FF)
There is a ~10px line right above the footer when viewing in FF. Initially it looks like a simple fix, but its actually the bg of the body showing through.
I tried adding some simple solutions first padding-bottom on the parent element or some margins on child elements. Nothing worked, only solution is a hack, adding a margin-top:-10px to the footer, or opposite style on the featured div.
Also. The only style in my css associated with the .featured div, is background: #ded1ae, this shows up correctly in all other browsers, but in FF it gets changed to background: none repeat scroll 0% 0% rgb(222, 209, 174);
I also noticed all my other bg colors were changed as well, and all hex colors changed to RGB.
This may be a simple solution, which I hope it is, and I am just having a brain lapse. But I am totally perplexed, and have never run across an issue like this.
Please help!
(I guess it should be noted that I am using the Skeleton boilerplate, but I have used this many times before with no issue, and I cant see how that would affect this.)
<div class="featured">
<div class="container">
</div>
</div>
.featured { background: #ded1ae; height: 100px; }
.container { position: relative; width: 1200px; margin: 0 auto; padding: 0; }
Above is the css in all browsers except FF, in FF it shows up as
.featured { background: none repeat scroll 0 0 #DED1AE; height: 100px; }
Your <hr class="remove-bottom"> in the <footer> causes the whitespace by having a margin-top: 10px and clear: both.
Setting .remove-bottom { margin: 0; } "fixes" it.
Not sure if it is a bug/spec violation in Firefox or the other browsers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
See http://www.levomedia.com/contact-us/
If your screen is of a good size there might not be a scroll so you will have to zoom in... but when there is a scroll and you move down the page, my theme forces my header to travel with you, which I would like to remove if possible.
What would be the best way of stopping this from happening, so that it stays in the same position and does not travel with you?
The Best thing would be to remove the relevant Js code , which is causing this.
I have found this
<script src="http://www.levomedia.com/wp-content/themes/sensitive/js/jquery.stickymenu.js?ver=3.6" type="text/javascript">
js code file inclusion in your page, just remove it, everthing should works fine, as you intend to.
this will also improve your page rendering time and efficiency :)
Happy Coding :)
you need to remove the css attribute :
position: fixed
Which you had used on the header.
Stop using the jquery.stickymenu.js script and things gonna be ok. It applies position:fixed to your header, when you scroll the page down and you don't need it.
Like this
please add position:fixed, top:0; width:100%; in .navbar-wrapper selector
and
please add position:relative; top:66px; in this selector .type-post, .type-post .post, .type-page, .type-page .post
CSS
.navbar-wrapper {
background: url("images/wild_oliva.png") repeat scroll 0 0 #EEEEEE;
margin-bottom: 20px;
padding-bottom: 0;
padding-top: 20px;
position: fixed;
top: 0;
width: 100%;
z-index: 1;
}
.type-post, .type-post .post, .type-page, .type-page .post {
margin: 0 !important;
padding: 0 !important;
position: relative;
top: 66px;
}
In your case, Js is adding the position:fixed attribute in topmenu once you scroll down.So you can do this by css.
convert this :
<div id="topmenu" class="container" >
to this:
<div id="topmenu" class="container" style="position:relative !important" >
If you dont want inline Css Make a class like this:
.container{
position:relative !important
}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I am using HR tag in my HTML page. But the horizontal line is not covering the whole page along X axis. There is a gap at left and right both. How can I fill this gap?
For example, below is a sample code -
<html>
<hr>
</html>
You can do the following -> demo
You have two options that I know of anyways - Using a horizontal line or a div with a top or bottom border.
The reason why you have a space or gap is because browsers comes with different pre-set settings - so you need to set margin and padding to zero. Take a look at the demo.
CSS
* {
margin:0;
padding:0;
}
hr {
margin-top: 30px;
/*so you can see it in demo */
width: 100%
}
.demo {
position: relative; /*so I could use 'top: 30px' */
top: 30px;
/*so you can see it in demo*/
width: 100%;
border-top:1px solid black;
}
HTML
<hr/>
<div class="demo"></div>
Edit: As Ojdo commented, you CAN reset before working on a project using something like this Meyer's Reset OR you can make it 'cross-browser' compatible and use normalize.css from Necolas - this basically tries to make your default css look consistent among several browsers. The choice is ultimately up to you. Start from the ground up or start with something somewhat consistent.
that's because of the margins of the body. try this:
<html>
<body style="margin:0;">
<hr>
</body>
</html>
put this css on the hr:
hr {
margin-left: -8px;
margin-right: -8px;
}
This happens as there is always automatic margin
Here is a fiddle example:
http://jsfiddle.net/ha97t/
The gaps are caused by the default margin of 8px for the body element (which is a common browser default and described both in CSS 2.1 and in HTML5 CR).
You can override the horizontal margins of body rather simply:
body { margin-left: 0; margin-right: 0 }
It is possible to use more extensive overrides, like “CSS resets”, but they could affect your page layout in many ways and do not contribute to solving this problem any better than simply overriding the specific properties for body.
However, removing those margins means that text will run from the left edge of to right edge, often making letters touch the edges. So if you wish to make the horizontal rule extend across the page without affecting anything, set negative margins on it. Then it is best to set the body margins explicitly (to guard against browsers not implementing them according to common practice):
body { margin: 8px }
hr { margin-left: -8px; margin-right: 8px }