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 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2006
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with nested div elements

    This has given me a rather large headache. I have the following code in my web page.

    Here is a link to my web page or you can view the isolated code below.
    http://www.aatwo.com/admin/submitNews.php

    html code
    Code:
    <div id="content">
    	<div id="submitNewsForm">
    		<form name="newsForm" action="newsSubmit.php" method="post" enctype="multipart/form-data">
    			<p>
    				Username:
    				<input name="username" type="text">
    			</p>
    			<p>
    				Password:
    				<input name="password" type="text">
    			</p>
    			<p>
    				Article Name:
    				<input name="articleName" type="text">
    			</p>
    			<p>
    				Article:
    				<textarea name="article"></textarea>
    			</p>
    			<p>
    				Image (220x80):
    				<input name="image" type="file">
    			</p>
    			<input name="currentDate" id="currentDate" type="hidden">
    			<input name="modifyDate" id="modifyDate" type="hidden">
    			<input type="button" value="Submit" onclick="obtainDate();">
    		</form>
    	</div>
    </div>
    css code
    Code:
    #content {
    	background-image: url('http://www.aatwo.com/images/template/original/bodyMiddle.png');
    	background-repeat: repeat-y;
    }
    #submitNewsForm {
    	width: 500px;
    	background: green;
    }

    Why does the div tag with the id 'submitNewsForm' refuse to allow any form of styling to be applied to it? As you can see on my site, all it does is cover the content element with a black white background.

  • #2
    New Coder
    Join Date
    Nov 2006
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Gar nvm. honest to god this has not been working until the second I posted this thread. it seems to have started to work now for no reason. I never even changed any of my code :s

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello again aatwo,
    Did you look at this in FF? #submitNewForm needs positioned... like this maybe:
    Code:
    /* End footer content */
    /* Submit news form */
    #submitNewsForm {
    	width: 500px;
    	background: green;
    margin: 0 auto;
    }/* End submit news form */
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #4
    New Coder
    Join Date
    Nov 2006
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you once again Excavator.

    The primary reason for the page remaining in a single state despite how much I changed the css file was all down to me defining the css file link in the web pages header to be an absolute address. And so of course it was was using the same css file all along (the one on my server rather than the one on my hard disk).

    A sure sign of insomnia -_-


  •  

    Posting Permissions

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