Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: CSS Box Model

  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS Box Model

    <html>
    <head>
    <style type="text/css">
    div.ex
    {
    width:220px;
    padding:10px;
    border:5px solid gray;
    margin:0px;
    }
    </style>
    </head>

    <body>
    <img src="250px.gif" width="250" height="1" /><br /><br />

    <div class="ex">The line above is 250px wide.<br />
    The total width of this element is also 250px.</div>

    <p><b>Important:</b> This example will not display correctly in IE8 and earlier
    versions!<br />
    However, we will solve that problem in the next example.</p>

    </body>
    </html>

  • #2
    New Coder
    Join Date
    Sep 2011
    Location
    NY
    Posts
    33
    Thanks
    4
    Thanked 0 Times in 0 Posts
    What is the Css Box in this ? Are you looking for any solution or it's kind of discussion post ?
    I cant get you what you are looking for .

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by himalaya View Post
    This example will not display correctly in IE8 and earlier
    versions!
    It will if you include a doctype tag as the very first thing in the page. Then the box model will work correctly all the way back to IE6.

    It is only in IE5 which introduced those CSS commands while they were still in draft and then had the meaning change d in the final standard where it is not possible to get the box model to work correctly. As that browser is long dead the IE5 version of the box model is only of historical interest to any site written since IE6 was first released.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •