HighDots Forums  

4 Murray 2 (how to center bg img)

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss 4 Murray 2 (how to center bg img) in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
judas2
 
Posts: n/a

Default 4 Murray 2 (how to center bg img) - 07-04-2004 , 06:08 AM






Maybe my previous message is too difficult to find

About centering in the browser page a background image avoiding the IE5/Mac
issues you told me:

Have you tried the same thing with two divisions (both centering) - one
containing the image, and the other containing the text and at a higher
z-index?

Sorry if I disturb you again, but would you please explain me better? Only if
this doesn't take too much time?
Thx anyway, your suggestions are always precious ;-)





Reply With Quote
  #2  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: 4 Murray 2 (how to center bg img) - 07-04-2004 , 07:46 AM






judas:

Sorry it has taken me so long to get back to you.

I think what you are seeing is a problem with a positioned background in
IE5/Mac.

You could try something like this to avoid the problem -

<style type="text/css">
<!--
body {
text-align:center;
}

#wrapper {
text-align:left;
width:710px;
margin: 0 auto;
position:relative;
padding:20px;
z-index:2;

}

#bkgdiv {
width:352px;
height:288px;
background-image: url(immag.jpg);
background-repeat: no-repeat;
position:relative;
top:50%;
left:50%;
z-index:1;

}

-->
</style>

and then in the HTML use this -

<body>
<div id="wrapper"><div id="bkgdv"></div>Put your text content here</div>
</body>

See if that gives the same effect with the background image. If it does
not, then we'll refine it. If it does, then I am not sure how to solve the
problem.



--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"judas2" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Maybe my previous message is too difficult to find

About centering in the browser page a background image avoiding the
IE5/Mac
issues you told me:

Have you tried the same thing with two divisions (both centering) - one
containing the image, and the other containing the text and at a higher
z-index?

Sorry if I disturb you again, but would you please explain me better?
Only if
this doesn't take too much time?
Thx anyway, your suggestions are always precious ;-)







Reply With Quote
  #3  
Old   
Osgood
 
Posts: n/a

Default Re: 4 Murray 2 (how to center bg img) - 07-04-2004 , 08:13 AM



Any reason why you are not just putting the background image in the
content <div> ?


#content {
background-image: url(immag.jpg);
background-repeat: no-repeat;
background-position: center center;
padding-top: 10px;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #990000;
width: 80%;
margin-right: auto;
margin-left: auto;
text-align: justify;
}








judas2 wrote:
Quote:
Maybe my previous message is too difficult to find

About centering in the browser page a background image avoiding the IE5/Mac
issues you told me:

Have you tried the same thing with two divisions (both centering) - one
containing the image, and the other containing the text and at a higher
z-index?

Sorry if I disturb you again, but would you please explain me better? Only if
this doesn't take too much time?
Thx anyway, your suggestions are always precious ;-)






Reply With Quote
  #4  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: 4 Murray 2 (how to center bg img) - 07-04-2004 , 08:19 AM



Because I did not want to use background positioning with it.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Osgood" <notavailable (AT) atthisaddress (DOT) com> wrote

Quote:
Any reason why you are not just putting the background image in the
content <div> ?


#content {
background-image: url(immag.jpg);
background-repeat: no-repeat;
background-position: center center;
padding-top: 10px;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #990000;
width: 80%;
margin-right: auto;
margin-left: auto;
text-align: justify;
}








judas2 wrote:
Maybe my previous message is too difficult to find

About centering in the browser page a background image avoiding the
IE5/Mac
issues you told me:

Have you tried the same thing with two divisions (both centering) - one
containing the image, and the other containing the text and at a higher
z-index?

Sorry if I disturb you again, but would you please explain me better?
Only if
this doesn't take too much time?
Thx anyway, your suggestions are always precious ;-)








Reply With Quote
  #5  
Old   
Osgood
 
Posts: n/a

Default Re: 4 Murray 2 (how to center bg img) - 07-04-2004 , 08:38 AM



Murray *TMM* wrote:

Quote:
Because I did not want to use background positioning with it.


Murray, I was asking Judas.

Your solution wont work, I dont think.

I've put background images, centered in a <div> before and dont seen to
remember any problems.

I'am going away to test it out.



Reply With Quote
  #6  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: 4 Murray 2 (how to center bg img) - 07-04-2004 , 08:43 AM



When you browse to judas' page in IE5/Mac and scroll the page, you will see
the anomaly in the background image. I think this is the same anomaly you
see when you have a fixed background image and scroll in the Mac. I was
trying to avoid using a positioned background by using a positioned division
instead, but since I am not at the Mac just now I can't test it....

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Osgood" <notavailable (AT) atthisaddress (DOT) com> wrote

Quote:
Murray *TMM* wrote:

Because I did not want to use background positioning with it.



Murray, I was asking Judas.

Your solution wont work, I dont think.

I've put background images, centered in a <div> before and dont seen to
remember any problems.

I'am going away to test it out.




Reply With Quote
  #7  
Old   
Osgood
 
Posts: n/a

Default Re: 4 Murray 2 (how to center bg img) - 07-04-2004 , 08:54 AM



Murray *TMM* wrote:

Quote:
When you browse to judas' page in IE5/Mac and scroll the page, you will see
the anomaly in the background image. I think this is the same anomaly you
see when you have a fixed background image and scroll in the Mac. I was
trying to avoid using a positioned background by using a positioned division
instead, but since I am not at the Mac just now I can't test it....


http://spamo.spymac.net/bg/img_bg_center.htm

the image displays incorrectly only when I scroll with IE Mac. That's
why I used <body bgproperties="fixed"

Yup, I tracked that post down previously and tested it in IE5 to see the
results. As you say the image gets very funky when scrolling the page.

I was really asking why the bg image needed to be on the <body> tag and
not part of the content <div>. Maybe there was a specific reason which I
havent found yet come across in the three or four thread which were
going on.

I've just moved the css for the image into the content <div> and
everything scrolls perfectly on the Mac in IE5.

I also tested your solution but it doesnt work. The text gets pushed
down below the image, which stays at the to of the 'wrapper" <div>





Reply With Quote
  #8  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: 4 Murray 2 (how to center bg img) - 07-04-2004 , 08:55 AM



Osgood:

I should have made the inner div absolutely positioned. It will work then.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Osgood" <notavailable (AT) atthisaddress (DOT) com> wrote

Quote:
Murray *TMM* wrote:

When you browse to judas' page in IE5/Mac and scroll the page, you will
see
the anomaly in the background image. I think this is the same anomaly
you
see when you have a fixed background image and scroll in the Mac. I was
trying to avoid using a positioned background by using a positioned
division
instead, but since I am not at the Mac just now I can't test it....


http://spamo.spymac.net/bg/img_bg_center.htm

the image displays incorrectly only when I scroll with IE Mac. That's
why I used <body bgproperties="fixed"


Yup, I tracked that post down previously and tested it in IE5 to see the
results. As you say the image gets very funky when scrolling the page.

I was really asking why the bg image needed to be on the <body> tag and
not part of the content <div>. Maybe there was a specific reason which I
havent found yet come across in the three or four thread which were
going on.

I've just moved the css for the image into the content <div> and
everything scrolls perfectly on the Mac in IE5.

I also tested your solution but it doesnt work. The text gets pushed
down below the image, which stays at the to of the 'wrapper" <div






Reply With Quote
  #9  
Old   
Osgood
 
Posts: n/a

Default Re: 4 Murray 2 (how to center bg img) - 07-04-2004 , 09:02 AM



Murray *TMM* wrote:
Quote:
Osgood:

I should have made the inner div absolutely positioned. It will work then.

I realised that and tested that as well, it still didnt work. This got
it closer but the 50% thing is random x-brower. Its not really 50% of
anything as far as I can tell.

Plus im not sure if specifying minus layers are a good thing?



#bkgdiv {
width:352px;
height:288px;
background-image: url(bgimage.jpg);
background-repeat: no-repeat;
position: absolute;
margin-top:50%;
margin-left:25%;
z-index:-10;

}



Reply With Quote
  #10  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: 4 Murray 2 (how to center bg img) - 07-04-2004 , 09:03 AM



Negative z-index is a bad thing. But I didn't use negative z-index, did I?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Osgood" <notavailable (AT) atthisaddress (DOT) com> wrote

Quote:
Murray *TMM* wrote:
Osgood:

I should have made the inner div absolutely positioned. It will work
then.


I realised that and tested that as well, it still didnt work. This got
it closer but the 50% thing is random x-brower. Its not really 50% of
anything as far as I can tell.

Plus im not sure if specifying minus layers are a good thing?



#bkgdiv {
width:352px;
height:288px;
background-image: url(bgimage.jpg);
background-repeat: no-repeat;
position: absolute;
margin-top:50%;
margin-left:25%;
z-index:-10;

}




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.