www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > CSS

    CSS Discussion and technical support relating to Cascading Style Sheets.

    Reply
     
    Thread Tools Rate Thread Display Modes
      #1  
    Old 11-22-2005, 02:16 PM
    saulss's Avatar
    saulss saulss is offline
    Another Registered User
     
    Join Date: Sep 2005
    Location: in my house
    Posts: 234
    Css border affecting width

    Hello
    When i run the following testing code using ie, everything looks fine, the problem occurs when using firefox
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    
    <html>
    <head>
    	<style>
    	body{
    	margin:0px;
    	}
    	.ruler{
    	width:200px;background-color:black;
    	}
    	.someBox{
    	width:200px;
    	border: solid 5px yellow;
    	background-color:red;
    	}
    	</style>
    </head>
    
    <body>
    <div class="ruler">ruler</div>
    <div class="someBox">other</div>
    
    </body>
    </html>
    ive noticed that ie will display the 5px border without altering the width, inside the box, therefore keeping the set width; firefox adds the 5px border to the box (i think thats how it should really be), making the total width be equal to 210px. That completely screws up my page layout, is there some sort of workaround to that?
    thanks in advance.
    __________________
    (\ /)
    (O.o)
    (> <)
    <- Bunny was here...
    Reply With Quote
      #2  
    Old 11-22-2005, 03:10 PM
    radiks radiks is offline
    Registered User
     
    Join Date: Nov 2005
    Posts: 14
    You should find this helpful: http://www.chrisbeach.co.uk/core/scr...er.php?ID=8498

    or just add
    Code:
    * { box-sizing:border-box; -moz-box-sizing:border-box }
    to your css
    Reply With Quote
      #3  
    Old 11-22-2005, 05:30 PM
    ray326's Avatar
    ray326 ray326 is offline
    Got Link?
     
    Join Date: Nov 2003
    Location: Jerryville, Tejas
    Posts: 11,741
    You can use the !important hack.
    {
    ...
    width: 190px !important;
    width: 200px;
    ...
    }
    __________________
    Help Save Ana

    Why use Web Standards: Zeldman
    How (new): Castro
    How (experienced): Cederholm
    If you can only get one book and you're already HTML savvy then this is it:
    stylin' with CSS: A Designer's Guide
    Charles Wyke-Smith
    New Riders


    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
    Reply With Quote
      #4  
    Old 11-22-2005, 07:04 PM
    Kravvitz Kravvitz is offline
    CSS & JS/DOM Adept
     
    Join Date: Jul 2005
    Location: USA
    Posts: 3,914
    __________________
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions

    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

    Check out my blog.
    Reply With Quote
      #5  
    Old 11-22-2005, 10:26 PM
    Siddan's Avatar
    Siddan Siddan is offline
    User is registered
     
    Join Date: Jan 2004
    Location: Sweden
    Posts: 842
    Ahh,, just tested the -moz alternative and it works fine in FF, setting it to more logical use around widths and paddings...

    but since I am using the w3c doctype to take out IE from Quirks mode, the padding will still increase the width size

    Must I take back IE to quirks mode so the box model will work the same in both FF and IE?

    Last edited by Siddan; 11-22-2005 at 10:30 PM.
    Reply With Quote
      #6  
    Old 11-22-2005, 11:28 PM
    Kravvitz Kravvitz is offline
    CSS & JS/DOM Adept
     
    Join Date: Jul 2005
    Location: USA
    Posts: 3,914
    __________________
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions

    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

    Check out my blog.
    Reply With Quote
      #7  
    Old 11-22-2005, 11:32 PM
    saulss's Avatar
    saulss saulss is offline
    Another Registered User
     
    Join Date: Sep 2005
    Location: in my house
    Posts: 234
    thanks everyone! i will try all of them^^
    __________________
    (\ /)
    (O.o)
    (> <)
    <- Bunny was here...
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools
    Display Modes Rate This Thread
    Rate This Thread:

    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 Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 01:08 PM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.