CSS Wierdness—Help Needed
Posted: 14 May 2008 07:21 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  49
Joined  2007-11-05

I’m redesigning one of my sites, and I’ve run into a CSS/formatting problem in Firefox (it works as intended in IE—go figure).

The basic layout is like this:

Header 1

Thumbails

Header 2

More Thumbnails

But what’s happening is:

Header 1

Header 2 (in the background, ‘underneath’ the thumbs, as if it’s being rendered before the EE code is executed)

Thumbnails

More Thumbnails

This is my HTML/EE Code dumbed down a bit for readability:

<h5>Header 1</h5>
{exp:weblog:entries weblog="weblogs" dynamic="off"}
<div class="thumbs">{Thumbnail}<a href="{url_title}/">{title}</a></div>
{/exp:weblog:entries}

<h5>Header 2</h5>
{exp:weblog:entries weblog="weblogs_2" dynamic="off"}
<div class="thumbs">{Thumbnail}<a href="{url_title}/">{title}</a></div>
{/exp:weblog:entries}

This is the CSS that affects the H5 & thumbs classes:

.thumbs {
float
:left;
margin-right:3px;
margin-bottom:10px;
width:105px;
}

#blog h5 {
    
width: 550px;
    
height: 21px;
    
color: #FFFFFF;
        
border:0px;
    
text-decoration: none;
    
text-align: left;
    
font: bold 1.22em 'Lucida Grande', Verdana, Arial, Sans-Serif;
    
background-color:#778899;
    
padding: 6px 0 0 5px;
        
margin-bottom:10px;
}

Do you see anything that might be causing this behavior?

Profile
 
 
Posted: 14 May 2008 07:46 PM   [ Ignore ]   [ # 1 ]  
Grad Student
Avatar
Rank
Total Posts:  90
Joined  2007-09-17

Try clearing your h5’s like this:

#blog h5
{
    background
: #778899;
    
clear: both;
    
color: #fff;
    
font: bold 1.22em 'Lucida Grande', Verdana, Arial, Sans-Serif;
    
height: 21px;
    
margin: 0 0 10px 0;
    
padding: 6px 0 0 5px;
    
width: 550px;
}

Be careful, though.  Clearing those might have unexpected consequences if this isn’t the only place you’re using them.

What’s happening here is that your thumbnails div is floated left, and the h5 and divs below that are trying to hang up there with the thumbnails div.

Let us know if that does or doesn’t work.

Profile
 
 
Posted: 14 May 2008 07:49 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  294
Joined  2007-06-24

Try adding to .thumbs

width: 100%;
clear: both;

and to #blog h5

clear: both;

 Signature 

Rob - http://www.blue-dreamer.co.uk/ - because I like blue!

Profile
 
 
Posted: 14 May 2008 07:52 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  49
Joined  2007-11-05

Dude, you’re awesome. Clearing fixed it—these are the only 2 places that I use those tags, so this appears to be a perfect solution.

Thanks a lot, I never would have found this on my own as I hadn’t heard of the clear parameter until now:)I appreciate you cleaning up my markup, too. That’s something I need to be more disciplined with.

Profile
 
 
Posted: 14 May 2008 08:10 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Avatar
Rank
Total Posts:  90
Joined  2007-09-17

Cleaning up will come to you in time wink

I actually didn’t start alphabetizing my css stuff until I got to my current job this past October.  Now, I don’t think I could do without it.  It just makes things a lot easier to follow.

Profile
 
 
Posted: 15 May 2008 02:28 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  294
Joined  2007-06-24
soxhead - 14 May 2008 07:52 PM

Dude, you’re awesome. Clearing fixed it—these are the only 2 places that I use those tags, so this appears to be a perfect solution.

Thanks a lot, I never would have found this on my own as I hadn’t heard of the clear parameter until now:)I appreciate you cleaning up my markup, too. That’s something I need to be more disciplined with.

No problem, glad you got it sorted.

 Signature 

Rob - http://www.blue-dreamer.co.uk/ - because I like blue!

Profile
 
 
Posted: 16 May 2008 04:22 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  636
Joined  2007-06-05

I’ve found you have to at least clear:both one thing if you float any container and want something immediately below it, even if that below container floats too.  And some browsers use clear: differently.

 Signature 

grantmx | designs - design | development | photography | consulting

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 58134 Total Logged-in Users: 24
Total Topics: 68141 Total Anonymous Users: 13
Total Replies: 366990 Total Guests: 400
Total Posts: 435131    
Members ( View Memberlist )
Newest Members:  Doug LernerATATJacob SmithalixJonathon VSgoodbergerDelia RitherdonbborunXofzainabob