?
Solved

Adding a div tag within a div tag

Posted on 2010-01-11
5
Medium Priority
?
299 Views
Last Modified: 2012-05-08
I'm using Dreamweaver CS3 (but am really rusty).  I want to have a div tag that is 640 pixels in width and in the very centre of the screen at all times.  I also need to be able to insert sub-div tags, so that I can place specific images.

If you could give me some tips (or code), I'd really appreciate it.
0
Comment
Question by:Andy Brown
[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
  • 3
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
s8web earned 2000 total points
ID: 26285502
Here ya go, this should give you a good start.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>Centered H and V</title> 
<style type="text/css" media="screen">
<!--
body 
	{
	margin:0px;
	background:#f2ede9;
	font-family:Arial, Helvetica, sans-serif;
	font-size:11px;
	}
a{color:#fff;text-decoration:none;}
#container       
	{
	position: absolute;
	top: 50%;
	left: 0px;
	width: 100%;
	}
#content    
	{
	margin-left: -320px;
	position: absolute;
	top: -240px;
	left: 50%;
	width: 640px;
	height: 480px;
	background:#ebebeb;
	border:1px solid #ccc;
	color:#000;
	}
.innerdiv{
	/*Define your inner div's here*/
	padding:15px;
	}
--></style>
</head>
<body>
	<div id="container">
		<div id="content">
        	<div class="innerdiv">Put stuff in here</div> 	
        	<div class="innerdiv">Put stuff in here</div> 	
        	<div class="innerdiv">Put stuff in here</div> 	
		</div>
	</div>
</body>
</html>
    

Open in new window

0
 

Author Comment

by:Andy Brown
ID: 26287115
That's awesome - thank you.

Is it possible to add additional div tags within contect, so that I can position additional elements?

Thanks again - that's a great help.
0
 
LVL 16

Expert Comment

by:s8web
ID: 26287137
Sure is, I added .innerdiv as an example.
0
 

Author Closing Comment

by:Andy Brown
ID: 31675627
I think I have it - can I draw the div tags manually and then set the CSS Style?
0
 

Author Comment

by:Andy Brown
ID: 26292083
PS - Thanks again for all of the help.
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

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.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

752 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