Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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
  • 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

577 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