473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Lose browser viewport head space

Hello

IE 7.0.5730.11
Opera 9.27
Firefox 2.0.0.14

I'm trying to display my root div hard up under the address bar/tab bar
in the viewport

position:absolute works but breaks the centering style
(margin-left:auto; margin-right:auto;)

I've tried all sorts of things with negative pixel values (padding,
border, margin etc etc) but each browser seems to use a different number
of pixels of white space so the results vary. I seem to remember doing
this years ago with tables but I've just forgotten.

FWIW I'm going with
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

TIA

Idaho
Jun 27 '08 #1
2 1727
On 2008-04-21, DuncanIdaho <Du**************@googlemail.comwrote:
Hello

IE 7.0.5730.11
Opera 9.27
Firefox 2.0.0.14

I'm trying to display my root div hard up under the address bar/tab bar
in the viewport
Just set html, body { margin: 0; padding: 0}.

It's usually an 8px margin on body, but might as well set all possible
culprits to 0 to be sure.
Jun 27 '08 #2
Ben C wrote:
On 2008-04-21, DuncanIdaho <Du**************@googlemail.comwrote:
>Hello

IE 7.0.5730.11
Opera 9.27
Firefox 2.0.0.14

I'm trying to display my root div hard up under the address bar/tab bar
in the viewport

Just set html, body { margin: 0; padding: 0}.

It's usually an 8px margin on body, but might as well set all possible
culprits to 0 to be sure.
Ah, yes, of course (looks sheepish). Thanks

Opera still seems to display a 1px border/margin under the adress bar
but the other two are perfect.

Thanks

Idaho
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
I posted a question before regarding the offset positions when I used CSS. Some people suggested I should use percentage instead of pixels? I tried many different ways, but the position still...
4
by: Matt | last post by:
When the user resize the browser, the "Frequently Used Link" and "Table 1" and "Table 2" will shift to the left hand side, but table position is unchanged. I really have no idea how to fix that. I...
4
by: metalseb | last post by:
Hi folks I built up a small website which is designed for 800x600 display. Runs just fine in this resolution but if you have a system in 1024 or 1280 pixels wide, the site just "sticks" in the...
12
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...
3
by: anonieko | last post by:
You can try this code: > > > > > <!--- filename: mypage.html ----> <html> ....blah blah blah <script language=JavaScript src=/Javascript/center.js></script>
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I find the size of a browser window?...
3
by: Q. John Chen | last post by:
I have a page contains a table (e.g a 3-row table). The middle row is for the content and the bottom row is for footer notes. When the middle row does not have much info, the footer goes way too...
8
by: removeps-groups | last post by:
Is there any way to control the space between top of browser or frame and document body? What I have is this: There is a simple file test1.html, and file test.html that displays test1.html in an...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.