I am having problems modifying my Comments Layout.
Here is a stripped down version of what I am having problems with now…
Why does the background-color for the class “commentBottom” set the background to Orange for the whole parent DIV?!
(And also why does the Purple background-color for “userInfo” extend to the right underneath “userPost”?? Looks like the same problem…)
I want it so that the following sub-areas can have their own distinctive colors:
- commentBody
or
- userInfo
- userPost
and
- commentBottom
- commentWrapper
Here is the HTML for it…
<div id="boxComments">
<h3>What Do You Think?</h3>
<p>To leave a comment, you need to...</p>
<div class="commentWrapper">
<div class="commentBody">
<div class="userInfo">
<a href="#" class="username">
<strong>username</strong>
</a>
<img class="noborder" src="/community/uploads/' . $photoName . '" width="100" alt="" />
<dl>
<dt>Joined:</dt>
<dd>date</dd>
<dt>Location:</dt>
<dd>location</dd>
<dt>Posts:</dt>
<dd>' . $posts . '</dd>
</dl>
</div>
<div class="userPost">
<span class="commentDate">Posted on: date</span>
<span class="commentNo">commentCount</span>
<p>$comments</p>
</div>
</div>
<div class="commentBottom">LOOK</div>
</div>
Here are my styles…
#boxComments .commentWrapper{
/* background-color:aqua; /**/
}
#boxComments .commentBody{
float: left;
clear: both;
max-width: 640px;
margin: 20px 0;
background-color: #A0A; /**/
border-top: 1px solid #333;
}
#boxComments .userInfo{
float: left;
width: 170px; /**/
padding: 10px 0px 0 0; /**/
font-size: 0.9em;
text-align: center;
}
#boxComments .userInfo a{
padding: 0 0.7em 0 0;
color: #0071D8;
font-size: 1.1em;
font-weight: bold;
text-decoration: none;
}
#boxComments .userInfo dl{
margin: 0;
padding: 10px 0 0 0;
}
#boxComments .userInfo dt{
float: left;
width: 4.5em;
text-align: right; /**/
}
#boxComments .userInfo dd{
margin: 0 0 0 5em;
text-align: left;
}
#boxComments .userPost{
float: left;
max-width: 430px; /* 115px + 225px = 340px */
/* FIX THIS */
min-width: 430px; /**/
padding: 10px 20px 20px 20px; /**/
font-size: 0.9em;
background-color: #F4F4F4; /**/
}
#boxComments .commentDate{
display: inline-block;
padding: 0 0 10px 0;
color: #AAA;
}
#boxComments .commentNo{
display: inline-block;
float: right;
padding: 0 0 10px 0;
color: #AAA;
}
#boxComments .commentBottom{
margin:0;
padding: 0;
background-color: orange; /**/
}
Hope that makes sense?!
BTW, would I want to your position: relative here, and why or why not?
Thanks,
Debbie