- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
October 31, 2011 at 10:32 am #34987djpicParticipant
I need help with a div block problem.
I want it to look like this:
Correct LayoutBut instead, it displays like this:
How it appearsHere is the HTML code:
Upcoming City Holidays
Christmas
Sunday, Decemeber 25th
Thanksgiving
Wednesday, Decemeber 25th
Annoucements
New City Policy
By: John Doe
New City Policy
By: John Doe
New City Policy
By: John Doe
New City Policy
By: John Doe
New City Policy
By: John Doe
This is the Style Sheet:
#holidays, #announcements {
float: left;
width: 200px;
border: 1px solid #000;
padding: 0px;
text-align: center;
margin-right: 5px;
height: 150px;
overflow: hidden;
}
#holidays h3, #announcements h3 {
background-color: #006;
display: block;
color: #FFF;
text-align: center;
padding-top: 2px;
padding-bottom: 2px;
font-size: 14px;
margin-bottom: 20px;
}
#announcements {
margin-right: 0px;
text-align: left;
width: 471px;
}
#announcements div {
overflow: scroll;
overflow-style: marquee-line;
height: 100%;
}
#announcements h3 {
margin-bottom: 0px;
}
#announcements h4 {
margin-top: 10px;
margin-bottom: 10px;
margin-left: 10px;
font-size: 14px;
}
#announcements span {
font-style: italic;
font-weight: normal;
font-size: 12px;
}
#holidays p {
padding: 0px;
font-size: 12px;
margin-top: 0px;
font-style: italic;
}
#holidays span {
font-weight: bold;
font-style: normal;
}
#Content {
width: 680px;
padding-left: 60px;
padding-right: 60px;
padding-bottom: 5px;
padding-top: 0px;
background-image: url(../../layout/content_background.jpg);
clear: both;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
}
October 31, 2011 at 12:38 pm #89978takeiteasy04MemberTry adding this…
…just above the closing tag of the “#Content” div.
October 31, 2011 at 1:55 pm #89981djpicParticipantLooks like the overflow: hidden worked but why?
The other problem I have now is the h3 tag is not flush to the containing div tag.
h3 no flushOctober 31, 2011 at 2:19 pm #89982djpicParticipantNever-mind, I figured it out. I needed to add a “marign-top: 0px” for the h3 tags. I believe it was because the box had no boundary to push against. Still curious why overflow: hidden worked though.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘CSS’ is closed to new topics and replies.