HTML Newbie question

Posted on 2013-01-25
Last Modified: 2013-01-25

I am about to update a very old, very basic HTML website, which gives me the perfect opportunity to learn HTML5.  I have been on to the W3C website and ended up with a very basic template that is almost perfect.  However, I need to have the Footer fixed to the bottom of the screen/page and 0 border on the top.

I'd really appreciate it if someone could take a look at the code, and let me know (the right way) to do it.

Thank you.

<!DOCTYPE html>
<div id="container" style="width:500px">
<div id="header" style="background-color:#FFA500;">
 <h1 style="margin-bottom:0;">Main Title of Web Page</h1></div>
<div id="menu" style="background-color:#FFD700;height:200px;width:100px;float:left;">
<div id="content" style="background-color:#EEEEEE;height:200px;width:400px;float:left;">
 Content goes here</div>
<div id="footer" style="background-color:#FFA500;clear:both;text-align:center;">
 Footer to be at the bottom of the screen</div>

Open in new window

Question by:Andy Brown

Accepted Solution

Element1910 earned 500 total points
ID: 38819664
<div id="footer" style="background-color:#FFA500;clear:both;text-align:center; width: 100%; margin: 0%; position: fixed; bottom: 0%; border-top-width: 0px;">
 Footer to be at the bottom of the screen</div>

Open in new window


Author Closing Comment

by:Andy Brown
ID: 38819758
Thank you so much - that's a big help (which is a little worrying :)
LVL 83

Expert Comment

by:Dave Baldwin
ID: 38819769
The next thing is to move the styles from 'inline' to a 'style section in the <head> which you also don't have.  An empty or non-existent head section will fail validation.
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML5 page</title>
<style type="text/css">
#container {width:500px}
#header {background-color:#FFA500;}
#menu {background-color:#FFD700;height:200px;width:100px;float:left;}
#content {background-color:#EEEEEE;height:200px;width:400px;float:left;}
#footer {background-color:#FFA500;clear:both;text-align:center; width: 100%; margin: 0%; position: fixed; bottom: 0%; border-top-width: 0px;}
<div id="container">
<div id="header"><h1 style="margin-bottom:0;">Main Title of Web Page</h1></div>
<div id="menu">
<div id="content">Content goes here</div>
<div id="footer">Footer to be at the bottom of the screen</div>

Open in new window


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery Animation faster 5 43
Form not operating correctly. 1 23
Form with Modals 16 46
change button location when you go on your cellular device 21 24
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now