March 12, 201313 yr Hello All Question 1: Really frustrating this one as I feel that I should be able to solve this as its a bit of newbie prob, but I've tried messing about with the clear:both and content: " "; and I can't seem to effect a change. Essentially the problem is that one of my paragraphs of text jumps up overlapping another paragraph of text. I cannot set these paragraphs to fixed sizes cos they pull the info from a database and also because the website is responsive/elastic. Its the first and second paragraphs of body text on this page: http://www.mason-uk.co.uk/responsive/html5boilerplate5-contactpage.asp Question 2: Also it would be cool if the bolder first paragraph of text could also wrap around the bottom of the image (if there is enough text there to do it). Is there a simple way of doing that? Many Thanks!
March 12, 201313 yr For the first issue, you can resolve it by removing the float:none and the top position from .toptext. So it's from this: .toptext { top: 130px; float: none; display: block; height: 100%; } To this: .toptext { display: block; height: 100%; } For the second issue, I'm not sure it's possible unless the image is within the same container as the text. But I could be wrong. Lyndsey.
March 12, 201313 yr Author Thanks Lyndsey, That solved my first question but has created a knock on problem: the text now jumps down beneath the picture and is not next to it...
March 12, 201313 yr Ah sorry! In that case, why not try putting the element back to its original state but having a padding bottom to push the text down? At the moment, this code seems to work, but the 'to contact Mason...' text is pushed a bit too far downwards: @media only screen and (min-width: 1140px) { .toptext, .textspan p { font-size: 14px; margin-bottom: 10px; float: none; top: 130px; } } Are you updating right now? Could be why it's changing for me. Edit. Try this: .toptext { float: none; display: block; top: 130px; padding-bottom: 150px; }
March 12, 201313 yr Exactly what Lyndsey said. You're positioning the p in such a way that depending on it's length it will pop out of its container. But yes, removing those two properties breaks the layout you're going for so you might have to play around or maybe restructure that section. I may be able to play around with that. As for your second question; yes, that's extremely easy to do. It's actually what floats were added to CSS for. Here is a super simple demo I just made: http://codepen.io/HeyDanReeves/pen/Jnbqx
March 12, 201313 yr Author Yes was fiddling with it a bit just now. So are you saying that the original code I had for my CSS should be re-instated and then add padding?
March 12, 201313 yr Yes, reinstating the code with added padding worked for me. But maybe heydanreeves has a better idea? I'm not sure if this is the correct way, although it works.
March 12, 201313 yr Author Thanks Again Lyndsey, it did sort of work, It looks ok on that page, but has thrown it out on another page... The problem is making this code robust enough to deal with different sized pics and quantities of text. Cos this website draws itself from a large Database and I don't know how much text there will or wont be on any given entry (or the exact dimensions of a image), plus the responsive aspect, it makes it a bit tricky with things like this. Other Page That it Has Thrown it Out on: http://www.mason-uk.co.uk/responsive/html5boilerplate5-productpage.html Current Page Again: http://www.mason-uk.co.uk/responsive/html5boilerplate5-contactpage.asp Thanks for your response HeydanReeves, Please let me know other ways to restructure this area, I'm bamboozled at the moment PS Just looking at your code demo now and seeing whether I can incorporate that into this design somehow, although not sure how it will work at the lower resolutions with the responsive design, gonna give it a bash! Thanks! Edited March 12, 201313 yr by AblazeRich
March 12, 201313 yr If you look at my demo again (http://codepen.io/HeyDanReeves/pen/Jnbqx) I made it look similar to the section you are styling. Hope that helps at all.
Create an account or sign in to comment