Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tech4all

macrumors 68040
Original poster
Jun 13, 2004
3,399
489
NorCal
OK in Dreamweaver I made a single cell table with a graphic in the middle of it. The table is set to 100% both horizontally and vertically so that it will scale according to the size of the window - and the graphic is set to center horizontal and vertical to. However when I preview it in Safari only the horizontal goes to fit the current width of the browser window, while the vertical size only stays at the vertical size of the graphic. It won't go with height of the window.

But when I preview in Internet Explorer, it works fine. Is this a bug in Safari 2.0?

Any ideas?


btw: No, I am not making the webpage scaling with the window with a graphic in the middle. I just need to have these settings for something else I want to do with it.


EDIT: I checked the compatability report and it says the height attributes of the table are not supported. (Netscape Navigator 7.0)

Anyway to make it compatible?
 

tech4all

macrumors 68040
Original poster
Jun 13, 2004
3,399
489
NorCal
theappleguy said:
Try using CSS instead of tables. :)

I actually am using some CSS for the text on the site, although I'm still learning CSS and how it works and how I could use it with different things. But that's a good idea, I'll give it a shot. Thanks!
 

tech4all

macrumors 68040
Original poster
Jun 13, 2004
3,399
489
NorCal
Does anybody know how I would write the CSS to center a graphic in a window both horizontally and vertically? I tried some stuff in Dreamweaver and searched Google but haven't found anything that works.

Thanks :)
 

pulsewidth947

macrumors 65816
Jan 25, 2005
1,106
2
I got this problem too.. annoying isnt it :)

Yeah I guess the CSS way is the way forward, but I've had bad experiences with CSS - I did my layout purely in CSS, then it didnt work with any browsers other than Safari or Opera. Certainly down to my sloppy code, and IEs rubbish interpretation of CSS, but it put me off!
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,219
2
San Diego, CA
pulsewidth947 said:
I got this problem too.. annoying isnt it :)

Yeah I guess the CSS way is the way forward, but I've had bad experiences with CSS - I did my layout purely in CSS, then it didnt work with any browsers other than Safari or Opera. Certainly down to my sloppy code, and IEs rubbish interpretation of CSS, but it put me off!

If you're having issues with CSS always run it through the CSS validator before you go trying to "fix" display issues in one browser or the other.

Valid CSS doesn't guarantee proper display but it sure makes it a lot easier to troubleshoot it. It also helps to test in a couple different browsers as you go to catch mistakes early on.
 

tech4all

macrumors 68040
Original poster
Jun 13, 2004
3,399
489
NorCal
Thanks for all the responses :)

mnkeybsness said:
using the background...

Code:
div#theImageID {
background: url(path/to/theimage.jpg) center center no-repeat;
}[/QUOTE] 

I was having some confusion with this code. Where exactly does it go? Does it go in the background tag? Shouldn't it go where the rest of the CSS code is?

And where it says: "div#[B]theImageID[/B]", is that just the name of the image I give it in Dreamweaver?

And lastly with the: "url(path/to/theimage.jpg". I get the path part, but not sure about the formatting there. Does it go: "url(website/images/picture.jpg)" or just "website/images/picture.jpg"?

[QUOTE=ChicoWeb]It's because height=100% is not a valid attribute

You can fudge it w/ css.[/QUOTE]

Are you sure (not that I doubt your knowledge ;))? Because I tested in IE and it worked fine. And I could of sworn I did it once.
 

Oryan

macrumors 6502a
Apr 1, 2005
595
0
Lincoln, NE
And lastly with the: "url(path/to/theimage.jpg". I get the path part, but not sure about the formatting there. Does it go: "url(website/images/picture.jpg)" or just "website/images/picture.jpg"?

I haven't used CSS in a while, but I think it is: url(website/images/picture.jpg)
 

ChicoWeb

macrumors 65816
Aug 16, 2004
1,120
0
California
tech4all said:
Are you sure (not that I doubt your knowledge ;))? Because I tested in IE and it worked fine. And I could of sworn I did it once.

Yep, IE does it wrong ;) Thats the issue that everyone has w/ IE is the fact that they don't develop their software to standards, they develop it for the avg person to design and use, thus a lot of syntax errors, broken box, height, all happen :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.