Results 1 to 2 of 2

Thread: Css div size problem

  1. #1
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default Css div size problem

    For some reason this div isn't the right size. I've attached what it looks like.

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
    <script type="text/javascript">
    jQuery(function($){
    	var field1 = $('#fldrChatWindow');
    	$('#send').click(function(){
    		if(!field1.html()){
    			alert("Please enter a value");
    			field1.focus();
    			return;
    		}
    		jQuery.ajax({
    			url: 'process.php',
    			type: 'post',
    			data: 'field1value=' + field1.html(),
    			success: function(results){
    				alert(results);
    			}
    		});
    	});
    });
    </script>
    </head>
    <body>
    <body>
    <div style="float:left; width:33.3%; height:60%; background-color:white; border: 3px darkgrey solid; overflow:auto;" id="fldrChatWindow" contenteditable></div>
    <input type="button" value="Submit" id="send">
    </body>
    </body>
    </html>
    Attachment 4374
    Last edited by keyboard; 04-22-2012 at 03:26 AM.

  2. #2
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    Hmm just worked something out


    Code:
    <html>
    <head>
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
    <script type="text/javascript">
    jQuery(function($){
    	var field1 = $('#fldrChatWindow');
    	$('#send').click(function(){
    		if(!field1.html()){
    			alert("Please enter a value");
    			field1.focus();
    			return;
    		}
    		jQuery.ajax({
    			url: 'process.php',
    			type: 'post',
    			data: 'field1value=' + field1.html(),
    			success: function(results){
    				alert(results);
    			}
    		});
    	});
    });
    </script>
    </head>
    <body>
    <body>
    <div style="float:left; width:33.3%; height:60%; background-color:white; border: 3px darkgrey solid; overflow:auto;" id="fldrChatWindow" contenteditable></div>
    <input type="button" value="Submit" id="send">
    </body>
    </body>
    </html>
    Works fine but

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
    <script type="text/javascript">
    jQuery(function($){
    	var field1 = $('#fldrChatWindow');
    	$('#send').click(function(){
    		if(!field1.html()){
    			alert("Please enter a value");
    			field1.focus();
    			return;
    		}
    		jQuery.ajax({
    			url: 'process.php',
    			type: 'post',
    			data: 'field1value=' + field1.html(),
    			success: function(results){
    				alert(results);
    			}
    		});
    	});
    });
    </script>
    </head>
    <body>
    <body>
    <div style="float:left; width:33.3%; height:60%; background-color:white; border: 3px darkgrey solid; overflow:auto;" id="fldrChatWindow" contenteditable></div>
    <input type="button" value="Submit" id="send">
    </body>
    </body>
    </html>
    Dosen't

    Anyone know why the doctype is messing it up???

Bookmarks

Posting Permissions

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