How can i do this?

Hello guys, em just wondring how can i put an image on a HTML page at the very top like one’s you find here http://www.hchamp.com/archives/000227.html

Use CSS and use the top-margin property would be my guess.

body {margin:0px 0px 10px 0px;}

<body topmargin=0>

moved this to client-side forum, which is for html stuff…

ok so what exactly do you want? how to position the image like that on a html page?
have you tried? what was the problem?

@ soulty

yup i want to position an image right at the very top of a page. sorry if i post this thread in a wrong category.

@ danii & yeldard

thanks for the reply i’ll what you guys suggested my to do.

@ danii & yeldarb

it worked guys. thanks for the reply. =)

That is ugliest piece of so little html I’ve ever seen. (And it’s not even wrong! Must be some potent stuff the W3C smoked back then…)

Anyway, try to use quotes next time. And no topmargin, please! That’s presentational, so that should go into the css:


<html>
<head>
<title>An image!</title>
<style type="text/css">
body,html { /* the html is there for the browsers that refused the body. Don't know wich browsers, though*/
margin:0;
padding:0;
}
</style>
</head>

<body>
<img src="" alt="A pwetty flowur"></img>
</body>
</html>

@ [m]

is that the professional approach of doing it? thanks man… Since you’re experienced in using CSS, maybe you can explain to me how can i put a fixed background in a website, like the one’s you can see from here http://www.billybussey.com/main.html

look at all that code you use with CSS when body topmargin=0 works just fine. damm standards are polluting your mind. From a programers perspective, remember not to complicate things just for the sake of complicating things… :smiley:

For a fixed bg using css, heres the coding:


 
body 
{
background-image: 
url('blahblahblah.jpg);
background-repeat: 
no-repeat;
background-attachment: 
fixed
}
 

Dont forget to include the single quotes.

You dont need all that css just for position. Sniper, if you just wanted to position using css, than use the css but seriously, if you just wanted it as html, use the topmargin. Ugly or beautiful, its just text, if it works, use it - that is, in the right context.