Web Hosting Forum | Lunarpages
News: October 6, 2008 - Submit Your Site for the October 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 12, 2008, 09:54:05 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: css and transparent *.png  (Read 548 times)
css
Galactic Royalty
*****
Offline Offline

Posts: 208


« on: October 09, 2006, 11:32:41 AM »

See this image
http://img182.imageshack.us/img182/1338/madeusayy4.png

using

#anglephoto {
     height:170px;
     width: 280px;
     background-image:url('images/madeusa.png');
     background-repeat: no-repeat; 
       float:right;           
}
image moves to right top of page.

Now Suppose lower left 1/3 of above image is a transparent at a 45 degree angle *.png.

What is css code do I use to get above partially transparent png image in upper right
to fit over existing text on an htm page.

Think of placing a sold banner in upper right corner, at a 45 degree
angle, over a "for sale" sign hiding text below sold banner.

can this be done?

I'm using expression web, replacement for FP.

thanks.

LP hosts my web page.
Logged
DSB
Computer Nerd
Jabba the Hutt
*****
Offline Offline

Posts: 600


Programmer of things...


WWW
« Reply #1 on: October 09, 2006, 12:08:02 PM »

You would need a banner that spans the entire width of the page or a website that is right aligned.  Then you would need to use absolute positioning for the image above.

Code:
#anglephoto
{
   position: absolute;
   top: 0; right: 0;
}

In order to align right you need to have a width set for the parent element of #anglephoto.  That may be why more people align left, or from the left side of the page.  Aligning to the right will probably consist of some script code to keep track of the window size.

An example of parenting:

Code:
<html>

<head>
</head>

<body>
   <img id = "anglephoto">
</body>

</html>

The parent for anglephoto is <body>
Logged

css
Galactic Royalty
*****
Offline Offline

Posts: 208


« Reply #2 on: October 09, 2006, 12:42:50 PM »

I like this
#anglephoto
{
   position: absolute;
   top: 0; right: 0;
}

instead of float:right;

Problem remains.  image views beneath other two other <div> on same page.  I could make png smaller but then it won't appear to be on top of other <div>'s.
Logged
DSB
Computer Nerd
Jabba the Hutt
*****
Offline Offline

Posts: 600


Programmer of things...


WWW
« Reply #3 on: October 09, 2006, 12:52:57 PM »

I like this
#anglephoto
{
   position: absolute;
   top: 0; right: 0;
}

instead of float:right;

Problem remains.  image views beneath other two other <div> on same page.  I could make png smaller but then it won't appear to be on top of other <div>'s.


Sorry, I forgot something:
Code:
#anglephoto
{
   position: absolute;
   top: 0; right: 0;
   z-index: 1;
}

Normally everything exists in layer 0.  z-index sets the display layer where your object exists.  The highest number is always on top.  Think of it like layers of a cake.
Logged

css
Galactic Royalty
*****
Offline Offline

Posts: 208


« Reply #4 on: October 09, 2006, 02:38:32 PM »

That really good.

 You are really smart.

thanks.

I like it.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM