Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

HTML Newbie question

Posted on 2013-01-25
3
Medium Priority
?
216 Views
Last Modified: 2013-01-25
Hi,

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>
 <html>
 <body>
 
<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;">
 <b>Menu</b><br>
 HTML<br>
 CSS<br>
 JavaScript</div>
 
<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>
 
</div>
 
</body>
 </html> 

Open in new window

0
Comment
Question by:Andy Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
Element1910 earned 2000 total points
ID: 38819664
Footer:
<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

0
 

Author Closing Comment

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

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>
<html>
<head>
<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;}
</style>
</head>
<body>
 
<div id="container">
 
<div id="header"><h1 style="margin-bottom:0;">Main Title of Web Page</h1></div>
 
<div id="menu">
<b>Menu</b><br>
HTML<br>
CSS<br>
JavaScript</div>
 
<div id="content">Content goes here</div>
 
<div id="footer">Footer to be at the bottom of the screen</div>
                                            
</div>
 
</body>
 </html> 

Open in new window

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

715 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