Adding a div tag within a div tag

Posted on 2010-01-11
Medium Priority
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.
Question by:Andy Brown
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
LVL 16

Accepted Solution

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">
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>Centered H and V</title> 
<style type="text/css" media="screen">
	font-family:Arial, Helvetica, sans-serif;
	position: absolute;
	top: 50%;
	left: 0px;
	width: 100%;
	margin-left: -320px;
	position: absolute;
	top: -240px;
	left: 50%;
	width: 640px;
	height: 480px;
	border:1px solid #ccc;
	/*Define your inner div's here*/
	<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> 	

Open in new window


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.
LVL 16

Expert Comment

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

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?

Author Comment

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

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