Jump to content

HTML help

Go to solution Solved by TAtari,

You missed the close table tag.

Add a </table> after your </tbody>

Hi,

 

I'm trying to make a website to practice all the stuff i've learnt so far from CodeAcademy.

 

However, i've ran into a problem

 

I've made a table ect, but for some reason, everything I write goes above the table. This happens even though all the code I want below the table is written below the table.

 

Also, only half my writing is going into the Arial font. 

 

Here is the HTML code:

<!DOCTYPE html><html><head>	<title> Test website </title>	<link type="text/css" rel="stylesheet" href="stylesheet.css"/></head><body>	<!-- Welcomes the user to the website -->	<h1><center> Welcome to my website! </center></h1>	<!-- Tell's the user where I learnt everything -->	<center><p>This website was setup to test everything I have learnt at <a href="http://www.codeacademy.com">CodeAcademy</a></center>	<!-- Creates a table of pictures -->	<center><p>Here is a table of dogs</p></center>	<table border="4px">		<thead>			<tr>				<th colspan="3">Table of pictures</th>			</tr>			<tr>				<th colspan="3"> Pictures of dogs (Tip, click an image to view it full size)</th>			</tr>		</thead>		<tbody>			<tr>			<td>				<a href="http://www.istockphoto.com/photo/business-boss-dog-47695730?st=035f3bb">				<img src="http://i.istockimg.com/file_thumbview_approve/47695730/6/stock-photo-47695730-business-boss-dog.jpg" />			</td>			<td>				<a href="http://www.istockphoto.com/photo/ciber-dog-35749708?st=035f3bb">				<img src="http://i.istockimg.com/file_thumbview_approve/35749708/6/stock-photo-35749708-ciber-dog.jpg" />			</td>			<td>				<img src-"http://i.istockimg.com/file_thumbview_approve/34447018/6/stock-photo-34447018-boxer-dog.jpg" />			</td>		</tbody>		<!-- List of favourite games in order -->		<center><p>Here is an ordered list of my favourite 5 games</p></center>			<ol>				<li>Metro: 2033</li>				<li>Mafia 2</li>				<li>Tomb Raider 2013</li>				<li>Farcry 3</li>				<li>Bioshock Infinate</li>			</ol>		<!-- List of favourite foods NOT in order -->		<center><p>Here is a non-ordered list of my favourite foods</p></center>			<ul>				<li>Chicken pie</li>				<li>Cereal</li>				<li>Cottage Pie</li>				<li>Beef Burger</li>			</ul></body></html>

Here is the CSS code:

h1 {	font-family: Arial;	text-decoration: underline;}p {	font-family: Arial;	font-size: 16;}

Thanks to anyone that can help :)

 

- Meme

Link to comment
https://linustechtips.com/topic/372973-html-help/
Share on other sites

Link to post
Share on other sites

You also need to close your <a> tags inside the table cells.

Also, you're using standards mode (HTML5), but you're also using the <center> tag, which is deprecated. You should use CSS instead. It's not a big issue, but it's much better to stop bad code before it becomes a habit to use them - support for the tag is supposedly in the process of being dropped from browsers at the moment1.

HTTP/2 203

Link to comment
https://linustechtips.com/topic/372973-html-help/#findComment-5046951
Share on other sites

Link to post
Share on other sites

You also need to close your <a> tags inside the table cells.

Also, you're using standards mode (HTML5), but you're also using the <center> tag, which is deprecated. You should use CSS instead. It's not a big issue, but it's much better to stop bad code before it becomes a habit to use them - support for the tag is supposedly in the process of being dropped from browsers at the moment1.

 

Thanks for the heads up :)

 

Codeacademy hasn't covered centering tags in CSS, but when it does ill update everything :)

Link to comment
https://linustechtips.com/topic/372973-html-help/#findComment-5046972
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×