views:

69

answers:

1

Hi, I am very new to html/xml/css and I'm trying my best to teach myself. However, I have run into a problem that a Google search could not solve.

I would like to position a small image in a fixed location relative to another element(?)

I believe this is the code of the element i want to position the second element relative to.

<style type="text/css">
 #wrap { 
    width:550px; 
    background-color:#fff; 
    margin:0 auto; 
    padding:0; 
    border-right:1px solid #ccc;         
    border-left:1px solid #ccc; 
}

 #container {
     width: 500px;
      margin:0 auto;
     padding: 25px;
      font-size:.85em;
     background-color: #fff;
 }

and this is partial code I'm trying to edit to position .xyz to the right of "#wrap"

.xyz {
    position: ???;
    top: 200px;
    right: ???;
    _position: ???;
    _margin: ???;
    _text-align: right;
    z-index: 1337;
}

my search of SOF has lead me to believe i'm supposed to do something along the lines of this - http://stackoverflow.com/questions/104953/position-an-html-element-relative-to-its-container-using-css - but i haven't been able to.

I greatly appreciate any help you may offer. Hopefully I've explained my problem properly.

A: 

If you want .xyz inside of #wrap but on the right side, doing a float:right; on your .xyz element will achieve what you want.

EDIT: try something like this:

<div class="wrap">
     <div class="shuffle"><my shuffle img></div>
     ......Other stuff......
</div>

then css wise:

.wrap{position:relative;overflow:visible;}
.shuffle{position:absolute;right:100px;}
edl
To make things a little clearer... (btw float:right didn't do the trick) I am attempting to modify my tumblr theme so the existing code was written by someone else. .shuffle { position: fixed; top: 35px; right: 3px; _position: static; _margin: 3px; _text-align: right; z-index: 1337; } .... <div class="shuffle"> <a href="/random"><img src="http://static.tumblr.com/dbcxhwx/padke8y7x/oy9npboai5k99ruwwrs7l61l_500.png"></a> </div> ----- i'm just trying to relocate the "shuffle" button from the right side of the browser to the right side of the #wrap
anyone have any other ideas or suggestions?
If `.shuffle` is contained in `.wrap` and you don't care about the flow of the document, the simplest way to position `.shuffle` outside of `.wrap` is to set `.wrap {position:relative;}` and `.shuffle {position:absolute;right:-200px}` (or however many pixels you want to move the right side of `.shuffle`) Without actually seeing what you're talking about and the actual document structure, I can't suggest anything better than that.
edl
i don't think .shuffle is contained within .wrap. you can see exactly what i'm referring to here. www.top10jeeps.com Do you see the shuffle near the top right corner of the browser? i would like to reposition it so it sits along aside the right border of the middle frame, whose x-axis position varies according to browser size. i hope that made sense. Really appreciate the help.
POST edited above
edl