Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-17-2011, 07:12 AM   PM User | #1
eberdome
Regular Coder

 
Join Date: Dec 2010
Location: California
Posts: 193
Thanks: 28
Thanked 8 Times in 8 Posts
eberdome is an unknown quantity at this point
Alignment problem in IE

Hey Everybody,

I'm now having a problem with aligning an li with an img. In FF and all other browsers (except IE of course) the text and image are aligning perfectly. In IE however the text sits right below the image, like its being pushed down. Anyone know why, i have been going at this thing for hours, no dice

Link: http://experiencemediaonline.gorilla....com/services/

Code:

Code:
div#services { width:709px; min-height:440px; overflow:hidden; position:relative; }
ul.expander { height:auto; list-style-type:none; padding:0; padding-bottom:35px; margin:0; border:0; border-bottom:1px solid #B7B7B7; width:709px; }
ul.expander li { text-align:right; font-size:12px; width:534px;  }
ul.expander img {  float:right; width:155px; height:85px; padding:0; margin:0; margin-left:20px; border:1px solid #B7B7B7; }
Thanks in advance!
eberdome is offline   Reply With Quote
Old 02-17-2011, 07:57 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Code:
<ul class="expander">

<img src="/images/temp_img.png">

<li>
Your current markup is invalid. You can't immediately nest any element inside a <ul>/<ol> tag other than <li>
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
eberdome (02-17-2011)
Old 02-17-2011, 08:55 AM   PM User | #3
eberdome
Regular Coder

 
Join Date: Dec 2010
Location: California
Posts: 193
Thanks: 28
Thanked 8 Times in 8 Posts
eberdome is an unknown quantity at this point
I have validated my code and switched things around. At first it was messed up, now I'm back to where i left off... Still looks bad in IE.. Any suggestions?
eberdome is offline   Reply With Quote
Old 02-17-2011, 09:04 AM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
remove float from image and then make the following changes.
Code:
<ul class="expander">
<li class="image"><img src="/images/temp_img.png"></li>
<li class="text"><h3>BROADCAST</h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit curabitur vitae metus leo, </li>

</ul>
Code:
li.image{
float:right;
width:155px;
}
li.text{
margin-right:160px;
}
btw, it looks like your content doesn't appear as a "list". Can't you use <p> tag to wrap that text and and set the float:right to the image and then wrap the whole inside a <div> ?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
eberdome (02-17-2011)
Old 02-17-2011, 09:07 AM   PM User | #5
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello eberdome,
You put a width of 709px on #services and ul.expander but the total width of the li's is 711px. Remove that border on the img and it all fits inside the 709px...

ab is right though, your content is not a list.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Users who have thanked Excavator for this post:
eberdome (02-17-2011)
Old 02-17-2011, 09:36 AM   PM User | #6
eberdome
Regular Coder

 
Join Date: Dec 2010
Location: California
Posts: 193
Thanks: 28
Thanked 8 Times in 8 Posts
eberdome is an unknown quantity at this point
I got it working, thanks a lot guys!
eberdome is offline   Reply With Quote
Reply

Bookmarks

Tags
alignment, css, div

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:26 AM.


Advertisement
Log in to turn off these ads.