PDA

View Full Version : Trying to code my portfolio...



Repair
03-08-2012, 10:53 PM
Hey guys, I'm trying to code my portfolio at the moment, and Ive never coded anything yet - youve got to start somewhere!

Anyway, its probably the dumbest question ever but I need to ask it, my navigation just wont move. Ive tried margin-top, margin-right, padding-top and padding-right... Nothing seems to work!

My html :

</div> <div id=" nav">
<ul id="navlist">
<li id="active">Home </li>
<li>About</li>
<li>Portfolio</li>
<li>Contact</li>
</ul>
</div>

My CSS:

#nav { float: right ;
margin-right: 100px;
margin-top: 50px;
}
#navlist li {
display: inline;
list-style-type: none;
padding-right: 60px;
font-family: vijaya;
font-size: 30px;
color: #696262;
}


Any help as to why this wont work would be appreciated

Sam.

Kieran
03-08-2012, 10:56 PM
Add in a #navlist {float:right;} and add your margins to that.

Do you have it uploaded anywhere so I can have a look and check to make sure I'm pointing you in the right direction. Only so much I can say with what you've given.

Repair
03-08-2012, 11:04 PM
Sorry dont have anywhere to upload it at the moment, and that seemed to do the trick. Thanks!

No doubt ill be back in about 10 minutes with another problem though :d

Kieran
03-08-2012, 11:05 PM
You don't really need the <div> around that <ul>.

And if you wanted to be mega cool... you could use the old <nav></nav> HTML5 :P

Repair
03-08-2012, 11:06 PM
Just removed the div around it, and whats the old <nav></nav> ? :D

Kieran
03-08-2012, 11:12 PM
Basically you can use it to denote where the navigation is and then in the css treat it like it was something such as a header tag.

So for example, you might have this in your code

<h1>Title<h1>

And the css would be just

h1{code here};

Well you can do the same for <nav>Your list here</nav>

CSS:

nav{code here};

Repair
03-08-2012, 11:15 PM
Alright, if I have time ill try give that a go.

Ill stick to what I have at the moment because I know it works :P


EDIT: Just did the <nav> thing and its actually not that hard and it worked easier

Thank you !

redtom
05-08-2012, 12:41 PM
I would use <nav> just yet IE is here to crash the party!

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