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.
|
|
|
|
|
![]() |
||
Box Model Hack?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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? |
|
|
|
||||
|
Re: Box Model Hack?
a simple search will find you all the answers you need
|
|
|||
|
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:
|
|
||||
|
Re: Box Model Hack?
I agree. I do my absolute best to avoid using hacks.
|
|
|||
|
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.
|
![]() |
| Tags |
| box, hack, model |
| Thread Tools | |
|
|
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 |