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
Old 08-18-2011, 07:46 PM IE stretches div
Extreme Talker

Posts: 176
Trades: 0
In firefox and opera, my page looks correct: http://awesomescreenshot.com/0c9iw0eed

It's a div that is floated to the left with a large margin, with a div on each side of the text inside. In firefox it stretches to accomodate the text. In IE: http://i.imgur.com/qbgJZ.png

(chrome does the right side wrong like firefox, but doesn't stretch it out)

HTML:
HTML Code:
 <div class="page-title">
    <div id="title-left"></div>
    Sam's Page
    <div id="title-right"></div>
 </div>
pretty much all the css:
Code:
    .page-title {
        font-family: "Accidental Presidency", accid;
        background: #5ea4d7;
        color: #ffffff;
        font-size: 53px;
        float: left;
        margin-left: 485px;
        text-align: center;
        height: 64px;
        min-width: 150px;
    }
    
    #title-left {
    width: 94px;
    height: 64px;
    background: url('images/page-title-left.png') no-repeat bottom;
    float: left;
    }
    
    #title-right {
    width: 94px;
    height: 64px;
    background: url('images/page-title-right.png') no-repeat bottom;
    float: right;
    }

Last edited by Skeddles; 08-18-2011 at 07:54 PM..
Skeddles is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-19-2011, 02:10 PM Re: IE stretches div
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://tycoontalk.freelancer.com/css...you-clear.html
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-19-2011, 10:48 PM Re: IE stretches div
Extreme Talker

Posts: 176
Trades: 0
I'm not sure what you're referring to. I understand how clearing them works, but I thought that was just an issue of elements extending out of their containers vertically.

I tried the outer thing from this page, but it did nothing http://css-discuss.incutio.com/wiki/Clearing_Space

Last edited by Skeddles; 08-19-2011 at 10:51 PM..
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 08-20-2011, 04:46 AM Re: IE stretches div
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
uncleared floats will not be constrained by the parent container in both vertical AND horizontal directions.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-20-2011, 12:15 PM Re: IE stretches div
Extreme Talker

Posts: 176
Trades: 0
Do they need to be cleared in the same way?
This does nothing:
HTML Code:
 <div class="page-title">
    <div id="title-left"></div>
 Sam's Page
     <div id="title-right"></div>
     <div class="clear"></div>
 </div>
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 08-20-2011, 02:12 PM Re: IE stretches div
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
and set the right float before the left float in the document flow.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-23-2011, 09:44 AM Re: IE stretches div
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You should avoid adding the non-semantic <div class="clear"> </div>, there are other, better methods for clearing floats that don't add extra un-needed html.

Put this in your css:
HTML Code:
/* self-clear floats */
.group:after { 
  clear: both; 
  content: "\0020"; 
  display: block; 
  height: 0; 
  overflow: hidden; 
  visibility: hidden; 
}

/* IE 7 self-clear floats */
*:first-child+html .group,
*:first-child+html div.article-body,
*:first-child+html #wrap {
  min-height: 1px;
}
Then all you need to do is add class="group" to the div (or other element) that contains the floaded elements.
__________________
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 08-24-2011, 12:35 PM Re: IE stretches div
Extreme Talker

Posts: 176
Trades: 0
thanks guys, It's looking better

I'm not really comfortable with semantics yet, just getting it to work is still challenging, but I'll keep this one in mind

now it works correctly in firefox, chrome and opera. in ie it stretches out still, but at least now looks right

here's ie: http://i.imgur.com/Krkng.png

any idea why? is it possible to fix? not that it really matters, my site is going to look worse in ie no matter what, but it should at least look as good as possible

Last edited by Skeddles; 08-24-2011 at 12:37 PM..
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 08-28-2011, 10:30 AM Re: IE stretches div
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Ideas why? Not really, we need a link to the actual page, none of us can debug an 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
 
Reply     « Reply to IE stretches div
 

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.75068 seconds with 12 queries