Solved

cc two divs

Posted on 2014-03-22
5
111 Views
Last Modified: 2014-05-23
Hi Guys

Is it possirble to thave two divs a one overlap one?

see exsample attached

0
Comment
Question by:JCWEBHOST
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 39947508
Sure just use the CSS z-index property to manage the stacking order.

Syntax for z-index is here: http://www.w3schools.com/cssref/pr_pos_z-index.asp

If that is not what you need then please gve a more detailed description and a link to the page.

Cd&
0
 
LVL 2

Expert Comment

by:Michael
ID: 39977605
Give this a shot and see if this is what you're looking for.

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>overlapping divs</title>

<style type="text/css">
.divParent {
	margin:0 auto;
	margin-top:20px;
	width:200px;
	height:200px;
	background-color:#660000;
	color:#fff;
	font:Helvetica, Arial, sans-serif;
	font-size:18px;
	padding:18px;
	border:#fff solid 2px;
	
	z-index:10; /* sets the parent div */
}
.divChild {
	margin:0 auto;
	margin-top:20px;
	width:200px;
	height:200px;
	background-color:#CC0000;
	color:#fff;
	font:Helvetica, Arial, sans-serif;
	font-size:18px;
	padding:18px;
	border:#fff solid 2px;
	
	position:relative;
	left:-80px; /* switch these up as needed for your desired postioning */
	bottom:-40px; /* switch these up as needed for your desired postioning */
	z-index:20; /* sets the div higher than the parent div */
}
</style>

</head>

<body>

<div class="divParent"> Base Div
<div class="divChild"> Overlapping Div </div>
</div>

</body>
</html>

Open in new window

0
 
LVL 58

Expert Comment

by:Gary
ID: 40076775
I've requested that this question be deleted for the following reason:

The question has either no comments or not enough useful information to be called an "answer".
0
 
LVL 2

Expert Comment

by:Michael
ID: 40076776
Before closing please take a harder look at the solution I provided... it provides a complete solution with the code to achieve the question asked.
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question