I have been seeing some really neat tricks with CSS lately, but one in particular has had my interest for quite a while: having a picture, or a portion of it, overlap a box/table.
A perfect example of this can be seen on
Lats'vel's bio, and another variation can be found
here. I would love to utilize it in my bios; it gives off such a lovely effect when executed correctly.
I understand that most people are normally iffy about sharing codes in public. If anyone is willing to indulge, but does not wish to reveal it in a comment, you can reach me at
This is just a casual request, and if no one wishes to respond then that is perfectly fine. Just thought I'd give it a shot! n_n ♥
You need to adjust the
<img src="URL" style="position:relative;z-index:11;top:-50px;right:30px">
You may need to do a couple variations on where you put it into the code in order to get it to work like you want it to (such as hiding it in a tiny div within the div you want it to sit on top of). Also, be warned that any links the image covers (even in transparent areas) will not be clickable.
Ninja'd. ^^
Ahh, I knew it would be
"(such as hiding it in a tiny
There is an easier way to avoid excessive blank spaces (which is the only reason I could think of for using extra divs). Simply add a negative "margin-bottom" that is the same value as "top". So Aivilo's code becomes this:
<img src="URL" style="position:relative;z-index:11;top:-50px;right:30px;margin-bottom:-50px">
Usually, a negative "top" value will create a blank space on the spot where the image "actually" is. Here the negative margin-bottom negates the 50px which the image is pushed upwards.
Oh wow, that's a great tip! I
Ah you ninja'd me! One more
You can also use "position:absolute" instead of "position:relative". With this, the image's position is calculated relative to the overall width of the page ((instead of from it's "true" position)). So, for example, "top:0px" and "left:0px" will give you an image in the very top left corner of the page, while "top:0px;right:0px" would put it in the very top right corner. In some situations it's easier to position images with "absolute" than it is with "relative".
((this explanation is a bit inaccurate, but should do.))
Sorry for the ramble 6_9
Ninja-skills! :9 I totally
Haha aw, don't apologize, this is a very good ramble! You know a lot about codes, and you like to explain. I totally appreciate it, thank you so much again! ;u; ♥
Quote:There is an easier way
No, it's done in order to keep the image with the div box it overlaps whenever the page is resized, if the div isn't set to an absolute position. In example, here.
Hm... Just to be clear, when
<main div, overflow:auto -
<main div, overflow:auto - may also be a double-div to provide an invisible scroll bar, if desired><div style="height:1px;width:1px;"><img src="IMAGE" style="POSITION STUFF"></div>MAIN DIV BOX'S NORMAL CONTENTS</div>
Note there are NO overflow settings in the tiny div (the one immediately around the image)
Holy cow, we're getting to
Aivilo-- I don't
Entirely possible, but it's
Ooh, keeping an eye on this.
Profile picture by ahimsa ♥
Pixel Wis by squeegie~
Mkay, I got the hang of it
Do you mean it has a
It does have a different
It's not a huge deal as I can still see everything in the box just fine, but I suppose for future reference it would be good to know what to tweak in order to keep the position fixed. Here is the code for reference:
<*div style="height:1px;width:1px;"><*img src="http://i.imgur.com/jyFd84o.png" style="position:absolute;z-index:11;top:85px;left:180px;margin-bottom:85px"><*/div>
Positive values worked a lot better for me than negative values. Unless, somehow, that is causing the problem I'm having... o.O
Every time you edit the page,
Ohh okay, that seems to be