Forum Moderators: not2easy
It is fine in Explorer, and only happening in firefox.
Here is the style for the image:
<div style="width:100%; position:absolute; left:0px; bottom:0px; text-align:center; padding: 0px; margin: 0px;">
<img src="images/grass.jpg" style="width:100%; height: 135px; padding-bottom: 0px; margin: 0px;"></div>
(most of the margin:0 and padding:0 where added in there to try and fix the problem)
Any help would be MUCH appreciated!
Is it common practice to add margin:0px; padding:0px; to pretty much everything?
* (
margin:0;
padding:0;
}
Saves me a lot of trouble from browsers having defaults where I didn't expect them.
of course I need to add something again to a main body <p> to separate paragraphs again and something to allow some space for the bullets of a <li> that's used in a body. But at least it's more consistent instead of one browser using padding while the other uses margins.
Have you tried validating the page? Maybe you have an element open and the footer is aligning to the bottom of that.
By any chance does the one page that isn't working have the shortest amount of content?
Have you tried body,html{height:100%; margin:0px; padding:0px;}?
Anyways these are just some things that came to mind. It's hard to tell what is wrong without a link to the full page...
The part you mention about adding "body,html{height: 100%; margin: 0px; padding:0px} - do you mean adding this to the html or the css. Sorry if that sounds like a basic question.
I also like your last suggestion about having it all contained in the css, another great idea.
Thanks again swa66 and homie_187, you guys are awesome. Yeah, I know what you mean about it's hard to tell without a link to the page, but from what I understand, that's not allowed here.
Homie_187 is very right about validating: do try it e.g. at HTML [validator.w3.org] and CSS [jigsaw.w3.org]
Invalid HTML and/or CSS makes it very hard to predict what a browser will make of it.
Try taking out the content on the offending page bit by bit, once the problem goes away: you'll have found the bit that "did" it. It might be obvious at such a point.
To find out where an elements ends up on the screen I mostly use the "web developer" toolbar in firefox. It adds a menu and one of the items is "css/view style information ..." Turning that on allows you to hover over an element and it'll outline it and show you which it is. Clicking also shows the CSS applied to it as well as where the CSS comes from (if you have multiple files involved this can be handy).
You would add "body,html{height: 100%; margin: 0px; padding:0px}" to your css file, although on second thought the height:100% might cause some problems...
Having all of your style contained in the css is a very good idea, in fact that is pretty much the whole point of css - to separate markup from style. It sounds like the "grass" image is just decorative (not content) which means it should really be applied as a background image using css. If you really want the image to "stretch" as the window is resized then I'm not sure how to do that with a background image, but you can easily tile a background image to fill any space, which may actually be the effect that you are looking for.
It you could post some more code we could probably tell you what is causing the problem.
I'm happy that my site is at least operational, and the only problem with the design is the 5px thing on one page, so not the end of the world. Since I am just starting the web design field, I will take all the steps you guys mentioned here and fix this, and know for next time!
The grass image is just decorative, and I do want it to stretch to fit the users screen. I also have a background image, which does tile and is positioned to the top (it is a blue/white gradient) to look like the sky. I think you can have only one background image? so I'm using the z-index levels for any layering.