views:

60

answers:

5

http://elektrikhost.com/

You see the penguins thats over the header on the columns? I'm trying to get them to be over the header and list. I'm wondering what would you do? use position absolute, or relative? I'm stuck.

HTML:

<section class="starter">
 <img src="../images/plan-icon.png" width="62" height="73" alt="Plan Icon">
  <h2>Starter Plan</h2>
  <ul>
    <li><span>5GB Disk Space</span></li>
    <li><span>Unmetered Bandwidth</span></li>
    <li><span>Unlimited Add-on Domains</span></li>
    <li><span>Unlimited Subdomains</span></li>
    <li><span>Unlimited Email/FTP Accounts</span></li>
    <li><span>Unlimited MySQL Databases</span></li>
    <li><span>Shell access upon request</span></li>
  </ul>
  <img src="images/starterplan.png" width="192" height="51" alt="Starter Plan">
</section><!-- //.starter -->

.plan-icon is the image. Needs to look like this: alt text

A: 

try

<img src="../images/plan-icon.png" width="62" height="73" alt="Plan Icon" style="float:right;">

I might even suggest adding a padding: 5px 5px; to that, but that's just me ...

drachenstern
+1  A: 
.starter { position: relative; }
.starter img { position: absolute; top: 5px; left: 140px; }

The idea is that the image is positioned "absolute" so it can be anywhere within the confines of its parent element ".starter". This will not work if ".starter" is not set to relative.

I got this to work in Firebug, the .starter img selector might need changing but its the idea of absolute positioning that you should take away from this.

Tom
but that's so complex of a method
drachenstern
With all due respect using inline style means he must apply the same style to every penguin image. which goes against the DRY idea of programming, and will not be very maintainable. Is the method or my explanation confusing?
Tom
A: 

Use relative positioning. You can also give it a z-index to place it "on top" of any elements.

Regardless, take a look at this page. It should help you out:

http://w3schools.com/CSS/css_positioning.asp

Tyler
that really doesn't help him with what he's trying to do, and z-index on inline elements doesn't have a lot of benefit (altho I could think of some reasons to do that)
drachenstern
Sure it does. Using relative positioning, he can position it exactly where he wants it relative to its natural position.
Tyler
Using relative position keeps the background though, i'm trying to take the images out of the background. Oh well I guess I have to absolute position them all. [thank god for firebug]
omnix
@Kawohi, I'm not sure what you mean by "keeps the background," but you should be able to achieve what you want using either absolute or relative positioning.
Tyler
+1  A: 

You can simply set the image style to float: right

Herman
Its amazing how this was the one that worked for me.
omnix
A: 

If it were me, I'd add this CSS.

#plans-wrap section { position: relative; }
#plans-wrap section  .icon { position: absolute; right: 0px; top: 0px; }
babtek