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;
}
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 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
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 3 years ago.
Improve this question
I have a div that refuses to change background colors when I hover over it. It stays the same. Here's the code.
HTML:
<div id="login"></div>
CSS:
#login {
position: fixed;
float: left;
background-color: none;
margin-left: 1.5%;
top: 1em;
height: 1.25em;
width: 7em;
text-align: center;
border-radius: .3em;
opacity: .5;
padding-top: 1em;
border: .18em solid gray;
}
#login:hover {
background-color: gray;
}
I had a similar problem. What I suggest is making sure there are no invisible objects over the div. This tells the program that your cursor is hovering the invisible object rather than the div with the hover element.
Works fine for me - http://jsfiddle.net/Q8A6d/
Which browser are you using? You cannot apply a
:hover
pseudo class to any elements other than <a> in older versions of IE (6 and below).
Your code appears to work properly here, so a few things could be wrong:
You might have linked your stylesheet to your HTML file improperly.
Some other CSS in the context of your project may be overriding the piece that you've given here.
You might be running into browser compatibility issues with the :hover selector or something else in your code that is breaking the styling.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Can anyone help to check on this site?
http://chanbaneng.com/demo/
When in Firefox, all the content gets pushed to the right. In all the other browsers I tried (Chrome, Safari, and IE), it works just fine.
Is there anything wrong with the code?
Used to this way
ul.bjqs{
overflow: hidden; // remove this line in your css
}
==========================
your second problem solution is this
now define this css in your style sheet
#container{clear:both;}
Just change this class and set it again because its slider
ul.bjqs {
position: absolute;
list-style: none outside none;
margin: 0px;
overflow: hidden;
display: none;
}
I am sure there will be some calculations will be done on bases of resolutions so it will better to put in absolute position and then do other stuffs this will result in to same for all browsers
Please modify this
<ul class="bjqs" style="height: 380px; width: 100%; display: block;">
to
<ul class="bjqs" style="height: 380px; width: 100%; display: block; overflow: -moz-hidden-unscrollable;">
The simplest way I found to solve this without rewriting your code is:
Go to your li a selector (line 73) and remove height: 28px;
You a tags already get their correct height and setting it manually messes up with the flow of the display.
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 }