473,799 Members | 2,927 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Images breaking nested div layout in firefox (works fine in IE)

8 New Member
first of all, hello (first time poster).

the url in question: http://www.type3studios.com/?projects

(i guess you can grab the html and css from there, but if you want, i'll post it.)

EDIT: if you do grab my css and html, you're mainly looking for the .block, .blocka, and .blockb sections.

on that site, i'm using the "unordered list of divs with display:table-row and display:table-cell" trick to set up several rows of 3 boxes each. they work fine without images as shown below.

(in case this url changes, i'm including some pictures to help explain)



that is in firefox. as you can see the layout fits within the page. note the areas with the text 'main screenshot' - that is the alt value for my images.

now... here is the same page with the images



i'm not sure what's causing this, but the <li> sections are becoming huge, and my .blocka and .blockb (which are within the <li>) are dropping below where they should be.

here is the same page with images in IE (this is how i want it to look in firefox). note however that in my html source, i specify different styling to use for IE, since display:table-row and display:table-cell don't work properly.

Aug 10 '07 #1
19 4111
drhowarddrfine
7,435 Recognized Expert Expert
I'm walking out the door for the weekend but things you can check:
1) Validate your html for one error and CSS for four. There is no such thing as 'float:center'.
2) Check your divs for this IE bug. IE expands elements to contain floated and absolutely positioned elements. This is incorrect behavior but could be causing the problem.

Sorry I don't have time to do more.
Aug 10 '07 #2
vecima
8 New Member
thank you for your reply.

NOTE: the page in question has been moved to:
http://www.type3studio s.com/test/?projects

the CSS now validates, but the HTML validation fails because i used a div with nothing in it, but with a background image for the main site "banner" image. (so i could easily switch out the image with the style switcher at the bottom). anyhow, i don't think that error is affecting this one.

while i thank you whole heartedly for your response, i'm not sure if you understood my original post... the page works fine in IE, but breaks in Firefox. That in and of itself seems backward ;-) most of the time working on updating this site it's been IE that's needed tweaks, but in this particular case it's the other way around.

anyhow, I'll keep tinkering and if you or anyone else has any ideas, be sure to let me know!
Aug 11 '07 #3
vecima
8 New Member
well, i seemed to have answered my own question.

i replaced the following CSS code:

Expand|Select|Wrap|Line Numbers
  1. .block ul {
  2.     display: table-row;
  3.     list-style: none;
  4.     margin: 0;
  5.     padding: 0;
  6.     border: none;
  7.  
  8.     height: 150px;
  9.     min-height: 150px;
  10.     max-height: 150px;
  11. }
  12.  
  13. .block li {
  14.     display: table-cell;
  15.     text-align: center;
  16.     margin: 0;
  17. }
with this:

Expand|Select|Wrap|Line Numbers
  1.     .block ul {
  2.         display:block;
  3.         float:left;
  4.         list-style: none;
  5.         margin: 0;
  6.         padding: 0;
  7.         border: none;
  8.     }
  9.  
  10.     .block li {
  11.         display:block;
  12.         float:left;
  13.         text-align: center;
  14.         margin:0;
  15.     }
the new code is what i was telling IE to do all along. I could of swore I tried it before, but when I tried it again, IE and firefox now display the same (in a good way this time! :-) )

thanks for your help, and i'm sure i'll be back to ask some more questions!
Aug 11 '07 #4
vecima
8 New Member
hello again. I've fixed the initial problem, but i'm having another, and since it's on the same page (here), and a similar situation, i figured i'd just use the same thread.
again, IE is displaying as i wish, and firefox is a bit off.

this first shot is from IE: (notice how the 'thumbnail' images fit within the row).



the next shot is from Firefox: (notice the space between the images, and how the bottom two overflow onto the gray bar beneath).



the css styling these images is here:
Expand|Select|Wrap|Line Numbers
  1. a:link img {
  2.     border: 2px solid #3d5e57;
  3. }
  4. a:visited img {
  5.     border: 2px solid #3d5e57;
  6. }
  7. a:hover img {
  8.     border: 2px solid #a6f5fa;
  9. }    
  10. a:active img {
  11.     border: 2px solid #a6f5fa;
  12. }
any ideas on how to make them both show the images closer together (like the IE rendering)?
Aug 14 '07 #5
drhowarddrfine
7,435 Recognized Expert Expert
i'm not sure if you understood my original post... the page works fine in IE, but breaks in Firefox. That in and of itself seems backward ;-)
Yes it is backwards because you are trying to compare what IE is doing and implying Firefox is doing something wrong. However, even though IE is doing what you want, it isn't doing it correctly.

1) IE is in 'quirks mode', meaning it is using its "broken box model". The reason is that you have 'stuff' before the doctype. Remove all comments and spaces of any kind before the doctype to get IE out of quirks. Firefox, otoh, is not in quirks because it doesn't have this sort of problem.

2) The validator complains you have a misplaced <div>. This needs to be fixed.

Now, how those two items affect your page, I don't know because I can't fix the first one and don't have time right now to fix the second (just got back from out of town). But it is hard enough to debug valid code than try and mess with invalid code. This I think you already know.
Aug 14 '07 #6
vecima
8 New Member
thanks again for clarifying.

i've fixed the <div> situation, and moved my doctype declaration to the top of the page, and the validator declared it valid, however the validator told me about my mime type conflict (serving text/html rather than application/xhtml+xml). it also provided me a link from which i copied in the following php code:

(from http://juicystudio.com/article/content-negotiation.php )
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.     header("Vary: Accept");
  3.     if (stristr($_SERVER[HTTP_ACCEPT], "application/xhtml+xml")) 
  4.         header("Content-Type: application/xhtml+xml; charset=utf-8");
  5.     else
  6.         header("Content-Type: text/html; charset=utf-8");
  7. ?>
apparently this code needs to be at the top of the document, or else i get the folowing errors:

Warning: Cannot modify header information - headers already sent by (output started at E:\xampp\htdocs \xampp\Type3\in dex.php:3) in E:\xampp\htdocs \xampp\Type3\in dex.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at E:\xampp\htdocs \xampp\Type3\in dex.php:3) in E:\xampp\htdocs \xampp\Type3\in dex.php on line 6
if i do place the php code at the top, with the doctype immediately following, the site is rendered with a white border around it, and the validator still tells me about a mime type conflict anyway.


for the time being, i've deleted the php code, moved the doctype to the very top and used this meta tag:
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

i still get the warning about mime types, but the page does validate. if you think it's necessary i'll try further to allow the site to serve application/xhtml+xml, but currently i think many sites leave it as i have it now (correct me if i'm wrong).

now that all of that is out of the way, the site is still rendering exactly as it was in the images in my previous post. if IE is still rendering in 'quirks' mode, there must be something else causing it. notice in the firefox shot that the images run over onto the next gray bar beneath, which itself is enlarged for some reason. also notice that IE seems to use the same distancing between images vertically and horizontally, whereas firefox seems to use more distancing vertically between the images. this is what i want to 'correct' - i understand that it may not be 'wrong' but at any rate, i would like it to display in firefox as it is doing in IE.

i also noticed a problem with my style switching mechanism. the links are at the bottom of the page. it works fine in firefox, but in IE is a bit odd.

thanks again for your help.
Aug 15 '07 #7
TRScheel
638 Recognized Expert Contributor
You are coding HTML in a backwards manner... Code for firefox, fix for IE. Dont code for IE than fix for firefox because it will be a convulated mess.
Aug 15 '07 #8
vecima
8 New Member
i actually have been coding for firefox and fixing for IE.

in this particular case i tried something that i expected to work in firefox, and when it didn't, i checked it in IE, and by chance it looked as i expected it to. the fact that this happened twice in a row is to me as mind boggling as it is frustrating.
Aug 15 '07 #9
TRScheel
638 Recognized Expert Contributor
i actually have been coding for firefox and fixing for IE.

in this particular case i tried something that i expected to work in firefox, and when it didn't, i checked it in IE, and by chance it looked as i expected it to. the fact that this happened twice in a row is to me as mind boggling as it is frustrating.
I can imagine... I have a squishy ball next to my desktop machine for working on HTML for this very reason.

Did you try setting the margins/padding on the images? Have you read into a global reset CSS file (and no, not the * everything reset files).'

Page on Global Reset

DO NOT DO (or any variation of this):

Expand|Select|Wrap|Line Numbers
  1. /* CSS global reset for all browsers */ 
  2. * {
  3.     padding: 0;
  4.     margin: 0;
  5.    }
  6.  
Aug 15 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

9
4078
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...
2
1906
by: Trent | last post by:
Hey All, I am new to javascript and currently coding a site with scripts that are beyond my level of understanding. The problematic page has thumbnail images that can be clicked on to zoom in. When clicked, the preloaded larger image displays in a div layer that gets turned on. The problem is that ie sometimes does not display the image - the placeholder just stays blank. The script works fine in firefox and netscape (haven't tried...
5
5336
by: ~~~ .NET Ed ~~~ | last post by:
Hi, As you all know when an ASP.NET web form is created that will include web controls and such, it contains a FORM that that identifies the web form and its containing controls. Well, I have a web form who has several other (user & custom) controls, these are enclosed within the standard FORM tag. Additionally *some* of these user controls are actually forms as well. This results into nested Forms.
3
1419
by: Roy | last post by:
Here's my problem for the curious consumption of the group mind... I have an embedded datagrid which works fine. The child grid is nested within the parent using a templatecolumn tag. Using the TR html tag I can get the child rows to appear below the parent rows (i.e., "tree-view style"), BUT I can't get the parent rows to display in a grid layout. They appear as clumped-up text and all the data runs together in a line. In other words,...
11
12326
by: Ben Holness | last post by:
Hi all, I am having some trouble with some table code. It works fine in Internet Explorer, but the layout doesn't work correctly in Firefox 1.0.7 Is this a firefox bug, or am I missing something in the HTML? It is pretty simple code! (Plus it is valid according to the w3c validator) The layout problem is in the third row. I cannot get the embedded table (with the top and bottom cells) to be the full height of the cell (unless
61
4757
by: phil-news-nospam | last post by:
Why does SVG need a different tag than other images? IMHO, SVG should be implemented as an image type just like any other image type, allowing it to work with <img> tags, and ... here is the important part ... also work with backgrounds in other tags. I fail to see any wisdom in making SVG different than say PNG (of course the implementation of the rendering code would obvious be different). --
3
4881
by: blaq | last post by:
My latest project is almost done. It looks great in Firefox; I only have two IE bugs left to squash, yay! Please refer to http://www.blaqzone.com/Temp/Popfuel/ . Crib notes: - "reset.css" is a safety net that establishes some basic values. Coded by Matt Wilcox, found at meyerweb.com/eric/thoughts/2004/09/15/emreallyem-undoing-htmlcss/#comment-989 ..
3
9514
by: littleark | last post by:
Hi everybody, I have a typical javascript images preloader, it works fine both on Firefox and on IE in my intranet (local server). It works fine on the Internet (remote server) in IE. In Firefox it stops before loading every image. Does image.onload function have some problems with little images?
2
2657
Stentorian
by: Stentorian | last post by:
Hello, I am having trouble with skinny images in Safari on a Mac (This works fine in Safari beta for windows!) Basically I have set up a CSS class using 'max-width' to ensure that images do not expand beyond 100px. I have included the hack for IE. Works fine on a PC in IE, Firefox, Opera and Safari. But in Safari on a Mac the width is confined, but the image does not scale, the height remains the actually height of the image and so I...
0
9687
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
9541
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,...
1
10225
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
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
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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.