로그인, 회원가입후 더 많은 혜택을 누리세요 회원가입 닫기





<html>
<head>
    <title></title>
    <style type="text/css">
        #div1{
            background:yellow;
            border:0px;
            padding:50px 50px 50px 50px;
            width:400px;
            height:400px;
        }
        #div2{
            margin: 10 10 10 10;
            background:red;
            border:0px;
            padding:0px;
            width:200px;
            height:200px;
        }
    </style>
    <script type="text/javascript" src="/Js/jquery-1.4.2.min.js" />
    <script type="text/javascript">
    $(document).ready(function(){
        $("#btn").click(function(){
            var element = $("#div2");

            alert("높이 : "+element.height());
            alert("너비 : "+element.width());

            alert("높이 : "+element.outerHeight());
            alert("너비 : "+element.outerWidth());

            alert("마진포함높이 : "+element.outerHeight(true));
            alert("마진포함너비 : "+element.outerWidth(true));       
        });
    });
    </script>
</head>
<body>
    <button id="btn">Click</button>
    <div id="div1">
        <div id="div2"><div>
    </div>

</body>
</html>