Forums

Small CSS problem (6 posts)

  1. manwidatan
    Member
    Posted 2 years ago #

    I have a small CSS problem. I am attempting to make the navigation in the centre rather than being to the left.

    (web page) http://www.r2msolutions.co.uk

    I have tried every thing I can think of with the CSS sheet. But to no success the code is

    .nav {
    margin:0 auto;
    list-style:none;
    font-family:Tahoma, Arial, Helvetica, sans-serif;
    text-align:left;
    }

    .nav li {
    display: inline;
    }

    .nav li a {
    margin-top:182px;
    padding:0 1em 0 1em;
    text-decoration:none;
    text-transform:uppercase;
    float:centre;
    color:#FF0000;
    font-weight:bold;
    font-size:14px;
    }

    If any one can help I have been set here for hours and am going a bit mad

    Thank you in advance

  2. manwidatan
    Member
    Posted 2 years ago #

    Still have big trouble with this can any one help me please

  3. wpum
    Member
    Posted 2 years ago #

    You have to specify a width to ".nav", and a width not in percentage. For example :

    .nav {
    width:820px; /* <-- here */
    margin:0 auto;
    list-style:none;
    font-family:Tahoma, Arial, Helvetica, sans-serif;
    text-align:left;
    }

    But is it a wordpress issue ?... ;-)

  4. manwidatan
    Member
    Posted 2 years ago #

    Brilliant , thank you. I was messing with "text align" and getting know where fast. I am loving this it is good to be learning stuff. I have one other question regarding CSS if you dont mind. I am trying to get a float effect on the navigation bar. I have found some code and have been trying to insert it but am not sure where. Well to be truthfull I have tried lots of code in diferent places but I am not getting very far.

    Would I just add

    .nav li a {:hover{
    hover color:#FFFFFF;
    text-decoration:none;
    border-bottom:none;

    under the .nav code or add it to the ".nav li a" part or at the footer of the CSS sheet

    Not very sure. I have been sat here the last few hours messing with the code. learnt a bit more about CSS in the process but not had any luck on solving my problem and am now going round in circles

  5. alchymyth
    The Sweeper
    Posted 2 years ago #

    you need to take more care with spaces and brackets

    .nav li a:hover {
    color:#FFFFFF;
    text-decoration:none;
    border-bottom:none; }

    you could put it anywhere in the style.css

  6. manwidatan
    Member
    Posted 2 years ago #

    thanks for that,worked a treat. I will keep an eye on my spacing cheers

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.