• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 578
  • Last Modified:

How do I center a <div> tag?

On this page:

http://www.glowfishtw.com/flagfootball/tinymce/examples/updatenewsscroller.asp

I want the two div boxes to be in the center of the page. How do I do this? Thanks, I'm new at using div tags.
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/flagfootball.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>update news scroller</title>
 
 
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">
<!--
body {
	background-color: #999999;
	text-align: center;
}
.updatetext {
	background-color: #FFFFFF;
	height: 40px;
	width: 400px;
	vertical-align: top;
	text-align: center;
	margin-left: 0px;
	background-position: center;
}
.headerfooter {
	font-size: 12px;
	color: #000000;
	background-color: #FFFFFF;
	margin: 0px;
	padding: 0px;
	height: 25px;
	width: 400px;
}
-->
</style>
</head>
<body>
  <div class="updatetext">  
    <h1>Update News Scroller<br />
      <br />
    </h1>
</div>
 
  <div class="headerfooter">
  The text that you type below will appear in the news scroller.
  </div>
<form name="newsscroller" action="<%=MM_editAction%>" method="POST" id="newsscroller">
 
<div align="center">
	  <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
	  <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%"><%=(rsnewsscroller.Fields.Item("newsscroll").Value)%></textarea>
	  
    <br />
	  <input type="submit" name="save" value="Submit" />
	  <input type="reset" name="reset" value="Reset" />
    </div>
 
<input type="hidden" name="MM_update" value="newsscroller" />
<input type="hidden" name="MM_recordId" value="<%= rsnewsscroller.Fields.Item("ID").Value %>" />
</form>
 
</body>
</html>

Open in new window

0
elliottbenzle
Asked:
elliottbenzle
1 Solution
 
whegaCommented:
try <div align=center>
0
 
quincydudeCommented:
try

body {
        background-color: #999999;
        text-align: center;
        margin: auto;
}
0
 
TomMicrosoft ISV PartnerCommented:
div{margin-right:auto;margin-left:auto;width:740px;}
0
 
spikeyman00Commented:
container{
float:left;
width:set to the width of the 2 divs together
margin:0 auto;
}
div1, div2 {
float:left;
width: half of the container
}
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now