Hi I need help, just to make my template go to the top of the browser, liek the 0 margin thing .... I need the code for this.
Printable View
Hi I need help, just to make my template go to the top of the browser, liek the 0 margin thing .... I need the code for this.
Css:
HTML:Code:html {
margin: 0, 0, 0, 0;
}
HTML Code:topmargin="0" bottommargin="0" marginheight="0" marginwidth="0"
Hey,
You mean this:
- DanHTML Code:body{
margin-top: 0px;
Lol thats what i was meaning in my post but my css is abit rusty in parts :'(
Hey,
I didn't even see your post until I had posted rofl. And I couldn't be bothered editing.
- Dan
Ok, Dan, your code, whats the whole code, and do I put it in the head or body?
Hey,
Put it into your main.css at the top and then inside your head tags put:
- DanHTML Code:<link rel="stylesheet" href="main.css" type="text/css" />
ok i dont got a main .css i got main.php and nav.php and my index.htm ... i had the code before ... lost it though
Hey,
Start > All Programs > Accsessories > Notepad
Type in code
File > Save As > Type in main.css
Then... Upload to yourserver ;)
- Dan
so i put this in main.css
Quote:
body{
margin-top: 0px;
no put
:)Code:body {
margin-top: 0px;
}
Hey,
Yeah do as Charlie said. I forgot that tag... *looks at usertitle*...
- Dan
and then oput that other code you gave me in my index ...?
yes the <link> one :)
Ok, its not working, jsut go to my site and check out the coding....
oh and rate the site so far people :P lol
http://www.nick.habbo-gossip.com/
You have not added the external stylesheet link. You need this to connect main.css to your webpage. Here is the full source code with the external stylesheet in.
HTML Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="main.css" type="text/css" />
<title>Habbonicle! For your Habbo Needs!</title>
</head>
<div align="center">
<body background="http://www.nick.habbo-gossip.com/background_blue.PNG">
<br />
<br />
<table width="940" height="670" border="0" cellspacing="0" background="http://www.nick.habbo-gossip.com/template.gif" cellpadding="0">
<!-- TemplateBeginRepeat name="RepeatRegion1" -->
<tr>
<td width="2%" height="97"> </td>
<td width="23%"> </td>
<td width="1%"> </td>
<td width="46%"> </td>
<td width="28%"> </td>
</tr>
<!-- TemplateEndRepeat -->
<tr>
<td height="429"> </td>
<td align="center" valign="middle"><iframe name=nav src=nav.htm width=175 height=370 frameborder=0 scrolling=auto allowtransparency="true" background-color="transparent" > </iframe>
</td>
<td> </td>
<td align="center" valign="top"><iframe name=main src=main.htm width=420 height=430 frameborder=0 scrolling=auto allowtransparency="true" background-color="transparent" > </iframe>
</td>
<td> </td>
</tr>
<tr>
<td height="19"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="120"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
guru and what do i put in main.css ...?
You put only the CSS with no HTML so your main.css would look like this exactly:
You do not need to add anything else into the CSS file unless it's more CSS for styling and other purposes. I would reccommend looking into learning CSS as you can do many things with it. Try CSS Zen it's really good once you get into it.HTML Code:body {
margin-top: 0px;
}
see look at my site now..... i did that ... it still doesnt work
You still haven't linked the external stylesheet and are trying to use CSS before even your Doctype which will not work. Copy and paste the code I gave you or just inside your <head> section put this code:
HTML Code:<link rel="stylesheet" href="main.css" type="text/css" />
i did put that .. the same placve you put it in your code
Well it's because you have entered the URL completely wrong. The code you was given was 100% correct. You do not need to put in http://www.etc. You just need to use it like a simple A href link:
HTML Code:<link rel="stylesheet" href="http://www.nick.habbo-gossip.com/main.css" type="text/css" />
Should be
<link rel="stylesheet" href="main.css" type="text/css" />
the reason i put in what i did is because it didnt work with the code you gave me
there i put the one you gave me, go check ,,, it doesnt work
Well then there is only one more question I can really think of. Is main.css and index file both in the same directory. Such as public_html otherwise I can't think of anything else and if it comes to the crunch you could use this code.
Edit: I have marked out how your header tag should look and also how main.css should look.HTML Code:<style type="text/css">
body{
margin-top: 0px;
}
</style>
And then your main.css.HTML Code:<head>
<title>Your Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="main.css" type="text/css" href="main.css" />
</head>
HTML Code:body{
margin-top: 0px;
}
yea ... mmm is not working, i wonder why
Ok.. Read this very carefully. Do NOT change any part of this code it is all correct linking to your external stylesheet.
In your code it appears you have changed rel="stylesheet" to rel="main.css" which is not right.HTML Code:<link rel="stylesheet" href="main.css" type="text/css" />
It's not difficult, and doesn't really need more than one post.
Put this just before your </head> tag:
Code:<style type="text/css">
<!--
body {
margin-top: 0;
}
-->
</style>
I have told him to do this once but so far he is being ignorant with his reading skills and simply does not understand the basics of CSS.
Ok Guru, shut up, ok I was pasting your god damn code, it didnt help ok?
And Nets, I tryed your code, it just wont work on my layout, iunno why, it worked on my old layout :I