PDA

View Full Version : div issues


dovroc
10-28-2007, 01:40 AM
Hi,

I was wondering if anyone could help with a few issues I have with this small piece of code.

1. This whole page is inserted in a div, how do I make a border around it that will follow the margins.

2. The top text needs to be centered how do I do that with CSS. As you can see i tryed doing it with HTML but it has no effect.

Do you recommend making a whole page into a div and centering it that way as I have done here?

Many Thanks

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Caribe Travel Services Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
<!--
h1 {
font-size: 36px;
}
h2 {
font-size: 18px;
text-decoration: underline;
font-family: "Times New Roman", Times, serif;
color: #663300;
}
-->
</style>
</head>
<body>
<div id="center">
<div align="center">
<table width="749" height="100%" border="0" cellpadding="0" cellspacing="0">
<h1 align="center">CARIBE TRAVEL SERVICE</h1>
<p align="left">&nbsp;</p>
<h2 align="left">Welcome to the home of Caribe Travel Services!</h2>
<p>We here at Caribe Travel Services are dedicated to making your dream vacation
in the Caribbean a reality. Whether you're interested in an all-inclusive resort
package, a cruise, or accommodations at one of the Caribbean's fine hotels,
we at Caribe Travel Services are prepared to meet all of your needs. We offer
comprehensive services that help you make that once in a lifetime vacation a
real dream come true.</p>
<p>&nbsp;</p>
<p>We offer many services at Caribe Travel Services including the following:</p>
<p>&nbsp;</p>
<ul>
<li>Comprehensive travel packages</li>
</ul>
<p>&nbsp;</p>
<ul>
<li>Exclusive deals on some of the most sought after travel destinations in the
Caribbean</li>
</ul>
<p>&nbsp;</p>
<ul>
<li>Expert advice on the best travel destinations to meet your wishes</li>
</ul>
<p>&nbsp;</p>
<p>With over 25 years experience in booking travel exclusively in the Caribbean,
Caribe Travel Services is your one-stop destination for the best in travel to
the sunny destinations of the Caribbean Sea region.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
</body>
</html>

Cary
10-28-2007, 09:57 AM
Hopefully, this will be helpful.

<!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>Caribe Travel Services Home</title>
<style type="text/css">
<!--
body {
text-align: center; /* to center the page in IE5 */
}
#wrapper {
width: 749px; /* needed to allow auto margins to center element */
margin: 15px auto; /* auto left and right margins will center a fixed width element */
text-align: left; /* to negate the centering style on the body */
padding: 20px; /* adds space around div to create some room between content and border */
border: 1px solid black; /* creates a 1px thick black border on all sides between padding and margin */
}
h1 {
font-size: 36px;
text-align: center; /* centers the header */
}
h2 {
font-size: 18px;
text-decoration: underline;
font-family: "Times New Roman", Times, serif;
color: #663300;
}
-->
</style>
</head>
<body>
<div id="wrapper"><!-- this div contains the whole page for centering -->
<h1>CARIBE TRAVEL SERVICE</h1>
<h2>Welcome to the home of Caribe Travel Services!</h2>
<p>We here at Caribe Travel Services are dedicated to making your dream vacation in the Caribbean a reality. Whether you're interested in an all-inclusive resort package, a cruise, or accommodations at one of the Caribbean's fine hotels, we at Caribe Travel Services are prepared to meet all of your needs. We offer comprehensive services that help you make that once in a lifetime vacation a real dream come true.</p>
<p>We offer many services at Caribe Travel Services including the following:</p>
<!-- all the list elements can be between a single pair of ul tags. Use CSS to increase space between the list items by using top and bottom padding or margins -->
<ul>
<li>Comprehensive travel packages</li>
<li>Exclusive deals on some of the most sought after travel destinations in the Caribbean</li>
<li>Expert advice on the best travel destinations to meet your wishes</li>
</ul>
<p>With over 25 years experience in booking travel exclusively in the Caribbean, Caribe Travel Services is your one-stop destination for the best in travel to the sunny destinations of the Caribbean Sea region.</p>
</div><!-- end #wrapper -->
</body>
</html>

d a v e
10-28-2007, 05:45 PM
oops posted 2x

d a v e
10-28-2007, 05:46 PM
if you underline your H2s then it will make them look like links, even if your links are a different colour. why not put
border-bottom:1 px solid black;
instead?

dovroc
10-29-2007, 01:29 AM
Thanks a lot, just what I needed.