[SOLVED] simple div problem

This is a discussion on "[SOLVED] simple div problem" within the Web Page Design section. This forum, and the thread "[SOLVED] simple div problem are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 4th, 2008, 09:44
New Member
Join Date: Mar 2007
Location: uk
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] simple div problem

Hi, I am currently updating an existing subsite for my company which I did not originally make.

I have mainly just changed the css but in order to apply a white border around the site I have added two new divs. IE displays the site fine but in Firefox the border around the container div stops just below the banner instead of encompassing the site.

This is no doubt a very simple problem but one I am unable to fix so any help would be greatly appreciated.

The link is http://interactive-learning.info/productstest/

Cheers
Reply With Quote

  #2 (permalink)  
Old Apr 4th, 2008, 09:58
Aso's Avatar
Aso Aso is online now
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,140
Blog Entries: 2
Thanks: 5
Thanked 39 Times in 36 Posts
Re: simple div problem

Add this to your CSS;
Code: Select all
#container:after {
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #3 (permalink)  
Old Apr 4th, 2008, 11:35
New Member
Join Date: Mar 2007
Location: uk
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: simple div problem

Thank you, you're an absolute star!
Reply With Quote
  #4 (permalink)  
Old Apr 4th, 2008, 14:10
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,319
Blog Entries: 8
Thanks: 13
Thanked 6 Times in 6 Posts
Re: [SOLVED] simple div problem

aso,

Do you mind explaining quite what the content:'.'; bit is all about?
__________________
Resources Administrator


Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Reply With Quote
  #5 (permalink)  
Old Apr 4th, 2008, 14:49
Aso's Avatar
Aso Aso is online now
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,140
Blog Entries: 2
Thanks: 5
Thanked 39 Times in 36 Posts
Re: [SOLVED] simple div problem

This technique enables designers to clear floats without having to add unnecessary source markup.

The :after pseudo allows content to be inserted after the element in question. Although IE does not understand it, we needn't worry since IE clears floats by itself anyway (incorrectly).

The content is simply a dot (.), which is then hidden and set to display:block.

However, the important line is clear:both. This clears any floats within the element itself, forcing it to fully encase them.



Full details of solution: Clearing floats without source markup.

Details of :after pseudo at W3Schools.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #6 (permalink)  
Old Apr 4th, 2008, 14:56
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,319
Blog Entries: 8
Thanks: 13
Thanked 6 Times in 6 Posts
Re: [SOLVED] simple div problem

Thanks Alex, all sorted. What an amazingly easy method
__________________
Resources Administrator


Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] simple layout problem saltedm8 Web Page Design 13 May 2nd, 2008 18:02
[SOLVED] Simple Php Code Problem longstand PHP Forum 3 Oct 17th, 2007 21:02
Simple Problem Please Help! bthomson82 JavaScript Forum 3 Jun 22nd, 2007 02:59
Really simple positioning problem :( camcool21 Web Page Design 4 Dec 30th, 2006 18:25
(hopefully) simple navigation problem edd_jedi Web Page Design 3 Jul 26th, 2006 15:06


All times are GMT. The time now is 20:39.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43