fixed background not working

B

bluerobot2007

Hi all,

I am relatively new to HTML & (especially) CSS. A friend of mine is
editing her myspace profile & I volunteered to take a look at it
because she can't get the background image to stay fixed. You'd think
it would be simple....but I am having so much trouble with it! I feel
like I've tried everything I can think of & it won't work. There's
something I'm missing & it's driving me crazy! I also feel like some
things are unnecessary in there and it's put together weird. The
background image does show up, it's just not fixed. Please keep in mind
I am new at this....

((Also the background image appears 4 separate times throughout the
code & I changed the link (to "background image") just to keep her
stuff private. ))






Can someone please help me out? Here is the code:

Me: I'm blah blah blah <a href="http:/a linkeeee.html">mah place</a>.
<br>
some more text
<br>
<img src="http://the background image" /img>
<body background="the background image again"></body>
<style type="text/css">
body { text-align:center;
background-color:<the background image yet again">; }
table, td {background:transparent; border:0px;}
table table table {background-color:transparent;}
table table table {
border-width:2px;
border-color:9966FF;
border-style:dotted;
padding:1px; }
table table table table { border:0px; }
td, span, div, input, a, table td div div font,
body div table tbody tr td font {font-family:Century Gothic, Tempus
Sans ITC, sans-serif, Arial, Geneva !important;}
td, span, div, input, table td div div font,
body div table tbody tr td font {color:CCCCFF!important;}
..nametext, .whitetext14, .lightpurpletext10, .orangetext17,
..blacktext14,
..redtext, .redbtext, .blacktext12 {color:CCCCFF!important;}
a {color:CCCCFF!important; text-decoration:none !important;
text-transform:none !important; font-weight:normal !important;
font-style:normal !important;}
a:hover {color:000000 !important; text-decoration:none !important;
text-transform:none !important; font-weight:normal !important;
font-style:normal !important;}
img {border:0px;}
..text {align:left}
input {background-color:transparent !important;}
</style><br><br>

<body {background-image:url(http://same background image);
background-repeat: no-repeat;
background-attachment: fixed;}></body>
 
E

Els

Hi all,

I am relatively new to HTML & (especially) CSS. A friend of mine is
editing her myspace profile & I volunteered to take a look at it
because she can't get the background image to stay fixed. You'd think
it would be simple....but I am having so much trouble with it! I feel
like I've tried everything I can think of & it won't work. There's
something I'm missing & it's driving me crazy! I also feel like some
things are unnecessary in there and it's put together weird. The
background image does show up, it's just not fixed. Please keep in mind
I am new at this....

((Also the background image appears 4 separate times throughout the
code & I changed the link (to "background image") just to keep her
stuff private. ))

Can someone please help me out? Here is the code:

[snip really bad code with multiple body elements, of which some are
even empty (!) ]

If that's original MySpace code, I wouldn't bother trying to
understand why it doesn't wanna stay fixed. What you could do though,
is find a MySpace page with fixed background, and compare the code
with your friend's to see where it's different.
 
A

Andy Dingley

A friend of mine is editing her myspace profile & I volunteered to take a look at it

Two problems:

- You didn't tell us the URL, so we can't see it to fix it.

- It's MySpace. MySpace is evil and breaks every technical good
practice around regarding web authoring. It's either impossible to fix,
or more trouble to fix than I personally regard as worthwhile. Either
live with the MySpace defaults, or get some real web space.
 
J

JDS

I just got all excited because I saw a response.... :(

Ah. I see that there was code attached. Sorry about that. Can't debug it
though. Don't want to. I refuse to have anything to do with Myspace
 
J

Jim Moe

I am relatively new to HTML & (especially) CSS. A friend of mine is
editing her myspace profile & I volunteered to take a look at it
because she can't get the background image to stay fixed. You'd think
it would be simple....

<style type="text/css">
body { text-align:center;
background-color:<the background image yet again">; }
</style><br><br>
[...]
<body {background-image:url(http://same background image);
background-repeat: no-repeat;
background-attachment: fixed;}></body>
What a train wreck.
You cannot mixmaster HTML and CSS like that. Style rules can be only
placed or imported in the <head> section.
 
B

bluerobot2007

Yes that is what I thought. But if I take the HTML at the top out, it
takes the whole background out. Same with the CSS at the bottom.

How can I re-do it so it works??? I tried to put the style rules in the
head using only the CSS (taking out the HTML at the top, and the extra
body part at the bottom) & it didn't work...

This is making me a mad man. A MAD MAN, I TELL YOU!

Please have mercy on me.
 
J

Jonathan N. Little

Yes that is what I thought. But if I take the HTML at the top out, it
takes the whole background out. Same with the CSS at the bottom.

How can I re-do it so it works??? I tried to put the style rules in the
head using only the CSS (taking out the HTML at the top, and the extra
body part at the bottom) & it didn't work...

This is making me a mad man. A MAD MAN, I TELL YOU!

Please have mercy on me.

With markup like this:

<img src="http://the background image" /img>

there is no hope.
 
B

bluerobot2007

That "the background image" thing is not the markup...like I said in
the post, I just made it say that to protect her privacy. It's a normal
image tag that works fine and is not part of the problem....

ARG!
 
J

Jim Moe

Yes that is what I thought. But if I take the HTML at the top out, it
takes the whole background out. Same with the CSS at the bottom.
It does not look like you actually have access to the <head> section. So
all of the style rules you have mixed in with HTML should be removed. That
any of it works is a testament to the error recovery mechanisms of the
browsers.
All of the styling has to be done inline.

Change
<body background="the background image again">
to
<body style="background-image: url(the_image.xxx);
background-repeat:none; background-position:center center;
background-attachment:fixed">
 
A

Andy Dingley

Style rules can be only placed or imported in the <head> section.

You can place them anywhere, it's just not valid to do so. Browsers do
seem to process them though.

For MySpace this might be the best you can do.
 
J

Jonathan N. Little

That "the background image" thing is not the markup...like I said in
the post, I just made it say that to protect her privacy. It's a normal
image tag that works fine and is not part of the problem....

Well if you put bogus gobbly-gook for markup up to illustrate your
problem how in the world do you expect anyone to mark a meaningful
diagnosis?!?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top