Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I center a <div> tag?

Posted on 2008-11-18
4
Medium Priority
?
573 Views
Last Modified: 2013-11-19
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
Comment
Question by:elliottbenzle
4 Comments
 
LVL 3

Expert Comment

by:whega
ID: 22990549
try <div align=center>
0
 
LVL 15

Accepted Solution

by:
quincydude earned 2000 total points
ID: 22990554
try

body {
        background-color: #999999;
        text-align: center;
        margin: auto;
}
0
 
LVL 10

Expert Comment

by:Tom
ID: 22990586
div{margin-right:auto;margin-left:auto;width:740px;}
0
 
LVL 2

Expert Comment

by:spikeyman00
ID: 22997573
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

810 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