Connecting Tech Pros Worldwide Help | Site Map

Help formatting image with different browsers

Member
 
Join Date: Apr 2009
Posts: 36
#1: Sep 29 '09
Hi,
I am working on a page where I am trying to get an image to right align, but depending on the broswer (even different versions of IE) it will either center it,left align or it will put a border around it.

here is the code i used to format the pic:


Expand|Select|Wrap|Line Numbers
  1. .logo
  2. {
  3.     display: block;
  4.     text-align: right;
  5.     float: right;
  6.     margin-top: -35px;
  7.     border: 0px;
  8. }

Also here is a link. The echoapps logo is the image i am trying to format.
http://www.echoapps.com/quicktour/index.html
Newbie
 
Join Date: Sep 2009
Posts: 2
#2: Sep 29 '09

re: Help formatting image with different browsers


The style you have for .logo works fine. the problem I see using firefox (and I'm sure other browsers) is that after the style for img.picture1 you have an extra closing brace '}' . IE likes to pretend it knows what you wanted and considers standard to be 'fluid', so it will ignore such mistakes. Other browsers adhere to strict interpretations of the standards and will see that as an error and ignore the rest of your styles.
Member
 
Join Date: Apr 2009
Posts: 36
#3: Sep 29 '09

re: Help formatting image with different browsers


I think i cleaned that up earlier, but still have the same results. Anything else that could be causing it?
Newbie
 
Join Date: Sep 2009
Posts: 2
#4: Sep 29 '09

re: Help formatting image with different browsers


I may have posted the wrong style, look right after img.picture, not picture1

I copied your javascript and style source code right off your web page in my browser and created a test page on my server using one of my images. Removing only that one errant brace caused my test image to go from left aligned with a box to right aligned wioth no box. As far as I can tell, that is what your problem is.
Member
 
Join Date: Apr 2009
Posts: 36
#5: Sep 29 '09

re: Help formatting image with different browsers


YES!!!

Thanks that did the trick. I also had a extra brace under picture1 this morning that I removed and I thought that was what you were referring to.

Thanks for your help!!!
Member
 
Join Date: Apr 2009
Posts: 36
#6: Sep 29 '09

re: Help formatting image with different browsers


An interesting sidenote that is totally fine with me-

firefox takes the ajax and rounds the corners of the table where IE does not.
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,561
#7: Sep 30 '09

re: Help formatting image with different browsers


Quote:

Originally Posted by jrod11 View Post

depending on the broswer (even different versions of IE)

IE8 does not work like IE7 compatibility mode which doesn't work like IE7 which doesn't work like IE6 which doesn't work like anything anyone could dream up.

Validate your HTML for that list of errors that need correcting.
Reply


Similar HTML / CSS bytes