TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-07-2008, 09:57 PM   #1 (permalink)
The Gregarious
Upcoming Programmer Inquisitive 
 
Join Date: Sep 2007
Posts: 680
Thanks: 85
Tanax is on a distinguished road
Default Lean?`

Hi, how can I do this?

HTML Code:
<img src="leftimage" />
<div id="content">
hellooooo
</div>
<img src="rightimage" />
And set the content div to a width to 0, and then overlap the div with the images, so it looks like the images are together as one image? Someone said using float: right on the left image, and float: left on the right image, but that didn't work =/
__________________
Tanax is offline  
Reply With Quote
Old 03-07-2008, 10:39 PM   #2 (permalink)
The Addict
 
Join Date: Nov 2007
Posts: 265
Thanks: 2
TlcAndres is on a distinguished road
Default

Why not use z-index? From my understanding you want the images to be under the div.
__________________
"What everyone seems to forget is that while knowledge certainly is something - it's the implementation of knowledge that brings power" - Andres Galindo.
TlcAndres is offline  
Reply With Quote
The Following User Says Thank You to TlcAndres For This Useful Post:
Tanax (03-08-2008)
Old 03-07-2008, 11:40 PM   #3 (permalink)
The Gregarious
Upcoming Programmer Inquisitive 
 
Join Date: Sep 2007
Posts: 680
Thanks: 85
Tanax is on a distinguished road
Default

I want the images to cover the div, so the images has to be above the div, div has to be under the images And how does z-index work?
__________________
Tanax is offline  
Reply With Quote
Old 03-07-2008, 11:49 PM   #4 (permalink)
The Acquainted
 
wGEric's Avatar
 
Join Date: Nov 2007
Posts: 125
Thanks: 0
wGEric is on a distinguished road
Default

HTML Code:
<div style="position: absolute;">
    <div style="position: absolute; top: 0; left: 0; z-index: 2;">text</div>
    <img src="leftimage" />
    <img src="rightimage" />
</div>
That should work as long as the images don't wrap.
__________________
Eric
BlogphpBB
wGEric is offline  
Reply With Quote
The Following User Says Thank You to wGEric For This Useful Post:
Tanax (03-08-2008)
Old 03-08-2008, 12:06 AM   #5 (permalink)
The Gregarious
Upcoming Programmer Inquisitive 
 
Join Date: Sep 2007
Posts: 680
Thanks: 85
Tanax is on a distinguished road
Default

Quote:
Originally Posted by wGEric View Post
HTML Code:
<div style="position: absolute;">
    <div style="position: absolute; top: 0; left: 0; z-index: 2;">text</div>
    <img src="leftimage" />
    <img src="rightimage" />
</div>
That should work as long as the images don't wrap.
THanks! It kind of worked
But how can I center all that? Cause I want it to be in the middle of the middle of the page(middle in ^v ways, and middle in <> ways), right now it's up in the left corner..

Also, the images doesn't "cover" the div, the images are background to the div =/ the "text" gets places on top of the images...

Thanks again
__________________
Tanax is offline  
Reply With Quote
Old 03-08-2008, 12:58 AM   #6 (permalink)
The Acquainted
 
wGEric's Avatar
 
Join Date: Nov 2007
Posts: 125
Thanks: 0
wGEric is on a distinguished road
Default

Oh, you don't want to display the text?

HTML Code:
<div style="margin: -100px auto 0; height: 200px; position: absolute; top: 50%;">
    <div style="display: none;">text</div>
    <img src="leftimage" height="200" />
    <img src="rightimage" height="200" />
</div>
That will center it horizontally and vertically and the text won't be displayed. Vertical centering is a little bit tricky. How it centers vertically is it moves the top of the box down 50% of the height of the window (position: absolute; top: 50%;). It then moves it up half the height of the box (margin: -100px;). The auto in the margin centers it horizontally.
__________________
Eric
BlogphpBB
wGEric is offline  
Reply With Quote
The Following User Says Thank You to wGEric For This Useful Post:
Tanax (03-08-2008)
Old 03-08-2008, 02:29 AM   #7 (permalink)
The Gregarious
Upcoming Programmer Inquisitive 
 
Join Date: Sep 2007
Posts: 680
Thanks: 85
Tanax is on a distinguished road
Default

Well, I got like this right now:



Clicking it will with javascript open it to this:



HTML Code:
<div id="splash">
<img id="img1" onclick="toggle();" src="img/splash-close-left.png" border="0" style="float: left; margin-top: 1px;"/><div id="content"></div><img id="img2" onclick="toggle();" src="img/splash-close-right.png" border="0" style="float: left;"/>
</div>
Code:
body {
	
	background-color: #464646;
	
}

#content {

	width: 0px;
	float: left;

}
javascript Code:
function toggle() {
       
        var content = $('content');
        var width = content.getStyle('width').toInt();
       
        if(width != 400) {
           
            expand();   
           
        }
       
        else {
           
            contract();
           
        }   
       
    }


And right now, it's kindof working exactly like I want it... only that it's not centered =// How would I center this?
__________________
Tanax is offline  
Reply With Quote
Old 03-08-2008, 03:24 AM   #8 (permalink)
The Contributor
 
DeMo's Avatar
 
Join Date: Jan 2008
Location: Brazil
Posts: 77
Thanks: 14
DeMo is on a distinguished road
Default

Well you can wrap everything inside another div.
Code:
<div align="center">
  everything else goes here :)
</div>
Send a message via ICQ to DeMo Send a message via MSN to DeMo Send a message via Skype™ to DeMo
DeMo is offline  
Reply With Quote
Old 03-08-2008, 10:01 AM   #9 (permalink)
The Gregarious
Upcoming Programmer Inquisitive 
 
Join Date: Sep 2007
Posts: 680
Thanks: 85
Tanax is on a distinguished road
Default

Quote:
Originally Posted by DeMo View Post
Well you can wrap everything inside another div.
Code:
<div align="center">
  everything else goes here :)
</div>
Nope, it doesn't work =//

I think it's because of the float: left's ..
__________________
Tanax is offline  
Reply With Quote
Old 03-08-2008, 02:02 PM   #10 (permalink)
The Wanderer
 
wiifanatic's Avatar
 
Join Date: Sep 2007
Posts: 24
Thanks: 8
wiifanatic is on a distinguished road
Default

Use this (make necessary modifications):
Code:
<div style="margin: -100px auto 0; height: 200px; position: absolute; top: 50%; text-align: center;">
    <div style="display: none;">text</div>
    <img src="leftimage" height="200" />
    <img src="rightimage" height="200" />
</div>
wiifanatic is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:54 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0