Forum Moderators: not2easy
I'm trying to align my logo to the left of my header, using the float tag.Instead, the logo floated to the right of the header Why is that?
here is the code for CSS and HTML
CSS
body{background-color:ffffff;
}
.foo { font-family: Roman;
font-size:24px;
color: #66ccff;
font-style: italic;
float:left;
}
.img{url:bar.gif
width:63
height:40;
}
A:link(color:blue;
}
A:visited(color:blue;
}
.attamain{width:250px;
padding:10px;
border:5px solid grey;
margin:10px;
background-color:000000;
}
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Your Title Here </title>
<link rel="stylesheet" type="text/css" href="atk.css">
<meta name="Description" content="Your description here...">
<meta name="Keywords" content="Your keywords here...">
</head>
<body>
<h1 class="foo">bar <h1/>
<img src="foobar.gif" width="63" height="40"border="0" alt="foobar"class="img" />
<div class="attamain">
</div>
</body>
</html>
[edited by: swa66 at 12:15 pm (utc) on Nov. 4, 2009]
[edit reason] examplified [/edit]
.img{url:bar.gif
width:63
height:40;
}
Similarly: validate your html.
(get a full doctype to start with)
<h1 class="foo">bar<h1/> isn't making sense the browser will try to make sense out of the tag soup, I'm not into guessing what the browsers out there might conclude it means, too many of them and too weird ones out there.
font-family: Roman;A font family is a list of fonts, with at the end a generic font.
font-family: Roman, sans-serif;
After you fix that, take a good look where you apply the float to.