Web Hosting Forum | Lunarpages
News: October 6, 2008 - Submit Your Site for the October 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 14, 2008, 02:27:29 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Weird CSS behavior that has me scratching my head. Any Suggestions?  (Read 307 times)
ARCHeForm
Spacescooter Operator
*****
Offline Offline

Posts: 35



« on: December 17, 2007, 04:30:03 PM »

I'm having problems with text wrapping around floating elements properly on a couple of pages I've created.  Oddly, the behavior only occurs the first time the page is loaded.  If you refresh the page, the text wrap weirdness goes away.

Here's a link to a page in question: Check this out.

In the example above, the text in question overlays the image of the "gunslinger" floating on the right when it should be wrapping.  And, of course, the minute the refresh button is clicked, the page renders the way it was intended to.  If you refresh / reload the page, but want to see the odd behavior again, just clear the browsers cache...

Could this be resolved by preloading the image(s), or is it a stylesheet issue?

Oddly, here is a nearly identical page that does not exhibit the same weirdness: Check this out.

Both of the example pages have validated as Transitional HTML 4.01.  Obviously, feel free to view the source on the pages.

The stylesheet for the website can be viewed here.  Oh, and it too has passed CSS validation.

If you would rather see code posted here, let me know and I'll post it...

I'm stumped and could really use some help.  Anyone know what might be causing this?  Any ideas how to prevent this?
« Last Edit: December 17, 2007, 04:43:19 PM by ARCHeForm » Logged

ARCHeForm
aka Brandon R.
Ibanez Player 85
Galactic Royalty
*****
Offline Offline

Posts: 428


WWW
« Reply #1 on: December 17, 2007, 05:02:29 PM »

Not sure if this will work or not, but try adding:

Code:
clear: right;

or

Code:
clear: both;

to your f-right class and see if that gives you any results...
Logged

Refined Web Design
http://refinedwebdesign.com
ARCHeForm
Spacescooter Operator
*****
Offline Offline

Posts: 35



« Reply #2 on: December 17, 2007, 05:11:59 PM »

Thanks ibanezplayer85.

Code: (I modified my main.css file as follows:)
.f-left {
float: left;
clear: both;
margin-right: 20px;
}

.f-right {
float: right;
clear: both;
margin-left: 20px;
}

Code: (I also tried:)
.f-left {
float: left;
clear: left;
margin-right: 20px;
}

.f-right {
float: right;
clear: right;
margin-left: 20px;
}

Neither of these changed the behavior of the page.  I've reverted back to the original stylesheet, which did not have the 'clear' tags...

I'm telling you, it's weird... especially considering it gets it right on the reload...

Oh, and the paragraph under the 'Action Points:' header wraps correctly, it's just the paragraph under the "Class Skills:" header...

Anyway, I'm going to keep playing with it, but any help in the matter would be great!!
« Last Edit: December 17, 2007, 05:15:50 PM by ARCHeForm » Logged

ARCHeForm
aka Brandon R.
Ibanez Player 85
Galactic Royalty
*****
Offline Offline

Posts: 428


WWW
« Reply #3 on: December 17, 2007, 05:18:23 PM »

Could be a PNG-related issue... I don't believe it's fully supported by all browsers yet.  I can't think of anything else...
Logged

Refined Web Design
http://refinedwebdesign.com
ARCHeForm
Spacescooter Operator
*****
Offline Offline

Posts: 35



« Reply #4 on: December 17, 2007, 05:21:39 PM »

Could be...

I think I'll try adding 'height' and 'width' tads to the image and see if that helps force the text wrap...

Well...  That did it...  I guess the browser was having issues identifying the image's size...

Hmm...  now I need to go through and add 'height' and 'width' tags to all my floating images...

Thanks for your help!!
« Last Edit: December 17, 2007, 05:24:55 PM by ARCHeForm » Logged

ARCHeForm
aka Brandon R.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM