Solved

cc two divs

Posted on 2014-03-22
5
106 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
  • 2
5 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now