What is wrong with FF and Opera?

Discussion in 'CSS' started by Hades, Feb 11, 2008.

  1. #1
    Okay, seriously, I am totally confused. I am about to crack my head on my wall, so I am asking for the help of the masterful people of DP to help me out :p.

    I just wrote a little html for a certain site that I am coding, but for some reason, my container doesn't repeat in FF or Opera, yet it does in IE7. I don't even know how that is possible. I don't see what I could be doing wrong. Anyway here is part of the code, can anyone help me?


    #container {
    	width:903px;
    	background:url(images/content.gif) repeat-y;
    }
    
    #container-t {
    	background:url(images/content-top.gif) no-repeat;
    	width:903px;
    	height:12px;
    }
    
    #sidebar-l {
    	width:240px;
    	float:left;
    	display:inline;
    }
    
    #sidebar-l .clear {
    	font-size: 1px;
    	height: 1px
    }
    
    .bl {
    	background: url(images/bl.gif) 0 100% no-repeat #4a8d4a;
    	width: 171px;
    	margin:15px auto 0;
    }
    
    .br { background: url(images/br.gif) 100% 100% no-repeat; }
    
    .tl { background: url(images/tl.gif) 0 0 no-repeat; }
    
    .tr {
    	background: url(images/tr.gif) 100% 0 no-repeat;
    	padding:10px
    }
    
    
    #content {
    	width:460px;
    	float:left;
    }
    
    #content h2 {
    	font-family:helvetica87-CondensedHeavy;
    	font-size:23px;
    }
    
    #sidebar-r {
    	width:203px;
    	float:left;
    }
    Code (markup):
    and the html

    	<div id="container">
    	<div id="container-t"></div>
    		<div id="sidebar-l">
    			<div class="bl">
    				<div class="br">
    					<div class="tl">
    						<div class="tr"> Lorem ipsum dolor sit amet consectetur adipisicing elit </div>
    					</div>
    				</div>
    			</div>
    			<div class="clear">&nbsp;</div>
    		</div>
    		<div id="content">
    			<h2>Lorem Ipsum Dolor sit amet</h2>
    			Lorem ipsum dolor sit
    		</div>
    		<div id="sidebar-r">Lorem ipsum dolor sit</div>
    		
    	</div>
    Code (markup):
     
    Hades, Feb 11, 2008 IP
  2. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #2
    Not containing floats? Set overflow to hidden on your containers and they should then hold the floated elements. P-S, the whole point of an extraneous clear element is to CLEAR (clear:both;).
     
    soulscratch, Feb 11, 2008 IP
  3. Hades

    Hades Well-Known Member

    Messages:
    1,873
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    150
    #3
    Hades, Feb 11, 2008 IP
  4. dzdrazil

    dzdrazil Peon

    Messages:
    64
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This may sound silly, but can't <div> tags hold multiple classes? the whole point of div tags is to minimize nesting, or so i've been led to believe.
     
    dzdrazil, Feb 12, 2008 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    Some quite complex schemes for having rounded corners have been developed. I consider this to be a bit silly, but there are some schemes much worse.

    @Hades: The clear property allows an element to clear a float element above it. The overflow property is used to create a new block formatting context that will enclose float elements.

    cheers,

    gary
     
    kk5st, Feb 12, 2008 IP
    Hades likes this.
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    Yes, BUT - attributes overload. If you put that as class="lt rt lb bt" or whatever, only the background attribute on the LAST class would actually show.

    Since it's four different backgrounds, that needs four different div's.

    Even though I dislike that technique because it uses four separate images, requires one of those rubbish clearing DIV's, and doesn't work with transparancies.

    Personally, I prefer:

    <div class="borderBox">
    	<div class="borderTop"><div></div></div>
    	<div class="borderLeft"><div class="borderRight">
    		Content goes here
    	<!-- .borderRight, .borderLeft --></div></div>
    	<div class="borderBottom"><div></div></div>
    <!-- .borderBox --></div>
    Code (markup):
    Which would use a single image and sliding doors. Border-top and border-bottom would have their height set to the radius of your 'rounded', padding left equal to that, and margin-left equal to that. Then the nested DIV would be absolute positioned right negative that radius with a width and height of... you guessed it, the radius.

    You can see an example of this here:
    http://battletech.hopto.org/html_tutorials/eightcorners/template.html

    Which is used for shadows on that page, but can just as easily be rounded corners. It's a hair more code, but it's three to eight less handshakes with the server, and by sharing palette you can actually end up with a smaller single file than you can all those little separate ones... meaning anywhere from two to four times less load time!
     
    deathshadow, Feb 12, 2008 IP
    Hades likes this.
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes, they can contain multiple classes, though it's not always a good thing to do, especially when you can use contextual selectors. :)
     
    Dan Schulz, Feb 12, 2008 IP
  8. dzdrazil

    dzdrazil Peon

    Messages:
    64
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    apologies all around, then. truth is, my student group really needed a website, and rather than having a templated one, i learned what i could in the month between classes over winter break. i probably could've done the whole thing with the 30 day trial of dreamweaver, but i figured learning to code by hand made more sense for the long run.

    guess i shouldn't give up the day job yet :)
     
    dzdrazil, Feb 13, 2008 IP
  9. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Keep at it. You'll get better. :)
     
    Dan Schulz, Feb 13, 2008 IP