I'm 10 lines in to my second attempt at HTML and CSS and it is immediately doing completely barmy things.
I have the following code (this the entire page):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Some page title</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.1.1/build/cssreset/reset-min.css" />
<link rel="stylesheet" type="text/css" href="47926.css" />
<link rel="stylesheet" type="text/css" href="960Clear.css" />
</head>
<body>
<div id="rootDiv">
<div class="container_16" id="topBarDiv">
<div id="topBarLogoDiv">
<a id="topBarLogoLink" href="~/Home/ComingSoon" title="Coming soon page"/>
</div>
</div>
</div>
</body>
</html>
And here's the CSS (960Clear.css, the others are 960 grids and YUI reset):
#rootDiv {
height: 70px;
background-color: #F7F7F7;
}
#topBarLogoDiv {
background-image: url('file:///C:/Users/Public/Documents/~Main/Vuplan/S26.Vuplan.Web.Application/Images/logo-vuplan-color-on-alpha-172x49.png');
background-color: #F7F7F7;
background-repeat: no-repeat;
margin-left: 20px;
height: 50px;
width: 172px;
display: block;
overflow: hidden;
}
#topBarLogoLink {
height: 50px;
width: 172px;
min-height: 50px;
min-width: 172px;
display: table-cell;
}
This simple, simple page doesn't work. Internet Explorer was my initial problem, rendering up to four logos in the top corner, but let's ignore Internet Explorer for now because even Firefox is doing the nuttiest thing.
I render another, whole anchor element outside of the wrapper div and this oddness is even visible as another line of code in the F12 diag tools window!
I took a screen shot to demonstrate:
For me, HTML+CSS work is a punishment served in Hell, but this takes the biscuit. What on Earth is going on here?
Note
My fault - I should've added this disclaimer before.
The code above seems to have tickled some people. Please remember that it's in an experimental state as I try to work out why I am getting multiple logos and general oddness.
I haven't got as far as correcting local links (which will be completely different in production and generated via ASP.NET MVC methods anyway).
Imagine that someone is having problems plumbing a house and you go to investigate. The house may not be finished yet; please ignore the missing carpet ;-)
You can't close an A tag with />
you need to close it with <a href="#">Link</a>
The double rendering is Firefox/Firebug parsing invalid HTML.