473,834 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.dt d">
<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 2980
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******@40Ban dits.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
9619
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 bottom border. This is my code: ------------------------ <table cellpadding="0" cellspacing="0" border="0"> <tr> <td> <img src='MyTopImage.gif'>
4
2664
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"> <HTML><Head><Title>Get my feet off the ground</Title> <Meta HTTP-Equiv="Content-Type" Content="text/html; charset=us-ascii"> <Style type="text/css"> Body { font-size: 60px; }
2
2687
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 and hover. This works fine in Internet Explorer, but in Opera 7.22, the bottom border is 3 pixels thick. If I expand all borders to 3 pixels, this bottom border is still 2 pixels thicker than the others, which suggests that padding or a...
10
66067
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" height="29" alt="Wir schreiben die Geschichte Ihres Unternehmens."></div>
1
7549
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 top and bottom border. My HTML validates. It looks
5
1935
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 been reading them and have tried some really basic stuff and am not having a very good time (lol). I'm feeling really stupid, to be honest. I was able to center an image on a page by mucking about with code primarily from the Cookbook. I only...
0
2056
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- why MSIE 7 render this simple webpage so differently from Firefox 2.0.0.9, Opera 9.50, Safari 3.0.3?
2
4908
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 appreciate it if someone could explain 1- why MSIE 7 render this simple webpage so differently from Firefox
7
3446
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. I read and re-read carefully the CSS 2.1 spec and I just can not see why. Related webpages: http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/MarginBottomChildNotRendered.html
0
9797
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10793
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10509
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7757
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6954
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5626
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5793
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3977
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3081
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.