473,395 Members | 1,972 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,395 software developers and data experts.

No bottom margin in Opera 7

Hi, I'm a CSS noob, and I'm trying to implement a very basic layout but am
having problems in certain browsers.

Basically, I want a horizontally centred box with a fixed width of 750px,
with a 100px high header, a 50px high footer, and a contents box that grows
to fit the contents. I also want a margin at the top and bottom of the
centred box of a fixed height (30px).

I have the following HTML file which gives the desired results in Internet
Explorer 6, Mozilla 1.7.5, and Firefox 1.0 (all tested on Windows XP SP2).

However, in Opera 7.54, there is NO margin at the bottom of the window.
Instead, the footer hugs the bottom of the browser window. I've been trying
to work out why this is happening for a few days now, but I don't know
what's going on. What am I doing wrong?

Here is the code you can just copy into an HTML file to view the results:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Box Test</title>
<style type="text/css">

html {
height: 100%;
max-height: 100%;
margin: 30px 0px;
padding: 0;
}

body {
height: 100%;
max-height: 100%;
padding: 0;
font-family: Verdana, sans-serif;
font-size: small;
text-align: center;
line-height: 1.5em;
color: #333;
background: #ddd;
}

#box {
height: auto;
width: 750px;
margin-left: auto;
margin-right: auto;
padding: 0;
font-size: 95%;
text-align: left;
border-left: 1px solid #000;
border-right: 1px solid #000;
background: #fff;
}

#header {
height: 100px;
padding: 0;
margin: 0;
border-top: 1px solid #000;
border-bottom: 1px solid #000;
background-color: #EFF7FE;
}

#content {
margin: 0;
padding: 0px 20px;
}

#footer {
height: 50px;
margin: 0;
padding: 10px;
border-top: 1px solid #000;
border-bottom: 1px solid #000;
color: #FFF;
background-color: #000;
}

</style>
</head>
<body>
<div id="box">
<div id="header"></div>
<div id="content">
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
</div>
<div id="footer"></div>
</div>
</body>
</html>
Jul 21 '05 #1
3 2965
Blacksmith wrote:
Hi, I'm a CSS noob, and I'm trying to implement a very basic layout but am
having problems in certain browsers.
me 2
I also want a margin at the top and bottom of the
centred box of a fixed height (30px). However, in Opera 7.54, there is NO margin at the bottom of the window.
Instead, the footer hugs the bottom of the browser window. I've been trying
to work out why this is happening for a few days now, but I don't know
what's going on. What am I doing wrong?

html {
margin: 30px 0px;
padding: 0;
}

body {
padding: 0;
}


i have no Opera, but i would suggest to set padding and margin in body
instead of html.

html {
/* nothing */
}

body {
padding: 30px 0px;
margin: 30px 0px; /* set either padding or margin, try your luck */
}

if this doesnt work, please ignore this post
Jul 21 '05 #2
"Blacksmith" <in*****@email.address> wrote:
Here is the code you can just copy into an HTML file to view the results:


Provide an url instead, it's easier for us and better since it includes
variables otherwise unknown.

--
Spartanicus
Jul 21 '05 #3
hey, that actually worked! thanks very much.
"Ali Babba" <Al******@40Bandits.com> wrote in message
news:cu**********@news.hispeed.ch...
Blacksmith wrote:
Hi, I'm a CSS noob, and I'm trying to implement a very basic layout but
am having problems in certain browsers.


me 2
I also want a margin at the top and bottom of the
centred box of a fixed height (30px).

However, in Opera 7.54, there is NO margin at the bottom of the window.
Instead, the footer hugs the bottom of the browser window. I've been
trying to work out why this is happening for a few days now, but I don't
know what's going on. What am I doing wrong?

html {
margin: 30px 0px;
padding: 0;
}

body {
padding: 0;
}


i have no Opera, but i would suggest to set padding and margin in body
instead of html.

html {
/* nothing */
}

body {
padding: 30px 0px;
margin: 30px 0px; /* set either padding or margin, try your luck */
}

if this doesnt work, please ignore this post

Jul 21 '05 #4

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

Similar topics

4
by: Manuel | last post by:
I want to create a table in which 2 images "connect" vertically with each other. Mozilla does this without a problem, but IE keeps putting a small whitespace between the bottom of the image and the...
4
by: Christopher | last post by:
This should be a quick one. URL: http://cfa-www.harvard.edu/~cpilman/Stuff/flush.html Code: ============================= <!DOCTYPE HTML Public "-//W3C//DTD HTML 4.01//EN">...
2
by: Michael Winter | last post by:
I have the familiar 'thumbnail' scenario. I want to place a small border around the image when the cursor hovers above it. I use a 1 pixel, solid border around the image that changes between normal...
10
by: Markus Ernst | last post by:
Hi I have a strange problem with vertical-align. The case can be viewed at http://www.brainput.info/geschichte.html. HTML code: <div id="bild"><img src="geschichte.gif" width="274"...
1
by: Trent L | last post by:
Hello, I'm having a problem where a style for a <a> tag isn't working in IE: border : 1px solid red; If you use my code below, you'll see what I mean. In IE6 on WinXP, I'm not seeing a red...
5
by: Richard Shewmaker | last post by:
Hi. I've been using CSS for basic stuff, mostly concerning fonts. I want to get going with using CSS fully. Two days ago I purchased O'Reilly's "Cascading Style Sheets" and "CSS Cookbook." I've...
0
by: GTalbot | last post by:
Hello fellow stylesheet colleagues, Load this url: http://www.gtalbot.org/BrowserBugsSection/DefaultTopBottomMarginsForPargDisappear.html I would appreciate it if someone could explain 1-...
2
by: GTalbot | last post by:
www.authoring.html] Hello fellow HTML and markup coder colleagues, Please visit this url: http://www.gtalbot.org/BrowserBugsSection/DefaultTopBottomMarginsForPargDisappear.html I would...
7
by: GTalbot | last post by:
Hello fellow authoring.stylesheets colleagues, Can someone please explain why the bottom margin of the last inflow block-level child in an overflowed parent should not have its margin reachable....
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
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
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
agi2029
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 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.