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

Basics for making a Firefox div contain contents wider than port

I am frequently doing something like the following:

<div style="width:95%; padding:10px;margin:5px;">
<table>Contents include stuff that won't compress beyond a certain
point.</table>
</div>

In IE6, either mode, as the port shrinks to less than the width of the
table, either through a small screen size or shrinking the browser
window, the right edge of the div maintains its 10px padding with the
table. But in FF, as the port shrinks, the <div> shrinks with it,
leaving the table extending outside the div.

I'm guessing this is an IE non-standards-based feature, but it is
darned useful. Suggestions appreciated... got to be a common issue.
I'm hack-literate... just need to know the trick.

Sep 30 '05 #1
2 3362
On Fri, 30 Sep 2005 18:19:51 +0200, Alan <ag*********@yahoo.com> wrote:
I am frequently doing something like the following:

<div style="width:95%; padding:10px;margin:5px;">
<table>Contents include stuff that won't compress beyond a certain
point.</table>
</div>

In IE6, either mode, as the port shrinks to less than the width of the
table, either through a small screen size or shrinking the browser
window, the right edge of the div maintains its 10px padding with the
table. But in FF, as the port shrinks, the <div> shrinks with it,
leaving the table extending outside the div.

I'm guessing this is an IE non-standards-based feature, but it is
darned useful. Suggestions appreciated... got to be a common issue.
I'm hack-literate... just need to know the trick.


Specify 'min-width' instead of 'width'. This isn't supported by MSIE
though, so you might have to use a hack to give MSIE 6 the 'width'
property and modern browsers the 'min-width' property.

Something like this:

div {
width: 95%;
min-width: 95%;}

html>body div {width: auto;} /* reset 'width' property to automatic for
Opera and FF etc*/

--
Get Opera 8 now! Speed, Security and Simplicity.
http://my.opera.com/Rijk/affiliate/

Rijk van Geijtenbeek
Oct 1 '05 #2
Tx... min-width solved the FF problem, and IE was already fine, since
in effect it imposes a min-width equal to the width of the contents.

Oct 3 '05 #3

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

Similar topics

1
by: Bart Plessers \(artabel\) | last post by:
Hello, Currently developping a site, where I use some session variables. The site is located at my home computer. Because I have a dynamic IP adress, I use no-ip (www.no-ip.org) to have my...
26
by: Spondishy | last post by:
Hi, I have a problem with divs and padding in IE6 and Firefox. Basically my example that I have attached works exactly how I want in IE6, but padding is treated differently in Firefox. My...
13
by: Tony | last post by:
Hi everyone, I am new to javascript (and new to programming). I want to have to drop down menus. One will ask use to select from one of the 50 states. The second one will be ask user to select a...
15
by: Dan | last post by:
Hi. I've got the following line of code which works fine in IE ... line_1_numbers = document.getElementsByTagName ('table').rows (0).cells (0).innerText; But it Firefox, it barks saying: ...
2
by: Stewart | last post by:
Originally posted in comp.lang.javascript: Newsgroups: comp.lang.javascript From: "Stewart" Date: 23 Aug 2005 02:50:04 -0700 Local: Tues, Aug 23 2005 10:50 am Subject: FireFox, RemoveChild,...
5
by: Martin Chen | last post by:
I have a frame set (as per MS FrontPage 2000). It has a contents and a main frame. The contents frame has a menu bar written with with javascript (in the context of a table). In IE6.1 everything...
0
by: Patrick.O.Ige | last post by:
I have a Datalist below its inside another datalist In IE it renders fine which means the first td cell with width = 130px is wider than the others So any text in there if its too long goes to the...
2
by: cbjewelz | last post by:
Hey all. So I'm having problems with cross browser alignments. I'm looking at Safari and Mozilla Firefox. I develop in Safari and so it looks perfect there however in Firefox my vertical...
7
by: Dr J R Stockton | last post by:
I want page <URL:http://www.merlyn.demon.co.uk/js-quick.htmto open, in IE6, IE7, Firefox 2, and wherever else practicable, with the control labelled F.X0 fully visible at the top of the window and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: 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...

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.