|
|||||||
| CSS Discussion and technical support relating to Cascading Style Sheets. |
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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>
thanks in advance. |
|
#2
|
|||
|
|||
|
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 }
|
|
#3
|
||||
|
||||
|
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 |
|
#4
|
|||
|
|||
|
__________________
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. |
|
#5
|
||||
|
||||
|
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. |
|
#6
|
|||
|
|||
|
__________________
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. |
|
#7
|
||||
|
||||
|
thanks everyone! i will try all of them^^
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|