Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Image overlapping other images
Old 06-24-2010, 02:01 PM Image overlapping other images
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
Let's just get it out of the way that I'm a complete CSS amateur. On my sleeping bags page, I have a photo of a sleeping page floating on the left about halfway down the page. I also have a h2 element image and unordered list bullets on the page. However, when I place the sleeping bag photo next to the h2 element or the lists, the text moves over for the image but not the h2 background or the ul bullets. The css images stay in place.

How can I fix this so that the css images move over with the text? Does it have something to do with that my photo is floating?

Code:
.subcontent h2, .innercontent h2, .recipe h2 {
	font-size:1.8em;
	font-weight:lighter;
	background:url(../images/bordertitle.png) no-repeat 0 100%;
	margin:0 8px 0 16px;
	padding:10px 0 7px 0;
}
Code:
.imgleft {
	float:left;
	margin:8px 8px 8px 15px;
	border:1px solid #ababab;
	padding:2px;
}
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
 
Register now for full access!
Old 06-24-2010, 07:40 PM Re: Image overlapping other images
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
The image is an in-line element. The H2 is BLOCK level element. If you want the h2 to move over, set it to display: inline. Or, you can clear the float by adding clear:left to the h2 and it will then sit below the image.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-24-2010, 07:49 PM Re: Image overlapping other images
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
Okay that makes sense. But after I add in display: inline, now the h2 moves over, but it looses the padding and length of the line. And when I tried it with the ul li's, it puts them all on one line.
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
Old 06-24-2010, 07:59 PM Re: Image overlapping other images
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Yup, that is what it does when you switch an hx to display-inline like that, it becomes only as long as the text.

The other solution is to clear the float on the h2 - clear:left, and let it fall below the image.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-25-2010, 02:06 PM Re: Image overlapping other images
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
Well that sucks. There is no way you can think to get around it? I tried to add a clear:left to the li's but it didn't put them on separate lines. Thanks so much for your help!
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
Old 06-25-2010, 03:44 PM Re: Image overlapping other images
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Well, you could also just float the image right instead of left.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-27-2010, 11:41 PM Re: Image overlapping other images
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
Yup. Thanks for your help!
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
Reply     « Reply to Image overlapping other images
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.86909 seconds with 12 queries