RSS Forums RSS
Please support our HTML and CSS advertiser: Lunarpages Web Hosting

Layout issue

Join Date: Jan 2007
Posts: 2,640
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 118
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Layout issue

  #2  
Apr 23rd, 2007
It works fine for me. I have Firefox 2.0.

One thing you have to be aware of is how the browser constructs a box object (such as a td):

- Some browsers include the margins, border, and padding of a box object INSIDE the specified dimesions of the box. So the actual contents of the box must be smaller.

- Other browsers place the margins, border, and padding of a box object OUTSIDE the specified dimesions of the box. So the actual contents of the box fit the dimensions, but the box object as a whole takes up more space than tyhe specified dimensions.

The hard part is making anything with declared absolute dimensions work the same on all browsers. But there is a trick to it.

Suggestion 1: Make everything relative. DON'T specify absolute pixel sizes, but let the contents or surroundings of a box determine its size.

Suggestion 2: You can shrink it down to no difference by setting the margins, borders, poaddings, and cellspacings to zero.

Suggestion 3: Nest several boxes. Set them up with the following properties:

- The innermost box contains what you want in the box. It has zero settings on the surrounding attributes listed above. You can define the size of this box.

- The box containing the innermost box is otherwise empty, and has margins, borders, and/or paddings set to the sizes wanted. Note that, since the size of this box is not defined, it doesn't matter if the surrounding elements are inside or outside the box. It will be the same size either way.

- An outermost box with zero settings on the surrounding elements can contain the entire set of boxes listed above. It can have its settings defined instead of defining the settings of the innermost box, and it won't change size with different browsers.
Daylight-saving time uses more gasoline
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:05 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC