473,809 Members | 2,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS Boxes and Auto Margins Problems

Hello Everyone,

I've been working with CSS trying to understand it and incorporate it
into a revised version of my web page. I've noticed a few problems
which perhaps someone could shed some light on.

1) I've attempted to create an empty box with an inset border and a
width of 782px. What I've noticed is that in IE 6 the border does not
change the size of the box. However, I've noticed that in Netscape
7.02, the border actually causes the box to be larger. This is a
problem because the box becomes wider than the adjacent header graphic
I've made. Is there anything I can do to solve this? My class for
the box is below.

div.content {
background: #d8d9d7;
position: absolute;
left: 118px;
top: 150px;
width: 782px;
border: inset;
}

2) I've used auto margins (top, bottom, left, and right) with my
content because I want the webpage content to be centered. I've
placed my header graphic on my page followed by a box containing text,
etc. The problem is that IE seems to have a non-zero size auto top
margin yet Netscape does not. This results in a small gap between the
header graphic and the box. Any ideas on a workaround for this? Is
this just a compatibility problem amongst the browsers?

I would appreciate any help you could provide. Thanks!

-Bryan
Jul 20 '05 #1
4 2122
Bryan R. Meyer wrote:
1) I've attempted to create an empty box with an inset border and a
width of 782px. What I've noticed is that in IE 6 the border does not
change the size of the box.
In CSS the width refers to the width of the content.
In IE 5.5 and earlier the width refers to the space between the outside
edges of the borders (thus including the border and padding in the width).
IE 6 will emulate this bug if you fail to use a Doctype that triggers
standards mode.

http://gutfeldt.ch/matthias/articles/doctypeswitch.html
2) I've used auto margins (top, bottom, left, and right) with my
content because I want the webpage content to be centered. I've
placed my header graphic on my page followed by a box containing text,
etc. The problem is that IE seems to have a non-zero size auto top
margin yet Netscape does not. This results in a small gap between the
header graphic and the box. Any ideas on a workaround for this?


Set the top and bottom borders to 0.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Jul 20 '05 #2
Bryan R. Meyer wrote:
1) I've attempted to create an empty box with an inset border and a
width of 782px. What I've noticed is that in IE 6 the border does not
change the size of the box.
In CSS the width refers to the width of the content.
In IE 5.5 and earlier the width refers to the space between the outside
edges of the borders (thus including the border and padding in the width).
IE 6 will emulate this bug if you fail to use a Doctype that triggers
standards mode.

http://gutfeldt.ch/matthias/articles/doctypeswitch.html
2) I've used auto margins (top, bottom, left, and right) with my
content because I want the webpage content to be centered. I've
placed my header graphic on my page followed by a box containing text,
etc. The problem is that IE seems to have a non-zero size auto top
margin yet Netscape does not. This results in a small gap between the
header graphic and the box. Any ideas on a workaround for this?


Set the top and bottom borders to 0.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Jul 20 '05 #3
David,

Thanks for your help. With your assistance, my problems were easily resolved.

Thanks again!
Bryan
Jul 20 '05 #4
David,

Thanks for your help. With your assistance, my problems were easily resolved.

Thanks again!
Bryan
Jul 20 '05 #5

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

Similar topics

7
3282
by: Richard Lawrence | last post by:
Hi, Consider the following: #Content { margin:0px 210px 50px 200px; padding:10px; } If I use it with the following HTML:
5
6126
by: Robert Downes | last post by:
I'm using the following in a page that I'm testing in Mozilla: p.actionLinkBlock {border: 1px #000000 dashed; padding: 0.2cm; width: auto} But the dashed border is extending to the right-edge of the screen. I want it to only extend as far as it needs to to nicely contain the content within (a couple of links). Is width: auto the wrong property to do this? Is Mozilla rendering the style wrong?
9
4081
by: Dustin | last post by:
Here's what I am trying to do: (Names represent CSS classes.) I want to create a photo gallery. I want the entire gallery to be surrounded by a box named PhotoGallery. I want a fluid placement of the individual Items within PhotoGallery. An Item is a box that has two child boxes, PhotoBox and Caption. Photobox has an explicit width and height. PhotoBox contains an image whose dimensions may vary, but are constrained to be within...
12
2460
by: Secret Guy | last post by:
I'm trying to understand generally how to make a grid of variously sized boxes using CSS. The first idea I had was to make a box where I can see the margin, padding, border and content edges, and understand why they have the areas that they do. And I'm having trouble... I read in the 2.1 spec, that the height and width properties specify the height and width of boxes generated by applicable elements, and that a percentage value is taken...
5
3283
by: maya | last post by:
at work they decided to center divs thus: body {text-align:center} #content {width: 612px; text-align:left; margin: 0 auto 0 auto; } this works fine in IE & FF, EXCEPT in FF it doesn't work if I change 'auto' to 0 for left and right margin values; I have to leave those at 'auto'.. so I would like to know what exactly means 'auto' -- what value it represents exactly (and does it apply for all elements/values you might apply 'auto' to?)
11
2209
by: Gérard Talbot | last post by:
Hello, <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <title></title> <style type="text/css"> body {background-color: white; color: black;} #parent_block {background-color: red; width: 100%;} #nested_child_block {margin: 150px 0px; background-color: green; color: white;}
6
3686
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
1
2911
by: Dave | last post by:
Hello all, First I'd like to apologize...This post was meant to be put in my previous post, but I tried many times without success to reply within my previous post. Now here goes... I have a main form (RD Form) with 4 combo boxes (i.e. cbo1, cbo2, etc) and a subdatasheet (the subform...let's call it subInfo) below the combo boxes on the RD Form. I hope this eliminates any confusion of the
9
1846
by: Neviton | last post by:
Hi I want to create one layout with 3 columns. The left and right columns should have a auto-width. The center column should have a fixed size of 300px. By example: If the browser window width is 500px I need the left column have width=100px and right column have width=100px and center off course
0
9721
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
9600
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10633
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
10376
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...
0
9198
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6880
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
5548
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
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.