Hi,
I am having trouble with height (as you may have guessed from the title).
My original problem was the background did not align correctly in internet explorer but it did in firefox. To try and fix this i removed the body background and added a div positioned at 0,0 with a width and height of 100% behind everything. The problem is, 100% refers to the browsers height, not the pages height. Once the page goes beyond the height of the browser, the background stops. How could I prevent this? Or how else could I fix the background aligning?
10 2551
It depends. Without the complete code or a link, we can only guess. But try this in your CSS:
html,body{
height:100%;
width:100%;
}
AricC 1,892
Recognized Expert Top Contributor
Hi,
I am having trouble with height (as you may have guessed from the title).
My original problem was the background did not align correctly in internet explorer but it did in firefox. To try and fix this i removed the body background and added a div positioned at 0,0 with a width and height of 100% behind everything. The problem is, 100% refers to the browsers height, not the pages height. Once the page goes beyond the height of the browser, the background stops. How could I prevent this? Or how else could I fix the background aligning?
You can use CSS to have a repeating background -
body
-
{
-
background-image: url('somepicture.jpg');
-
background-repeat: repeat
-
}
-
Yes i have a repeating background, thats easy stuff but it isnt inline with any other elements on the page in IE 6. For example, I have a center aligned background image which is 960x32px. I use <img> to draw that image at postion 50%, 0px with a margin-left of -480px so it centers the image. This works in FF but in IE, it appears to be a pixel out. Then when i resize the IE window, it goes way out. It appears that the elements are centered to the window, the background is centered to something else =S. A seemingly obvious solution is to move the body to 50% but whats the width to subtract from the margin? 50%? that just cancels out.
Sorry for double posting but I can no longer edit my previous post =S. Latest update is they stay in the middle but its still not right. In IE, certain window widths work, others dont. If it works, shrinking/increasing the width by 1px makes it out of line. a further shrink/increase puts it back inline and so on. When maximised, it is out of line. Any ideas on how to solve this? And also, how would I position a div at the bottom of the page? top:100%; doesnt work, thats at the bottom of the window, the same as bottom:0%;. I want it at the bottom of the page, not the window.
AricC 1,892
Recognized Expert Top Contributor
Sorry for double posting but I can no longer edit my previous post =S. Latest update is they stay in the middle but its still not right. In IE, certain window widths work, others dont. If it works, shrinking/increasing the width by 1px makes it out of line. a further shrink/increase puts it back inline and so on. When maximised, it is out of line. Any ideas on how to solve this? And also, how would I position a div at the bottom of the page? top:100%; doesnt work, thats at the bottom of the window, the same as bottom:0%;. I want it at the bottom of the page, not the window.
Can you provide a link to the page? This would be a lot easier if we could see the problem.
Yeah the page is currently at http://www.hughierocks.com/randomgames/index.php
I pretty much got the aligning thing sorted (firefox rounds up, IE rounds down, or vice versa, cant remember which). The problem i have now is the little banner at the bottom. i want it at the bottom of the content, not the browser window. Visit the guestbook page to see the problem.
AricC 1,892
Recognized Expert Top Contributor
Hughie,
The first thing you need is a Doc Type. See the post at the top of this forum.
And then, after adding the doctype, validate your html and css for your list of errors to fix.
Ok I added a 'strict' doctype and then edited my css (html seemed fine) accordingly.
EDIT: Ok now it seems to work fine in both. Hurrah. Anyone got any ideas on moving the 'layout created by' banner to the bottom of the page rather than the browser window? =S
The problem is caused by using absolute positioning. Doing so removes the elements from the normal flow which is why the footer 'rises up' to the first block element, the <p> I think. I don't see why the main content or footer should be absolutely positioned.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Paul |
last post by:
Hi,
I'm wondering if someone out there can help me overcome this quandary.
I need to be able to calculate the height of the current page. I need to
calculate the height of the page in pixels after...
|
by: Thomas |
last post by:
Hi there,
I have an iframe which is editable (designMode = "on") and want to
resize it dynamically as the content grows (e.g. more lines of text is
in there) and there the struggle starts.
I...
|
by: Jason Bassford |
last post by:
Okay,
What I'm trying to do is create two boxes, one on top of the other.
The first is a static height, the 2nd, underneath it, should take up
the remaining amount of screen space and overflow...
|
by: Kepler |
last post by:
How do you get the height of the client browser in IE? Both
document.body.clientHeight and document.body.offsetHeight return the
height of the document. If the page is long and there's a vertical...
|
by: Just Dummy |
last post by:
Hi all,
I am struggling with a problem for a long time.
Problem statement:
I have a table and the table can contain n number of rows. i.e., the
table rows will be generataed out of a xml...
| |
by: reycri |
last post by:
I have a page that works as I intend in IE but not in Firefox:
<html>
<head>
<title>Overflow Test</title>
</head>
<body style='overflow:hidden; margin:0; padding:0;'>
<table border='0'...
|
by: fredo |
last post by:
This question was asked in comp.lang.javascript with no result.
In IE5.x and IE6, I want to display an image when the user rolls over a
text link. The image does indeed display, but only on the...
|
by: AAaron123 |
last post by:
<body runat="server" id="MainBody">
<form id="form1" runat="server" style="background-color:green; width: 100%;
height: 100%">
<br />
Table1" runat="server" Style="background-color:Yellow;...
|
by: ziycon |
last post by:
I have the below code, when a user clicks on the
<a href="#" onclick="showhide('languages'); return false;">Language(<div id="current_lang">en</div>)</a>
it shows a DIV that is hidden and when...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |