Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > CSS problem in Safari

CSS problem in Safari
Thread Tools
triplezoom
Fresh-Faced Recruit
Join Date: Sep 2003
Location: Fredericton NB
Status: Offline
Reply With Quote
Apr 29, 2004, 02:58 PM
 
This is driving me nuts!

Take a look at this page in Safari: http://dev.caradmin.com/

I want that background to repeat only on the X axis. Here's the code for my <tr> tag for the main content area:

<tr style="background-image: url(resource/img/content_bg.jpg); background-repeat: repeat-x; background-color: #8C8B97;">

It works fine under IE/XP. Any suggestions?
iMac 24" Core 2 Duo 2.16 GHz / iMac 20" Core 2 Duo 2.16 GHz /
PowerBook 12" G4 1.33 GHz / Power Mac G4 400 MHz / Apple TV / iPod 30 GB
     
DUNSEL
Forum Regular
Join Date: Feb 2004
Location: Manhattan
Status: Offline
Reply With Quote
Apr 29, 2004, 03:22 PM
 
More potentially bad news. Mozilla shows a gap between the text and the top image border there (where it says welcome).

Opera kinda messes it up too, but differently than Mozilla. "don't have an account?" and the highlight border below it, are both too far down in Opera. And the BG is messed up under "Welcome"
I saw a woman with a sweatshirt that said "Guess", so I said, "Implants?"
     
bwahahax
Forum Regular
Join Date: Apr 2003
Location: Toronto, Canada
Status: Offline
Reply With Quote
Apr 29, 2004, 03:22 PM
 
I don't know if this will solve your problem or not, but the url for your background-image should appear in quotation marks.

Like this:

background-image: url("resource/img/content_bg.jpg");
     
DUNSEL
Forum Regular
Join Date: Feb 2004
Location: Manhattan
Status: Offline
Reply With Quote
Apr 29, 2004, 03:28 PM
 
YEah, that's right. Good catch.
I saw a woman with a sweatshirt that said "Guess", so I said, "Implants?"
     
triplezoom  (op)
Fresh-Faced Recruit
Join Date: Sep 2003
Location: Fredericton NB
Status: Offline
Reply With Quote
Apr 29, 2004, 03:36 PM
 
Originally posted by bwahahax:
I don't know if this will solve your problem or not, but the url for your background-image should appear in quotation marks.

Like this:

background-image: url("resource/img/content_bg.jpg");
If I put it in double quotes, the background doesn't appear at all. I tried single quotes, and it appears, but does not fix the problem.
iMac 24" Core 2 Duo 2.16 GHz / iMac 20" Core 2 Duo 2.16 GHz /
PowerBook 12" G4 1.33 GHz / Power Mac G4 400 MHz / Apple TV / iPod 30 GB
     
DUNSEL
Forum Regular
Join Date: Feb 2004
Location: Manhattan
Status: Offline
Reply With Quote
Apr 29, 2004, 03:42 PM
 
Because you're using neither elipses, nor the full path to the pic. Just for testing purposes, put the img in the same folder, and use local addressing, with the "" around it, just to see if there's any relation to this problem.
I saw a woman with a sweatshirt that said "Guess", so I said, "Implants?"
     
bwahahax
Forum Regular
Join Date: Apr 2003
Location: Toronto, Canada
Status: Offline
Reply With Quote
Apr 29, 2004, 03:47 PM
 
I'm not sure why that would be happening. Here is the proper syntax for including a background image in an element. This is a great site for learning more about cascading style sheets because you are actually able to fool around with them online.

http://www.w3schools.com/css/css_background.asp
     
Synotic
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 29, 2004, 04:00 PM
 
I fooled around with it and the source of the problem seems to be that Safari doesn't support applying any background properties other than an image/color on table rows. It's pretty interesting... either I'm missing something or this is an oversight. In the meantime can you just apply the background to your table cells?
     
registered_user
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status: Offline
Reply With Quote
Apr 29, 2004, 07:51 PM
 
works fine for me

http://members.cox.net/registered_user/test/tr.html

if you spy the source code, you'll see that I've made the call in a style sheet in the header, but commented it out just to be sure that the inline styles would do the work.

You need to use single quotes because the attribute is marked with double quotes.
     
Synotic
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 29, 2004, 08:26 PM
 
Originally posted by registered_user:
works fine for me

http://members.cox.net/registered_user/test/tr.html

if you spy the source code, you'll see that I've made the call in a style sheet in the header, but commented it out just to be sure that the inline styles would do the work.

You need to use single quotes because the attribute is marked with double quotes.
Erm... I'm not sure what version of Safari you're using but your example only seems to illustrate the problem:



Are you using the Jaguar version of Safari?
     
registered_user
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status: Offline
Reply With Quote
Apr 29, 2004, 09:04 PM
 
oh... repeat x... I seem to have missed that part.

Man, I'm just sleepin' at the wheel here. Nevermind me.

edit: whoa... that is weird... must be software and it doesn't seem to respond well to background-position or anything else for that matter.
( Last edited by registered_user; Apr 29, 2004 at 09:14 PM. )
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Apr 30, 2004, 03:39 AM
 
Originally posted by Synotic:
I fooled around with it and the source of the problem seems to be that Safari doesn't support applying any background properties other than an image/color on table rows. It's pretty interesting... either I'm missing something or this is an oversight. In the meantime can you just apply the background to your table cells?
I'd be inclined to think that it's just a missing feature (oversight) in Safari up till now. Seems Dave Hyatt is doing work with table cells, so we might see proper support soon. See here.

At least it only seems to be when background-repeat is tied to table cells that it doesn't work. Maybe this is Dave's way of telling us not to use tables for layout
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 03:27 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,