...

View Full Version : Trouble aligning text in content box



conphill
12-10-2010, 09:33 PM
I have a content box with an image in the upper left hand corner. I want a description of the image to align next to the image. I want the rest of the text to appear underneath the image.


HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>CampusTaps.com</title>

<link href="BarPageBox.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
background-color: #FFF;
}
</style>





</head>

<body>
<!--CONTAINER STARTS-->
<div id="container">
<!--HEADER/NAVIGATION STARTS-->
<div id="top">
<!--WEBSITE TITLE STARTS-->
<div id="title">
<h1><a href="index.html" title="CampusTaps.com">CampusTaps</a></h1>
</div>
<!--WEBSITE TITLE ENDS-->
<!--NAVIGATION STARTS-->
<div id="nav">
<ul class="nav-links">
<li><a href="#" title="Home">Home</a></li>
<li><a href="#" title="Lis">Lis</a></li>
<li><a href="#" title="Co">C</a></li>
<li class="borderx2"><a href="#" title="dsfs">3t</a></li>
</ul>
</div>
<!--NAVIGATION ENDS-->
</div>
<!--HEADER/NAVIGATION ENDS-->


<div class="divider">
</div>

<center> <div class="content box1"> <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4"><img src="http://campustapscom.ipage.com/Images/barlist_01.gif" width="500" height="23" alt=""></td>
</tr>
<tr>
<td background="http://campustapscom.ipage.com/Images/barlist_02.gif" width="20"></td>
<td background="http://campustapscom.ipage.com/Images/barlist_03.gif" width="456">&nbsp;</p>
<div id="bar-links">
<center><ul><h4><a href="#" title="####" style="color: #fff">####</a>&nbsp;
<a href="#" title="#####"style="color: #fff">#####</a> &nbsp;
<a href="#" title="#####"style="color: #fff">#####</a> &nbsp;
<a href="#" title="Egans Pub"style="color: #fff">#####</a> &nbsp;
</h4></ul></center>
</div>
</td>
<td background="http://campustapscom.ipage.com/Images/barlist_04.gif" width="24"></td>
</tr>
<tr>
<td colspan="4"><img src="http://campustapscom.ipage.com/Images/barlist_05.gif" width="500" height="27" alt=""></td>
</tr>
</table>




<center> <div class="content box1"> <table width="656" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4"><img src="http://campustapscom.ipage.com/Images/CollegeBarPageBox3_01.gif" width="657" height="54" alt=""></td>
</tr>
<tr>
<td background="http://campustapscom.ipage.com/Images/CollegeBarPageBox2_02.gif" width="15"></td>
<td background="http://campustapscom.ipage.com/Images/CollegeBarPageBox2_03.gif" width="624">&nbsp;</p>
<img src="http://campustapscom.ipage.com/Images/campustapslogosmall.jpg" alt="BarPicture" align="left">

<p>Description</p>

<div class="list">
<li> Monday-</li>
<li>Tuesday-</li>
<li>Wednesday-</li>
<li>Thursday-</li>
<li>Friday-</li>
<li>Saturday-</li>
<li>Sunday-</li>
</div>


<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'campustaps'; // required: replace example with your forum shortname

// The following are highly recommended additional parameters. Remove the slashes in front to use.
var disqus_identifier = 'unique_dynamic_id_1234';
var disqus_url = 'http://campustaps.com/CollegeBarPage.html';

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>


</td>
<td background="http://campustapscom.ipage.com/Images/CollegeBarPageBox2_04.gif" width="18"></td>
</tr>
<tr>
<td colspan="4"><img src="http://campustapscom.ipage.com/Images/CollegeBarPageBox2_05.gif" width="657" height="40" alt=""></td>
</tr>
</table>
</div>
</center>
</div>



<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'campustaps'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://disqus.com/forums/' + disqus_shortname + '/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
</div>

<!--FOOTER ENDS-->
<div id="footer">
<p>Copyright &copy; 2010 <strong>CampusTaps Media Group</strong></p>
</div>

</body>
</html>


CSS

@charset "UTF-8";
/* CSS Document */


* {
margin: 0px;
padding: 0px;
border: none;
}
body {
background-image: url(http://campustapscom.ipage.com/Images/Body-bg.jpg);
background-repeat: repeat-x;
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #c8c8c8;
}
#container {
margin: auto;
width: 850px;
}
#top {

width: 850px;
height: 119px;
}
#title {
float: left;
width: 278px;
height: 74px;
padding-top: 45px;
}
#title h1 {
display: block;
float: left;
width: 278px;
height: 74px;
text-indent: -9999px;
}
#title h1 a {
display: block;
width: 100%;
height: 100%;
background-image: url(http://campustapscom.ipage.com/Images/campustapslogosmall.jpg);
background-repeat: no-repeat;
background-position: 0 0;
}
#navigation { float: right; }
.nav-links li {
display: block;
float: left;
list-style-type: none;
}
.nav-links li a {
float: left;
width: 120px;
height: 68px;
text-decoration: none;
text-transform: capitalize;
color: #666666;
font-size: 12px;
text-align: center;
padding-top: 51px;
border-left-width: 1px;
border-left-style: solid;
border-left-color: #cecece;
}
.nav-links li a:hover {
color: #ffffff;
background-position: center bottom;
}
li.borderx2 {
border-right-width: 1px;
border-right-style: solid;
border-right-color: #cecece;
}

.divider {
background-image: url(http://campustapscom.ipage.com/Images/divider.jpg);
background-repeat: no-repeat;
padding: 20px;
height: 6px;
width: 960px;

}



.sidebar-list li {
list-style-type: none;
color: #2C5923;
font-size:14px;
margin-top: 20px;
padding-bottom: 10px;

}

#content {

height: 370px;
width: 650px;
background-image: url(http://campustapscom.ipage.com/Images/LiquorPricesBox.jpg);
background-repeat: no-repeat;
padding-top: 20px;
padding-right: 20px;
padding-bottom: 30px;
padding-left: 20px;
}
#hor-minimalist-b
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
background: #fff;
margin: 45px;
width: 480px;
border-collapse: collapse;
text-align: left;
}
#hor-minimalist-b th
{
font-size: 14px;
font-weight: normal;
color: #039;
padding: 10px 10px;
border-bottom: 2px solid #6678b1;
}
#hor-minimalist-b td
{
border-bottom: 1px solid #ccc;
color: #669;
padding: 6px 8px;
}
#hor-minimalist-b tbody tr:hover td
{
color: #009;
}


.barbox {
width:900px;
margin: 0 auto;
border: 4px solid #333333;
background: #333333;
text-align:center;
color:#000;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #c8c8c8;
}


#barbox {
height: 1100px;
width: 1180px;
margin: 30px auto;
background: #000000;
overflow: auto;
font-size: 0.8em;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #c8c8c8;
}



#HCB_comment_box textarea {

}

/* the entire html comment box container. applies to everything */
#HCB_comment_box {}

#HCB_comment_box p.error {
border: 4px solid #f88;
background-color: #fee;
color: #800;
}

#HCB_comment_box textarea, #HCB_comment_box input.text {
border: 1px solid #ddd;
border-left: 1px solid #ccc;
border-top: 1px solid #ccc;
background: #fff;
}

#HCB_comment_box .hcb-wrapper-half {
display:block;
width:50%;
float:left;
}
#HCB_comment_box .hcb-wrapper {
clear:both;
margin-bottom:0.5em;
}
#HCB_comment_box input.text {
display:block;
width:97%;

}
/* the submit button */
#HCB_comment_box input.submit {
margin:0 7px 3px 0;
background-color:#ffffff;
border:1px solid #ccc;
border-top:1px solid #ddd;
border-left:1px solid #ddd;
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
font-size:100%;
line-height:130%;
text-decoration:none;
font-weight:bold;
color:#fff;
cursor:pointer;
width:auto;
overflow:visible;
padding:4px 10px 3px 7px; /* IE6 */
}
#HCB_comment_box input.submit:hover{
background-color:#fff;
border:1px solid #c2e1ef;
color:#fff;
}

#HCB_comment_box span.home-desc {
opacity:0.4;
}

/* the individual comment display containers */
#HCB_comment_box div.comment {
border-top:1px solid #eee;
margin-bottom:0.5em;
}

/* the moderator message */
.hcb-mod b{
color:darkblue;
}

/* next, prev, ok and x link style */
.hcb-link {
color:blue;
text-decoration:underline;
}

#footer {
height: 20px;
clear: both;
margin-top: 10px;
padding-top: 25px;
text-align: center;
color: #ffffff;
background-image:url(http://campustapscom.ipage.com/Images/Body-bg.jpg);
repeat-x;
}


Link
http://campustapscom.ipage.com/testpage.html

Excavator
12-11-2010, 12:55 AM
Hello conphill,
You should check that code in the validator. Your ul is not formed correctly along with several other errors that can easily be fixed.

Have a look at an easy way for doing image captions (http://nopeople.com/CSS%20tips/image%20captions/index.html). This keeps them together so they stay lined up.

After you fix your ul like this (see highlighted in red) -
</tr>
<tr>
<td width="15" background="http://campustapscom.ipage.com/Images/CollegeBarPageBox2_02.gif"></td>
<td width="624" background="http://campustapscom.ipage.com/Images/CollegeBarPageBox2_03.gif">&nbsp;
<img src="http://campustapscom.ipage.com/Images/campustapslogosmall.jpg" alt="BarPicture" id="barpics">

<p class="caption">Description</p>

<ul class="list">
<li> Monday-</li>
<li>Tuesday-</li>
<li>Wednesday-</li>
<li>Thursday-</li>
<li>Friday-</li>
<li>Saturday-</li>
<li>Sunday-</li>
</ul>

<div id="disqus_thread"><div style="display: none;" id="dsq-content-stub"><img title="DISQUS" alt="DISQUS" src="data:image/png;


Then you can put an id on the taps.com image and a class on the caption text so we can style them (see highlighted in green)




Then in your CSS, make these changes highlighted in red -

#barpics {
height: 39px;
width: 220px;
float: left;
}
.caption {
margin: 0 0 0 250px;
}
ul.list {
width: 100px;
float: left;
clear: left;
}

conphill
12-17-2010, 10:35 PM
I thought this was resolved, but the new issue I have is with my comment box. I use a comment box run from a website. The box is in the right area, but the like button is floated in the center of the box and outside of it. Try going to the same site and giving it a look. It might just be a new div issue

conphill
12-17-2010, 10:41 PM
Not resolved. If you check out the page, it now has the like button from the comments box hovered in the center of the page



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum