Box Model Hack?

This is a discussion on "Box Model Hack?" within the Web Page Design section. This forum, and the thread "Box Model Hack? 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 Feb 1st, 2007, 16:09
Junior Member
Join Date: Dec 2005
Location: Dublin
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Box Model Hack?

Hi

#button
{
width:80px;
height:48px;
float:left;
background-image:url(..images/blank.gif);
}

I have this code that needs to be modified for IE to work, the width has to be reduced for the button divs to fit in IE. I think this has to do with the "box model" but im not sure how to implement it, anyone help?
Reply With Quote

  #2 (permalink)  
Old Feb 1st, 2007, 17:04
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Box Model Hack?

a simple search will find you all the answers you need
Reply With Quote
  #3 (permalink)  
Old Feb 1st, 2007, 21:34
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Box Model Hack?

Don't use any 'hacks'. They are not necessary and will only give you problems later.

The correct way to achieve the sort of adjustments you are after for IE in any situation is to use the conditional statement that only IE understands and load in an IE specific css file. You do this after your default css file so that any IE requirements are over written.

The method takes the form:
Code: Select all
<!--[if IE]>
<link rel="StyleSheet" type="text/css" href="ieonly.css" />
<![endif]-->
Note that you can place things like 'lte', less than equal, between the 'if' and 'IE' and you can have version numbers after the 'IE'
Reply With Quote
  #4 (permalink)  
Old Feb 1st, 2007, 22:36
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Box Model Hack?

I agree. I do my absolute best to avoid using hacks.
Reply With Quote
  #5 (permalink)  
Old Feb 2nd, 2007, 02:10
Reputable Member
Join Date: Jul 2005
Posts: 400
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Box Model Hack?

Hard to say, for sure, without a working example, but I think you can solve the issue by adding another wrapper div and assigning padding or margin or a width to that div instead of the button div. It's not really a hack in the true sense of what hacks are. It's just a workaround that will function even if IE decides to translate the box model correctly. If anyone complains about the extra "unnecessary" div, they can get a life. Again, I'd have to play with this to remember exactly how it went, but in the meantime you can give it a shot.
Reply With Quote
Reply

Tags
box, hack, model

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
box model problem artisites Web Page Design 8 Apr 3rd, 2008 20:15
A Nofollow Hack Corey Bryant Webforumz Cafe 3 Oct 28th, 2007 12:41
need an IE hack please moisea Web Page Design 2 Oct 19th, 2006 22:32
Fluid box - without box model satoshy Web Page Design 5 Aug 3rd, 2005 03:24


All times are GMT. The time now is 15:48.


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