Png not working

This is a discussion on "Png not working" within the Graphics and 3D section. This forum, and the thread "Png not working are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Graphics and 3D

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old May 9th, 2006, 13:42
SuperMember

SuperMember
Join Date: Nov 2005
Location: England
Age: 27
Posts: 307
Thanks: 1
Thanked 0 Times in 0 Posts
Png not working

I'm trying to do a shadow around the main wrap of my webpage:

www.crewsfx.com/greenginger

I use a Mac and it's fine on that, but on PC it doesn't work - it just goes grey or blue. I exported the shadow as a PNG from within Flash, then I opened it in Photoshop and saved it as a PNG, still no luck. What do you have to do?

I need it as a PNG so that the texture background shows through too. Can you use gifs or something, or what?

Thanks.
Reply With Quote

  #2 (permalink)  
Old May 9th, 2006, 13:56
Up'n'Coming Member
Join Date: Apr 2006
Location: Missouri
Age: 31
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Png not working

It is not a PC problem it is a Internet Explorer problem;
http://www.alistapart.com/articles/pngopacity/
http://homepage.ntlworld.com/bobosola/

It looks good in FF
Reply With Quote
  #3 (permalink)  
Old May 9th, 2006, 14:12
SuperMember

SuperMember
Join Date: Nov 2005
Location: England
Age: 27
Posts: 307
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Png not working

how has he done it then?:

http://www.tokyocube.com/main.php

it works in ie on pc
Reply With Quote
  #4 (permalink)  
Old May 9th, 2006, 14:37
Up'n'Coming Member
Join Date: Apr 2006
Location: Missouri
Age: 31
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Png not working

The wrapper or container background is a gif file
http://www.tokyocube.com/img/bg/bg_page_shading.gif
Reply With Quote
  #5 (permalink)  
Old May 9th, 2006, 16:08
SuperMember

SuperMember
Join Date: Nov 2005
Location: England
Age: 27
Posts: 307
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Png not working

thanks. how stupid of me not to think of that. However, this must mean he's made a gif that is wide enough to exceed the width of all browsers. is that correct?

Actually, i'm having problems with exactly how this achieved. Do you set the image as the background for the body? I've tried this and it doesn't centre. I've made an image that is 1500 px wide, has nothing in the centre 750px and has the line texture around the edge. But it doesn't work right. It doesn't go centred and it doesn't tile how i expected.

Last edited by timmytots; May 9th, 2006 at 17:59.
Reply With Quote
  #6 (permalink)  
Old May 9th, 2006, 20:47
Highly Reputable Member
Join Date: Aug 2005
Location: 3rd Branch Up, Old Oak.
Age: 48
Posts: 658
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Png not working

You could do it with three same-width images from the same file;
Split out the header and place it at the top of the page.
The footer at the bottom.
Then make a vertically repeating 1 px high image the page background.
Centre the lot, so they appear as one, and away u go.

The repeating 1px image will save on your page's size as well.
Reply With Quote
  #7 (permalink)  
Old May 9th, 2006, 21:11
SuperMember

SuperMember
Join Date: Nov 2005
Location: England
Age: 27
Posts: 307
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Png not working

I don't think u understand the predicament but...

I found this code:

background: #F2F2F2 url("../img/bg/bg_page_shading.gif") repeat-y top center;
text-align: center;

That obviously is the code for the body in the css, but i've done that for mine with no luck. What is the background image supposed to be? Size etc. Mine doesn't centre, it goes off to left.

cheers
Reply With Quote
  #8 (permalink)  
Old May 9th, 2006, 22:10
Highly Reputable Member
Join Date: Aug 2005
Location: 3rd Branch Up, Old Oak.
Age: 48
Posts: 658
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Png not working

body { text-align:center;font-family:Arial,Helvetica,sans-serif;font-size:76%;background:#f2f2f2 url('../img/bg/bg_page_shading.gif") repeat-y top center; }

Try this.
It's one of mine, into which I have pasted yr .gif details.
You can see which bits you may need to play with to suit your particular page.

Re the shade around the frame, I use an 'outer glow' on the frame ('wrap') layer and change the colour to grey (dark as you need and adjust the opacity). Change the layer style to 'normal'. This will give you a shadowy effect all around your page frame.

I do this all in one file and then carve it up into three separate images (as above) and insert separate coding for each into the new page.

Last edited by Legacy_Staff; May 9th, 2006 at 22:17.
Reply With Quote
  #9 (permalink)  
Old May 10th, 2006, 09:49
Highly Reputable Member
Join Date: Aug 2005
Location: 3rd Branch Up, Old Oak.
Age: 48
Posts: 658
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Png not working

Something else just occurred to me.

You will probably need to use jpg format.

The gradient used in a glow/shadow effect would appear too blocky/stripey if you use gif.
Reply With Quote
  #10 (permalink)  
Old May 10th, 2006, 14:03
Up'n'Coming Member
Join Date: Apr 2006
Location: Missouri
Age: 31
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Png not working

You could just use this
http://homepage.ntlworld.com/bobosola/pnghowto.htm
Reply With Quote
  #11 (permalink)  
Old May 13th, 2006, 15:26
Up'n'Coming Member
Join Date: Mar 2006
Location: East Sussex, UK
Age: 20
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Png not working

Script to correct transparency in IE:

Code: Select all
<head>    <!--[if lt IE 7]> <script type="text/javascript" src="JS/correctPNG.js"></script> <![endif]--></head>
Code: Select all
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}
window.attachEvent("onload", correctPNG);
Reply With Quote
  #12 (permalink)  
Old May 14th, 2006, 07:06
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: Png not working

Quote:
Originally Posted by lesleindotcom
I dont think there is a fix for IE that works with BACKGROUND images.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
Reply

Tags
png, working

Thread Tools

Posting 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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS not working in IE? Jgag Web Page Design 2 Jun 5th, 2008 11:14
PNG - IE not working Phixon Web Page Design 3 Nov 30th, 2007 13:47
php not working? gsquare567 PHP Forum 10 Apr 24th, 2007 18:52
PHP not working toolmania1 PHP Forum 1 Nov 1st, 2006 05:57


All times are GMT. The time now is 20:27.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43