Jump to content
Sign in to follow this  
Torjus

Hjelp til CSS

Recommended Posts

Jeg har et mini problem med hjemmesiden min...

Jeg har akkurat prøvd meg på litt CSS, so far so good.

 

Men når jeg bruke <p></p> så går det 2 hakk ned... hvordan får jeg det bare til å gå 1 hakk? :blush:

Share this post


Link to post
Du må justere margin på p elementet

Eks:

p{
margin: 5px 0 5px 0; /*margin: top right bottom left*/
}

Hvor/hvordan legger jeg dette inn i koden?

 

<div id="main">

 <div id="maincontent">
 
   <div id="left">
  <h2>: Me, myself and my</h2>
  <p>I am 15 years old and live in Norway. My hobbies are aquarium, computer, moped and ping-pong.</p>
     <p></p>
  
  <h2>: Aquarium</h2>
  <p>I started with aquarium when i was 12 years old and have been doing it since then, when I first started I got immediatly interseted. I had 1 aquaruim with 18 fishes, now i`ve got 5 aquariums and I am still very interested</p>
         
         <h2>: Computer</h2>
         <p>Since 1995 i have been using a computer, 2001 mom got a computer, It was then I really begun to get interested in computer, I started play the game "Counter-strike" and went to many LAN's. May 2004 i got my own computer.
         <p><b>Computer specs:</b></p>
         <p>AMD Athlon 64 3000+</p>
         
         <h2>: Moped</h2>
         <p>Next year one or two months before i get 16 years i will buy a moped. The moped i want is a Motorhispania RYZ Enduro 50c</p>
         
         <h2>: Ping-pong</h2>
         <p>I started in the ping-pong club august 04 and I am stil a active member, we practice twice a week and its very fun!</p>
</div>

<div id="right">
  <h2>: News</h2>
  <h3>New homepage</h3>
  <p>From frontpage to Dreamwaver and pro photoshop!</p>
  <h3>New domain</h3>
  <p>New domain from www.fuzzy2.tk to www.fuzzy.moo.no and www.2rjus.tk</p>   
</div>
 
 </div>

</div>

<div id="footer"></div>

Share this post


Link to post
Hvor/hvordan legger jeg dette inn i koden?

I CSS-dokumentet. Sikkert stylesheet.css eller noe slikt.

 

EDIT: Slem ilder! Jeg sa rull, ikke hopp!

Edited by PT

Share this post


Link to post

Slik ser det ut hos meg:

 

h2 {
 font-family: arial, sans-serif;
 font-size: .9em;
 letter-spacing: -1px;
 margin: 0 0 10px 0;
}

 

Ikke at jeg skjønner så mye av dette... Hvordan gjør jeg det om til 1 linje og ikke 2?

Share this post


Link to post
Hvis du endrer margin: 00.. til margin: 0; (ingen marg) fjerner du den opprinnelige margen på 10 piksler under h2.

Altså slik?

 

h2 {
 font-family: arial, sans-serif;
 font-size: .9em;
 letter-spacing: -1px;
 margin: 0 10px 0;
}

Edited by FuZzY^

Share this post


Link to post

h2 {
font-family: arial, sans-serif;
font-size: .9em;
letter-spacing: -1px;
margin: 0;
}

 

Faen ta den stygge ilderen!

 

 

Neida kjære, du vet jeg elsker deg :love:

Edited by PT

Share this post


Link to post

Det virket ikke...

Som dere ser på "Computer-specs" her:

http://home.no.net/fuzzy2/profile.html

 

Jeg vil bare ha 1 linje ned, ikke 2... :hmm:

 

<div id="main">

 <div id="maincontent">
 
   <div id="left">
  <h2>: Me, myself and my</h2>
  <p>I am 15 years old and live in Norway. My hobbies are aquarium, computer, moped and ping-pong.</p>
     <p></p>
  
  <h2>: Aquarium</h2>
  <p>I started with aquarium when i was 12 years old and have been doing it since then, when I first started I got immediatly interseted. I had 1 aquaruim with 18 fishes, now i`ve got 5 aquariums and I am still very interested</p>
         
         <h2>: Computer</h2>
         <p>Since 1995 i have been using a computer, 2001 mom got a computer, It was then I really begun to get interested in computer, I started play the game "Counter-strike" and went to many LAN's. May 2004 i got my own computer.
         <p><b>Computer specs:</b></p>
         <p>AMD Athlon 64 3000+</p>
         <p>AMD Athlon 64 3000+</p>
         <p>AMD Athlon 64 3000+</p>
         <p>AMD Athlon 64 3000+</p>
         
         <h2>: Moped</h2>
         <p>Next year one or two months before i get 16 years i will buy a moped. The moped i want is a Motorhispania RYZ Enduro 50c</p>
         
         <h2>: Ping-pong</h2>
         <p>I started in the ping-pong club august 04 and I am stil a active member, we practice twice a week and its very fun!</p>
</div>

<div id="right">
  <h2>: News</h2>
  <h3>New homepage</h3>
  <p>From frontpage to Dreamwaver and pro photoshop!</p>
  <h3>New domain</h3>
  <p>New domain from www.fuzzy2.tk to www.fuzzy.moo.no and www.2rjus.tk</p>   
</div>
 
 </div>

</div>

<div id="footer"></div>

</body>
</html>

Edited by FuZzY^

Share this post


Link to post
h2 {
font-family: arial, sans-serif;
font-size: .9em;
letter-spacing: -1px;
margin: 0;
}

 

EDIT: :D

Jeg husker ikke hvilken, men det er en nettleser som har problemer med verdier som starter med et punktum, og ikke tall. Derfor er det foretrukket å skrive "0.7" i stedet for ".7".

 

Når det gjelder margin-bottom (eller den 3. verdien i samle-egenskapen), så er det en god vane å angi den i em. Em beregner verdien på grunnlag av font-size, og skrifta vil derfor være mer leselig dersom brukeren forstørrer den.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...