This question already has answers here:
How to remove margin space around body or clear default css styles
(7 answers)
Closed 6 years ago.
Web Page
In the above web page photo I have taken a <div> with height : 100vh; and width : 100%;
I don't want the white body border.
Someone please help !!!
Well, that margin is there because the body element has a default margin, set by the browser. To get rid of it, you need to set margin: 0 on the body element.
This question has actually been asked many times before, in various ways. For future questions you may have, it may be useful to take the follow steps;
Open the developer tools in your browser
Chrome Developer Tools
Safari Developer tools
Firefox Web Console
Inspect the elements to see which one is the problem
Search Google, or StackOverflow for questions with similar scenarios as yourself
If, after inspecting and googling, you still cannot solve your problem; post a question on here, along with examples of your code, and details of your research. Having more information definitely helps us to figure out your problem.
As you haven't add any coding.So in general you can add this and try:
width:100%;
max-width:100%;
margin-left:auto;
margin-right:auto;
I think this is an issue with default padding or margin creating a white border... Add the below to ur css....
.your_div_class{
width:100%;
height:100%;
padding:0px;
margin:0px;
}
Use that code on your style or .css file and you'll be fine:
body {
height: 100%;
width: 100%;
margin: 0px;
Related
I am making a stupid site in the vein of sites on theuselessweb.com. (Warning: strange audio on pages for every link henceforth.) However, I am running into an issue: I have a vignette effect on the site that serves as a background, and in this jsFiddle, where I did all my work, it looks perfect. However, when I upload it to my webserver to test for real, it doesn't behave in either Chrome or Firefox: There is an unwanted space between the background color and the vignette effect on the top and left sides of the page. What is causing this? How can I get rid of it?
Edit: Since I received an answer, this has been resolved. As such, the link to my webserver above no longer has the issue.
Each browser defines some different margins or paddings to elements by default. In your case, there is a margin to the body-element.
Change this in your css and you are fine.
body {
width: 100%;
height: 100%;
background: #666666;
margin:0;
}
try checking your css for something like this:
*{
margin:0px;
padding:0px;
}
if the problem persist, probably is because some of your lower classes in CSS are overriding the style
Please help:
this is my site
http://www.dukeofessexpolocup.com/ when i open in ie7 it doesn't display both left and right ears:
div#Ears_left{ padding: 0; float:left; width: 41px;display:inline;}
.custom{margin:0 auto;text-align:center;}
div#Ears_right{ text-align: right;width: 39px;float:right;display:inline;}
div.ears {margin-top: 127px;}
It could look like you're missing a correct closing tag for #Ears_left, as it's rendering outside the tag when viewed in IE7...
Go over your markup and recheck that you closed your tags correctly.
UPDATE
Actually it seems its something inside the div#body that's probably not closed correctly..
As Spudley says in the comment, go here:
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.dukeofessexpolocup.com%2F&charset=%28detect+automatically%29&doctype=XHTML+1.0+Strict&group=0&user-agent=W3C_Validator%2F1.2
And start fixing errors :)
I have a JQ slideshow in a div on this page:
http://www.lucky-seed.com/web.html
and have a css sheet for IE with the following style:
.slideshow { height: 599px; width: 700px;
max-width: 700px
margin-top: 00px;
margin-left: 295px;
float:left;
position: relative;
display: inline;}
Where am I going wrong? It looks great in everything but IE, but once in IE, I can't seem to move the position around no matter what I do.
Thanks in advance for your insights.
Hello fellow Pittsburgher :P
You've got so many different, conflicting styles going on there. While it's not a specific answer, might I suggest using a CSS framework like Blueprint ( http://www.blueprintcss.org/ ) to better manage your columns with greater simplicity and let it worry about IE compatibility. Rolling columns yourself is usually unnecessary these days.
In ieweb.css, try changing the margin-top on .slidenav to 50px, instead of -20px.
That moves the arrows to approximately the same place that they are in Firefox.
It might be an idea to scrap the IE specific stylesheets and do them again if need be. If you remember your question from yesterday, you had a weird issue with comments. Those comments were causing parsing errors on your pages for IE, so I imagine a lot of the "fixes" in your IE stylesheets are no longer required now you've sorted those comments.
I've read about quite a few people having a problem with this and I've tried all the solutions I can find - hopefully someone can't point out where I'm making a mistake.
I'm working on this site, and as far as I can tell, I'm in standards mode. The doctype is the first thing in the file, and it's valid. I've tried using a wrapper div or body tag with text-align: center and the container div using text-align: left.
I can't seem to find anything that works. Any ideas would be greatly appreciated.
Your problem looks like it's in the ie7.css file. It has this rule:
* {
display:inline;
zoom:1;
}
Inline elements don't have margins. You'll need to drop this rule, or add display:block; to .container_12 somewhere.
I am having a hard time figuring out why things look so different in IE and Firefox.
Here is a CSS class
.logo { width: 224px; height: 120px; position: relative;
display:block; left: -1px; background-image: url(logo.png);}
In IE this works as expected, but in Firefox it behaves like a drunk! I see 3 logo.png at different places on a page. If I remove display:block then I cannot see the image in either browser.
Any comments appreciated.
You might need to add
background-repeat: none;
to your css class. And for future reference, it's always IE that screws up ;)
EDIT: If that doesn't solve your problem, please put up a sample site live somewhere we can look at it and experiment a little. Also, Firebug might be helpful.
EDIT2: Removed this, since I noted the difference between firebug and the src I got from right-clicking and selecting "View Source..."
EDIT3: Steve found your problem: You can't self-close anchors. Change
<a href="/" id="logo" />
to
Your problem is in the HTML. You can't can't self close A tags
Correct, the problem is always IE. If firefox has an issue it's usually an issue with the w3c specs. Not being a fanboy, it's just the way things are.
I guessing your problem is that the default value for background-repeat is different between the browsers. You should try setting background-repeat:no-repeat EDIT: Maybe not, all browsers default to repeat.
It would be useful to know what element you are applying logo to. Whatever it is is probably collapsing to a height of 0px when not a block. Put a border on it to see what's going on there.