| | |
Doctype difficulties
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2005
Posts: 15
Reputation:
Solved Threads: 0
I have never used DOCTYPES on my websites, but I noticed that with my current coding, adding padding to an image only shows up in Firefox, but not in IE (ex: http://avrilhq.com - "T in the Park Photos" update on 10 Jul 2007). I noticed that other sites with this effect have doctypes.
When I added a doctype (any doctype - I've tried them all), the padding shows in the images in IE, and everything looks fine, however it now looks like this: http://img338.imageshack.us/img338/2159/messedupvq8.jpg in Firefox. It seems like nothing can look right in both browsers. Is something I can do to fix this? Thanks in advance?
When I added a doctype (any doctype - I've tried them all), the padding shows in the images in IE, and everything looks fine, however it now looks like this: http://img338.imageshack.us/img338/2159/messedupvq8.jpg in Firefox. It seems like nothing can look right in both browsers. Is something I can do to fix this? Thanks in advance?
Last edited by Evanzgurl; Jul 10th, 2007 at 8:38 pm.
The problem is not doctypes, but the actual difference in the way IE and Firefox treat box objects.
When you define the size of a box object, IE uses that size as the outside edge of the margin. So the margin, border, and padding are all INSIDE that dimension.
When you define the size of a box object, FF uses that size as the inside edge of the padding. So the margin, border, and padding are all OUTSIDE that dimension.
So the trick is to make sure the box object you define a size for has no margin, border, or padding.
Your images are breaking apart, which means they are not uploaded as single images. Why are you doing that? It's stupid. Upload images as complete image files, and they will stay together.
I can see where padding or margins on objects causes the sliding over of some objects. Use the following style as a class to take away these attributes from your box objects, and they will fit together properly:
[code]
.fxbox {margin: none; border: none; padding: none;}
When you define the size of a box object, IE uses that size as the outside edge of the margin. So the margin, border, and padding are all INSIDE that dimension.
When you define the size of a box object, FF uses that size as the inside edge of the padding. So the margin, border, and padding are all OUTSIDE that dimension.
So the trick is to make sure the box object you define a size for has no margin, border, or padding.
Your images are breaking apart, which means they are not uploaded as single images. Why are you doing that? It's stupid. Upload images as complete image files, and they will stay together.
I can see where padding or margins on objects causes the sliding over of some objects. Use the following style as a class to take away these attributes from your box objects, and they will fit together properly:
[code]
.fxbox {margin: none; border: none; padding: none;}
Last edited by MidiMagic; Jul 13th, 2007 at 6:45 am.
Daylight-saving time uses more gasoline
![]() |
Similar Threads
- DOCTYPE problem? (JavaScript / DHTML / AJAX)
- Difficulties with apache2 and cicumventor (IT Professionals' Lounge)
- New Window in CSS (strict doctype) (HTML and CSS)
- Javascript - Expected J and Expected Object errors (JavaScript / DHTML / AJAX)
- Doctype? (HTML and CSS)
Other Threads in the HTML and CSS Forum
- Previous Thread: div align=center
- Next Thread: display problem with diffrent browser.
Views: 777 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
2002 appointments asp background backgroundcolor beta browser bug calendar cart center cgi code codeinjection corporateidentity create css deleted design development displayimageinsteadofflash dreamweaver drupal emailmarketing epilepsy explorer firefox flash font fonts form format free frontpage google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft missing mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. templates textcolor theme timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 wordpress xml xsl






