Avatar of catonthecouchproductions
catonthecouchproductionsFlag for United States of America

asked on 

Overlaying PNG placement

Hey, I am trying to create the main image at my site: www.ryancoughlin.com in to a PNG overlay. Where you see the tagline under the header, I am going to create a transparent PNG then write the text. I know how to do all of that, the CSS opacity, but I am confused on how I would get an element where it is now.

I would set the z-index: 3; say, but how to get that element at the same position on top.

Thank you!

Ryan
CSS

Avatar of undefined
Last Comment
catonthecouchproductions
Avatar of sedward5
sedward5

There's a couple ways you can do it. You probably want to set both elements to:
position: absolute;

Can also move them around like so:
top: -30px
left: 15px
Avatar of catonthecouchproductions

ASKER

I was thinking about that method, but I wasn't sure if there was a more appropriate method.
ASKER CERTIFIED SOLUTION
Avatar of Rikus_Trent
Rikus_Trent
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of sedward5
sedward5

Yeah, in terms of best practice those are really the only two ways to overlay objects (without nesting them).
I have this so far:

#imageContainer{
width:538px;
height:258px;
}
#imageContainer #imageOverlay{
width:538px;
height:38px;
background-image: url("images/png-overlay.png");
background-repeat: no-repeat;
margin-top:-60px;
border: 1px solid #FF000;
z-index: 1000;
}
#imageContainer #imageOverlay span.overlay-text{
font-size: 140%;
font-weight: bold;
text-transform: lowercase;
letter-spacing: -2px;
padding: 0 0 0 5px;
}

And my HTML is below. If you go to my site now, it is not showing the png-overlay image I have. Any ideas?

Thanks,

Ryan


<div id="imageContainer">
    		<a href="http://www.ryancoughlin.com/index.php" title="Go Home"><img id="mainImage" src="<?php bloginfo('template_url'); ?>/images/landSCAPE.jpg" alt="Ryan Coughlin - Web and Graphic Designer" /></a>
    		<div id="imageOverlay"><span class="overlay-text">My name is Ryan Coughlin and I am a Web and Graphic Designer. Its what I love to do.</span></div>
   		</div>

Open in new window

SOLUTION
Avatar of sedward5
sedward5

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Thank you both for your help!

Ryan
CSS
CSS

Cascading Style Sheets (CSS) is a language used for describing the look and formatting of a document written in a markup language. Usually used to change web pages and user interfaces written in HTML, it can also be applied to any kind of XML document. CSS is designed primarily to distinguish the content of a document from its presentation.

43K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo