-
How to get footer div to stick to bottom of page
Thank you pippin62, that works fine.
-
How to get footer div to stick to bottom of page
I'm creating a website and I'm trying to work out how to get my footer div to stick to the bottom of the page. This is the CSS code I've written: #footer { position: absolute; bottom: 0px; height: 50px; width: 935px; background-color: red; } This is the HTML code used to insert the div tag (I've put this code at the bottom of my page, just before the </body> tag): <div id="footer">This is a footer</div> The problem I'm having is that the footer is floating halfway up the page, staying in exactly the same position when I scroll up/down the page and covering the content. But I can't work out how to get it to stay at the bottom of the page, could someone let me know what I'm doing wrong please? Thank you for any help.
- What am I doing wrong with this Javascript code?
-
What am I doing wrong with this Javascript code?
I'm learning to use JavaScript using video tutorials on YouTube, I've just been doing some practising on what I've learnt so far, but there's something I'm stuck on. I've been learning how to use function parameters, so to get a bit of practise I decided to try to make a button that will make a popup appear saying "Hello Daniel". This is the code I've written: <!doctype html> <head> <title>Javascript practise</title> <script type="text/javascript"> function greet(name){ alert("Hello "+name); } </script> </head> <body> <form> <input type="button" value="Say hello" onclick="greet("Daniel")"> </form> </body> </html> But for some reason when I click on the button, nothing happens. However if I try to call the 'greet' function from within the script tags (as shown below), it works exactly how I intended it to work (but without the button, which is what I was trying to do). <!doctype html> <head> <title>Javascript practise</title> <script type="text/javascript"> function greet(name){ alert("Hello "+name); } greet("Daniel"); </script> </head> <body> </body> </html> Could someone tell me what it is I'm doing wrong please? Sorry if my question is confusing, I'm just learning JavaScript so I'm not 100% sure what the different terms are for certain things. Thank you for any help.
-
Is this the correct PHP code to email this form?
I've created a contact form for my website, and I've written some PHP code to send the results to my email address (I don't know if it works or not yet because I haven't uploaded my website to an internet server). Could someone tell me if the code looks OK, or if there's something that needs changing please? This is my HTML code: <form name="form1" method="post" action="contact-us-submit.php"> <label for="text1">Name</label><input name="name" type="text" size="35" /> <label for="text2">Email Address</label><input name="email" type="text" size="35" /> <label for="textarea1">Message</label><textarea name="message" cols="28" rows="5"></textarea> <input name="Reset" type="reset" value="Reset" /> <input name="Submit" type="submit" value="Submit" /> </form> This is the PHP code on the 'contact-us-submit.php' page: <?php $name=$_POST["name"]; $email=$_POST["email"]; $message=$_POST["message"]; $to="myemail@domain.com"; mail($name, $email, $message, $to); ?> I've tried to do it myself, but I'm not sure if I've done it right or not (because I've taken tips from different websites and tried to work it out myself), it's mainly the 'mail' function I'm not sure about. Could someone let me know if something's wrong with any of the code please? Thank you for any help.
-
What PHP code do I need to send this form to my email address?
Thank you for your help Nillervision, I'm going to leave the class attributes in because I have a different positioning for each of the fields on the page. I'll change the submit page to a PHP file. Thank you again.
-
What PHP code do I need to send this form to my email address?
Sorry that there's a lot of code, I didn't do any of the code myself, so it's just how Dreamweaver has done it. I don't have much experience with HTML code (especially forms), so I can't tell whether there's any code that I could delete.
-
What PHP code do I need to send this form to my email address?
I've created a contact form using Adobe Dreamweaver, but I can't work out how to get it sent to my email address when someone fills it in. While creating the form using Dreamweaver I've used some Spry Validation Text Fields to create the required fields in my form. Although I'm not sure if that could interfere with the PHP code. I've put the code for my form below: <form id="form1" name="form1" method="post" action="contact-us-submit.html"> <span id="sprytextfield1"> <label for="text1">Name <span class="required">*</span></label> <input name="text1" type="text" class="c-name" id="text1" size="35" autofocus="autofocus" /> <span class="textfieldRequiredMsg">Please enter your name</span></span> <p><span id="sprytextfield2"> <label for="text2">Email address <span class="required">*</span></label> <input name="text2" type="text" class="c-emailaddress" id="text2" size="35" /> <span class="textfieldRequiredMsg">Please enter your email address</span><span class="textfieldInvalidFormatMsg">Please enter a valid email address, e.g. name@example.com</span></span></p> <p><span id="spryconfirm1"> <label for="text3">Re-enter email address <span class="required">*</span></label> <input name="text3" type="text" class="c-confirmemailaddress" id="text3" size="35" /> <span class="confirmRequiredMsg">Please re-enter your email address</span><span class="confirmInvalidMsg">The two email addresses don't match</span></span></p> <p><span id="sprytextarea1"> <label for="textarea1">Message <span class="required">*</span></label> <textarea name="textarea1" cols="28" rows="5" class="message" id="textarea1"></textarea> <span class="textareaRequiredMsg">Please enter your message</span></span></p> <p> <input name="Reset" type="reset" class="resetbutton" id="button" value="Reset" /> <input name="button2" type="submit" class="submitbutton" id="button2" value="Submit" /> </p> </form> As well as the code that Dreamweaver has inserted to control the Spry form fields (looking at the code, it looks like the extra code is mainly to display the error messages when incorrect information is entered), there's some CSS classes that I've put in to control the style/layout of the form (which I think has probably confused things even more). Could someone tell me what PHP code I need to write to get this form sent to my email address please (if it can be done when using the Spry form fields)? Thank you for any help. P.S. I haven't put my email address on here because I'm always a bit concerned about putting my email address on public forums, so I just wanted to let you know that it's not because I don't trust anyone, it's just that I'm a bit overcautious. Thank you again.
-
How do I display my footer div at the bottom of the web page?
Thank you, that worked fine.
-
How do I display my footer div at the bottom of the web page?
I've created a footer div for my website, but I can't seem to get it to stay at the bottom of the page. I want it so that the div is always at the bottom of the page even when there's not much content on the page, and if there's a lot of content on the page, the footer should move down the page with the content (so it's always at the bottom). Here's the CSS I've created for the footer div: #footer { position: absolute; bottom: 0; width: 100%; height: 40px; background-image: url(images/footerbackground.fw.png); } Here's the HTML I've created to display the footer: <div id="footer"><a href="contactus.html">Contact us</a> | <a href="copyright.html">Copyright</a> | <a href="faqs.html">FAQs</a> | <a href="feedback.html">Feedback</a> | <a href="brokenlink.html">Report a broken link</a></div> The problem is, on pages which don't have much content the footer div is displayed at the bottom of the page exactly as I wanted it. But on pages with a lot of content, the footer div stays in the same place, so the text goes through the footer rather than the footer being at the bottom (underneath all the content). How can I correct this? Thank you for any help.
- Why won't this CSS background image work on my menu bar?
-
Why won't this CSS background image work on my menu bar?
I'm using Dreamweaver to create my website, and have inserted a Spry Menu Bar on my pages. Today I created some images to use as backgrounds for the buttons on my Spry Menu Bar. The first ones were for the menu bar itself, with the headings which you hover the mouse over to view the dropdown menus. This is the default code for the menu bar: ul.MenuBarHorizontal a { display: block; cursor: pointer; background-color: #00F; padding: 0.5em 0.75em; color: #FFF; text-decoration: none; } This is what I changed the code to so that it would show the background image: ul.MenuBarHorizontal a { display: block; cursor: pointer; background-image: url(menubaritems.fw.png); padding: 0.5em 0.75em; color: #FFF; text-decoration: none; } When I preview the page in my internet browser, it has taken the background colours off the buttons and there is nothing there (you can see straight through to the page background). I have checked and all the files are in the correct place, and all the links are set up correctly (the image is in the same folder as the CSS file). I also know that I am editing the correct part of the CSS code because I tried just changing the background colour from '#00F' to '#000', and it changed the background colours perfectly when I did that. So it's only when I try to create the link to the image file that it doesn't work properly (removes the background altogether). What am I doing wrong? Thank you for any help.
-
How do I align the text to the bottom of my 'footer' div?
Thank you for your help, that worked.
-
How do I align the text to the bottom of my 'footer' div?
Thank you for your help, although it seems to have moved the links nearer to the top of the div rather than to the bottom. Is there something I've done wrong? This is my new CSS code: #footer { position: absolute; width: 100%; height: 30px; text-align: right; bottom: 0; background-image: url(images/footerbackground.fw.png); } #footer p { position: absolute; width: 100%; height: 30px; text-align: right; bottom: 0; height: 30px; } This is my new HTML code: <div id="footer"><p><a href="contactus.html">Contact Us</a> | <a href="copyright.html">Copyright</a> | <a href="feedback.html">Feedback</a> | <a href="brokenlink.html">Report a broken link</a></p></div> Is there something I've done wrong? Thank you for any help.
-
How do I align the text to the bottom of my 'footer' div?
I have a footer div on my website, which is set to always appear at the bottom of the page. The problem is, the text in the div is aligning to the top of the div. This is the CSS code for the div: #footer { position: absolute; width: 100%; height: 30px; text-align: right; bottom: 0; background-image: url(images/footerbackground.fw.png); } This is the HTML code for the div: <div id="footer"><a href="contactus.html">Contact Us</a> | <a href="copyright.html">Copyright</a> | <a href="feedback.html">Feedback</a> | <a href="brokenlink.html">Report a broken link</a></div> How can I alter the CSS and/or HTML to make the text align to the bottom of the footer div? Thank you for any help.