CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 19th, 2012, 07:53 PM
dpiearcy dpiearcy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 dpiearcy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 27 sec
Reputation Power: 0
Float isn't floating, it's sinking! ;-)

Ok...

Never had this happen before and I'm by no means a CSS expert.

I develop in php and this current application is heavy on MySQL calls.

So for the medtext fields I'm adding a nl2br to make sure I maintain carriage returns from what was entered.

My problem with the CSS is I have an image to the right. With that php code it adds two line breaks for the carriage returns. Those breaks kill the float so the next "paragraph" will not appear until the bottom of the image.

Obviously I need to clear something. I've tried clearing both on the image to no avail.

Both text and images are in the same div of course.

I'm beginning to think it worth my time to just make two divs. one for the pic and one for the text.

What needs to be cleared???

Reply With Quote
  #2  
Old December 19th, 2012, 07:55 PM
Nanomech's Avatar
Nanomech Nanomech is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Location: The Pleiades
Posts: 196 Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 23 h 53 m 4 sec
Reputation Power: 7
Send a message via Skype to Nanomech
Do you have a link to your site or the php?

Regards,

NM.
__________________
"WERE NOT WORTHY!"
"WERE NOT WORTHY!"

Reply With Quote
  #3  
Old December 19th, 2012, 07:56 PM
dpiearcy dpiearcy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 dpiearcy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 27 sec
Reputation Power: 0
I figure you're going to want to see the code. The CSS first:

Code:
.img_event {
	clear: both;
	float: right;
	margin-top: 10px;
	margin-left: 20px;
	margin-bottom: 20px;
}
#events_holder {
	min-height: 180px;
}


Now the code after the variables are set and my loop begins...

PHP Code:
 $info nl2br($info); 
        echo 
"<div class='clear_all'></div><div id='events_holder'><img src='/NewOrchard/$pic' class='img_event' />
        <h7>
$title</h7>
        
        <p>
$date</p>
        <p>&nbsp;</p>
        <p>
$info</p>
        <p><a href=\"http://
$link\" target=\"_blank\">$linkTxt</a></p>
        <p>&nbsp;</p>
        <p><hr /></p>
        </div>"



I went ahead and threw in the variable with the nl2br setting since that's the one I'm having trouble with.

And so it's not confusing... $pic is just the name of the image in the uploads folder where it went when the event was created.

Reply With Quote
  #4  
Old December 19th, 2012, 08:02 PM
dpiearcy dpiearcy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 dpiearcy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 27 sec
Reputation Power: 0
Quote:
Originally Posted by Nanomech
Do you have a link to your site or the php?

Regards,

NM.


I do. The page I'm working on currently is here:

well...says new users can't post URL's.

Reply With Quote
  #5  
Old December 19th, 2012, 08:10 PM
dpiearcy dpiearcy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 dpiearcy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 27 sec
Reputation Power: 0
Quote:
Originally Posted by Nanomech
Do you have a link to your site or the php?

Regards,

NM.


Since I can't post a URL (goofy rule) look at the php code above and just before $pic you will see /NewOrchard/

Just before that do the usual go to web page stuff but add orchardmidland. Then instead of $pic put in orchard_youth dot php.

Make sense? ;-) How's that for a work around?

Reply With Quote
  #6  
Old December 19th, 2012, 10:45 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,834 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 1 Day 21 h 50 m 9 sec
Reputation Power: 4192
Here's the link: http://www.orchardmidland.com/NewOr...chard_youth.php

Welcome to DevShed Forums, dpiearcy.

As you found out new users are restricted from posting URLs until they have made 5 posts. You didn't need to obfuscate your URL to that extreme degree, you can simply get around the filter by leaving out the "http://" and putting a space before each ".". Yes this rule is annoying, but the administrators say it's necessary for limiting spam.

Have you checked to make sure your pages don't contain errors? (Many CSS3 properties will appear as errors, even when they aren't really errors.)
http://validator.w3.org/
http://jigsaw.w3.org/css-validator/
__________________
Spreading knowledge, one newbie at a time. I'm available for hire at Dynamic Site Solutions.

Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

Remember people spend most of their time on other people's sites (so don't violate web design conventions).

Reply With Quote
  #7  
Old December 19th, 2012, 11:11 PM
dpiearcy dpiearcy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 dpiearcy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 27 sec
Reputation Power: 0
Quote:
Originally Posted by Kravvitz

Have you checked to make sure your pages don't contain errors? (Many CSS3 properties will appear as errors, even when they aren't really errors.)


Thank you for posting my link for me. Should be getting to about 5 now if replies count :-) Trust me, I fight stupid spam all the time on forms and such. I HATE Captcha so you should see my php filter functions I run everything through just to submit a stupid contact form.

But I digress, no I had not ran it through those. I did run the php code (of course it read the rendered html) and it came back with a bunch of "alt name not specified" for images. I do that later in the developing process. I know...I know.. SEO.

I ran the CSS through there and it came back with no errors.

But great links. I book marked them. You never know when you forget to close a link or something. That's going to be a very handy tool.

Reply With Quote
  #8  
Old December 19th, 2012, 11:12 PM
dpiearcy dpiearcy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 dpiearcy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 27 sec
Reputation Power: 0
Quote:
Originally Posted by dpiearcy
Thank you for posting my link for me. Should be getting to about 5 now if replies count :-)


How about that? That last reply made 5 so now I can post URL's!

Doing the happy dance.

Reply With Quote
  #9  
Old December 19th, 2012, 11:27 PM
dpiearcy dpiearcy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 dpiearcy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 27 sec
Reputation Power: 0
Now that I can post URL's the page in question is indeed orchard midland

The events at the bottom you will notice with php adding two line breaks for the carriage return the second paragraph will not float. It drops below the image.

BUT... while you're there, just for fun I had an idea. Click on the home link on the top menu. This will, of course, take you home (index). So I thought...if you were on the home page why would you click this link?

So with php I decided to find out what page they were on and write and if and else if statement and declaring a variable of page. Then, if you are on the home page it equals one thing or if you're on any other page it will equal index.php and function correctly.

So once you're on the home page, hit that home button. I thought it was funny. Not sure what the church I'm developing this page for will think though :-)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Float isn't floating, it's sinking! ;-)

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap