PDA

View Full Version : Quick Help



iNicks
23-02-2006, 06:46 PM
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.

Splinter
23-02-2006, 06:51 PM
Css:

html {
margin: 0, 0, 0, 0;
}

HTML:

topmargin="0" bottommargin="0" marginheight="0" marginwidth="0"

Dan Williamson
23-02-2006, 06:53 PM
Hey,

You mean this:



body{
margin-top: 0px;


- Dan

Splinter
23-02-2006, 06:59 PM
Lol thats what i was meaning in my post but my css is abit rusty in parts :'(

Dan Williamson
23-02-2006, 07:01 PM
Hey,

I didn't even see your post until I had posted rofl. And I couldn't be bothered editing.

- Dan

iNicks
23-02-2006, 07:03 PM
Ok, Dan, your code, whats the whole code, and do I put it in the head or body?

Dan Williamson
23-02-2006, 07:05 PM
Hey,

Put it into your main.css at the top and then inside your head tags put:


<link rel="stylesheet" href="main.css" type="text/css" />

- Dan

iNicks
23-02-2006, 07:13 PM
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

Dan Williamson
23-02-2006, 07:18 PM
Hey,

Start > All Programs > Accsessories > Notepad

Type in code

File > Save As > Type in main.css

Then... Upload to yourserver ;)

- Dan

iNicks
23-02-2006, 07:28 PM
so i put this in main.css


body{
margin-top: 0px;

Splinter
23-02-2006, 07:29 PM
no put


body {
margin-top: 0px;
}

:)

Dan Williamson
23-02-2006, 07:31 PM
Hey,

Yeah do as Charlie said. I forgot that tag... *looks at usertitle*...

- Dan

iNicks
23-02-2006, 07:32 PM
and then oput that other code you gave me in my index ...?

Splinter
23-02-2006, 07:32 PM
yes the <link> one :)

iNicks
23-02-2006, 09:13 PM
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/

Raremandan
23-02-2006, 09:21 PM
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.



<!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">&nbsp;</td>
<td width="23%">&nbsp;</td>
<td width="1%">&nbsp;</td>
<td width="46%">&nbsp;</td>
<td width="28%">&nbsp;</td>
</tr>
<!-- TemplateEndRepeat -->
<tr>
<td height="429">&nbsp;</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>&nbsp;</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>&nbsp;</td>
</tr>
<tr>
<td height="19">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="120">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>

iNicks
23-02-2006, 09:24 PM
guru and what do i put in main.css ...?

Raremandan
23-02-2006, 09:27 PM
You put only the CSS with no HTML so your main.css would look like this exactly:


body {
margin-top: 0px;
}

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.

iNicks
23-02-2006, 09:33 PM
see look at my site now..... i did that ... it still doesnt work

Raremandan
23-02-2006, 09:37 PM
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:


<link rel="stylesheet" href="main.css" type="text/css" />

iNicks
23-02-2006, 09:44 PM
i did put that .. the same placve you put it in your code

Raremandan
23-02-2006, 09:56 PM
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:


<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" />

iNicks
23-02-2006, 10:03 PM
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

Raremandan
23-02-2006, 10:08 PM
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.



<style type="text/css">

body{
margin-top: 0px;
}

</style>


Edit: I have marked out how your header tag should look and also how main.css should look.


<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>

And then your main.css.


body{
margin-top: 0px;
}

iNicks
23-02-2006, 10:37 PM
yea ... mmm is not working, i wonder why

Raremandan
23-02-2006, 10:51 PM
Ok.. Read this very carefully. Do NOT change any part of this code it is all correct linking to your external stylesheet.


<link rel="stylesheet" href="main.css" type="text/css" />

In your code it appears you have changed rel="stylesheet" to rel="main.css" which is not right.

nets
23-02-2006, 11:07 PM
It's not difficult, and doesn't really need more than one post.
Put this just before your </head> tag:


<style type="text/css">
<!--
body {
margin-top: 0;
}
-->
</style>

Raremandan
23-02-2006, 11:10 PM
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.

iNicks
23-02-2006, 11:30 PM
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

Want to hide these adverts? Register an account for free!