<title>My first web page</title>
<link rel="stylesheet" type="text/css" href="web.css" />
</head>
<body>
<h1>My first web page<h1>
<h2>What this is</h2>
<p>A <em>simple</em> page put together using <strong>HTML</strong></p>
<h2>Why this is</h2>
<ul>
<li>To learn HTML</li>
<li>To learn HTML</li>
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
<li>To learn HTML</li>
</ul>
body {
font-family: arial, helvetica, sans-serif;
font-size: 80%;
color: black;
background-color: #ffc;
margin: 1em;
padding: 0;
}
h1 {
color: #ffc;
background-color: #900;
font-size: 2em;
margin: 0;
margin-bottom: 0.5em;
padding: 0.25em;
font-style: italic;
text-align: center;
letter-spacing: 0.5em;
border-bottom-style: solid;
border-bottom-width: 0.5em;
border-bottom-color: #c00;
}
h2 {
color: white;
background-color: #090;
font-size: 150%;
margin: 0;
padding: 0.1em;
padding-left: 1em;
}
<h1>My first web page<h1>
should be <h1>My first web page</h1>
You are effectively creating two h1 tags
Give the W3C HTML Validator a whirl. It'll help you find problems with your code.Ok, I've been working my way through the HTML Dog tutorials and I've come across my first problem.
It might just be that I haven't learn about something yet, but if it's an easy fix just let me know.
Basically, I can't work out why I have an extra red box/border below my h1 tag. For some reason, the white space between my h1 and h2 tags is using the h1 css style. Any ideas?
<h1>My first web page<h1>
should be <h1>My first web page</h1>
You are effectively creating two h1 tags
No probs. There's also a CSS validator but I find that the HTML validator helps me get correct XHTML whereas the CSS I think is always more 'creative' and follows less structured rules than HTML.@MarcLister Thanks for the validator link; I'm sure it will come in handy.![]()
I think that unless you've made that kind of mistake, you're lying. It's a beginner mistake and one that most coders, whether amateur, expert or somewhere in between have made at some point. I know I have, especially with some of the bigger pages with over 100 lines of code. It's just something to learn from and understand.No need to feel stupid very easy mistake to make & I would imagine that most people have done a similar thing.
Wordpress is amazing.
Google also loves wordpress making it great for SEO.
It is pretty well known that w3schools is a big pile of arse, contains lots of mistakes and isn't worth the webspace.