Reputation: 1488
I was given a test and the guy just said:
Improve the html
<div class="header"></div>
<div class="main"></div>
<div class="footer"></div>
All I can think of is to use the HTML5 <header>
, <section>
and <footer>
tags, but I got no response and no feedback regarding how he would like it to be improved.
Beyond the tags is there anything else that could be done to improve the HTML?
Upvotes: 1
Views: 131
Reputation: 3800
With HTML4, developers used their own id/class names to style elements: header, top, bottom, footer, menu, navigation, main, container, content, article, sidebar, topnav, etc.
This made it impossible for search engines to identify the correct web page content.
With the new HTML5 elements <header> <footer> <nav> <section> <article>
, this will become easier.
Upvotes: 0
Reputation: 517
The answer is probably supposed to be using the new HTML5 tags:
<header></header>
<main></main>
<footer></footer>
...but it depends on browser support.
Upvotes: 7
Reputation: 628
You can't really "improve" this, but you can style it better:
<!DOCTYPE html>
<html>
<head>
<!--
Link styles and such, possibly JavaScript and CSS files
-->
<script src = "main.js"></script>
<link href = "stylesheet.css" type = "text/css" rel = "stylesheet">
<title>Untitled</title>
</head>
<body>
<div class="header">
</div>
<div class="main">
</div>
<div class="footer">
</div>
</body>
</html>
This makes the HTML more valid and complete, and ready for development. Also, it lets you visualize every element. I can't think of anything else to improve it, unless your interviewer means to add styles to design a full website.
Upvotes: -1