Jump to content

Relative Positioning


cesarcesar

Recommended Posts

In the following code i need *Signup* to align just to the right of *Login*. Due to *SearchContainer* location, it must be absolute positioned. Thanks for the help.

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">

<style type="text/css" title="">
#SearchContainer	{ position:absolute; z-index:1; width:210px; height:125px; border:1px solid red; }
#SearchField	{ position:relative; z-index:3; width:200px; top: 5px; border:1px solid orange; }
#LoginMessage	{ position:relative; z-index:3; width:200px; top: 10px; border:1px solid yellow; }
#Login			{ position:relative; z-index:3; width:150px; top: 20px; border:1px solid green; }
#Signup			{ position:relative; z-index:4; width: 25px; top: 20px; left: 10px; border:1px solid blue; }

</style>

</head>
<body>

<div id="SearchContainer">
	<div id="SearchField">Epsum factorial non</div>
	<div id="LoginMessage">Lorem ipsum dolor</div>
	<div id="Login">Li Europan lingues<br>Li Europan lingues</div>
	<div id="Signup">xxx</div>
</div>

</body>
</html>

Link to comment
Share on other sites

try this

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">

<style type="text/css" title="">
#SearchContainer	{ position:absolute; z-index:1; width:210px; height:125px; border:1px solid red; }
#SearchField	{ position:relative; z-index:3; width:200px; top: 5px; border:1px solid orange; }
#LoginMessage	{ position:relative; z-index:3; width:200px; top: 10px; border:1px solid yellow; }
#Login			{ position:relative; z-index:3; width:150px; top: 20px; border:1px solid green; }
#Signup			{ position:relative; z-index:4; width: 25px; top: -20px; left: +150px; border:1px solid blue; }

</style>

</head>
<body>

<div id="SearchContainer">
	<div id="SearchField">Epsum factorial non</div>
	<div id="LoginMessage">Lorem ipsum dolor</div>
	<div id="Login">Li Europan lingues<br>Li Europan lingues</div>
	<div id="Signup">xxx</div>
</div>

</body>
</html>  

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.