Hi all!
I have a classic two-column layout on this site (link is to the post with the problem I'm having):
http://cityoperavancouver.com/archives/1560
I'm discovering that when I apply a left float to an image in the content area, it drops down to below the bottom of the left-side menu. In this case, it's the "Give Art to Make Music" graphic of the painting on a music stand that's having the problem.
Below is the relevant (I think) CSS I'm using for the site structure, side menu, and left-floated images. I've tried quite a few things but nothing seems to work. Since text in the right-hand content area stays where it's supposed to and "floats to the top", I'm puzzled that images don't.
Hope you can point me in the right direction - thanks!
Adam
SITE STRUCTURE:
#wrapper { background-color: white; margin: auto; padding: auto; width: 700px; text-align: left; } #header { text-align: center; height: 193px; width: 700px; margin: 0; padding: 0; } #page { float: left; background: white url(<a href="http://www.cityoperavancouver.com/wordpress/wp-content/themes/cov/images/bgcols.gif" rel="nofollow">http://www.cityoperavancouver.com/wordpress/wp-content/themes/cov/images/bgcols.gif</a>) left top repeat-y; clear: both; } #content { width: 450px; margin-left: 238px; padding: 25px 0; }
SIDE MENU:
.sidemenu, .sidemenu li ul{ z-index: 1000; list-style-type: none; margin: 0; padding: 0; width: 217px; /*WIDTH OF MAIN MENU ITEMS*/ } .sidemenu { float: left; margin-top: 0; } .sidemenu li{ position: relative; } .sidemenu li a { background: #CCCC99; border-bottom: 1px dotted black; font: 14px Arial, Verdana, Helvetica, sans-serif; font-weight: bold; line-height: 24px; color: black; display: block; width: auto; padding: 5px 0; padding-left: 10px; text-decoration: none; } .sidemenu li ul{ /*SUB MENU STYLE*/ position: absolute; width: 190px; /*WIDTH OF SUB MENU ITEMS*/ left: 0; top: 0; display: none; } .sidemenu li ul li{ float: left; } .sidemenu li ul a{ width: 180px; /*WIDTH OF SUB MENU ITEMS - 10px padding-left for A elements */ } .sidemenu .arrowdiv{ position: absolute; right: 2px; background: transparent url(<a href="http://www.cityoperavancouver.com/wordpress/wp-content/themes/cov/images/arrow.gif" rel="nofollow">http://www.cityoperavancouver.com/wordpress/wp-content/themes/cov/images/arrow.gif</a>) no-repeat center right; } .sidemenu li a:visited, .sidemenu li a:active{ color: black; } .sidemenu li a:hover, .sidemenu ul li a:hover, .sidemenu li#currentpage a { background: #996600; }
LEFT-FLOATED IMAGES:
img.alignleft { float: left; padding: 0; margin: 0; display: inline; clear: none; }
This image
This image -http://cityoperavancouver.com/wordpress/wp-content/uploads/2010/07/art-music-websize.jpg - has a float: left applied to it and it's not below the left column.
Please further explain your issue.
Vancouver eh? Is it snowing
Vancouver eh? Is it snowing up there in the far north yet? Here in the southern tropical climes of Victoria the weather is holding up so far.
Hi guys! Sorry not to reply
Hi guys! Sorry not to reply sooner, I managed to not have notifications turned on for this topic! D'OH!
Anyway, to explain further, and add some possibly helpful new discoveries:
The image is supposed to be at the top of the article, on the left side, next to the text. But as you can see, it gets "pushed down" to just below the bottom of the side menu DIV. It's almost like a float drop, but if so, I don't understand why the text is not similarly affected.
If I take the "float:left" attribute off of .sidemenu, then the entire article gets pushed down to the same spot, BUT, the image aligns correctly!
See image of this behaviour:
![]()
Hope that extra info is helpful... thanks!
adam
PS - Ed, I have my snow shovel at the ready, but so far, it has not been required... yet.
validate yer code
validate yer code
Validated but still a problem...
Thanks, I have now validated it - mostly by adding ALT tags and closing my DIV's - however the issue persists.
In a seemingly related issue, any image, whether aligned left or right, is pushed down to below the side menu, in this post:
http://cityoperavancouver.com/archives/1606
Something about the side menu seems to be triggering float drop, but I can't for the life of me figure out what...
adam
Wrap both #verticalmenu and
Wrap both #verticalmenu and #homelogos in a container element and float that left instead. Then remove the margin-left from #content and instead float it right.
Or put overflow:hidden on
Or put overflow:hidden on .post
THANK YOU TYSSEN! I went for
THANK YOU TYSSEN! I went for your solution and it worked perfectly.
Still not quite sure what happened there... the menu was set to a precise width yet it was "pushing" the pic down... but not text? Weird.
I guess the left-margin technique, for creating space to the left of the main column for the menu, isn't really the best, or at least not in this situation. At any rate I think I will avoid it in future...
Again many thanks.
Adam
_________________________________________________________________________________________
Please VOTE (and vote again!) for my "Mad Men" Casting Call contest entry. Ends September 6! http://bit.ly/99bVfN





