SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Changing from JS to CSS for site navigation

    Gudday all
    Late last month my wife's hosting company experienced many problems that caused her site (and heaps of others) off the air. Eventually they folded. We found a new hosting company and got the site back on air.
    However now the JS navigation does not work. The code is the same and I have tried to get the settings between the 2 hosts the same e.g both Linux servers etc: but to no avail.
    I knew that it was time to change from a JS menu to a CSS menu.
    My attempts thus far have been quite ordinary e.g. it does not work

    The attachment is a picture of what I would like it to look like.
    My attempt looks like http://www.petalsandpatches.com/testCSSnavigation.htm
    The current live page is http://www.petalsandpatches.com. I have been forced to go back to links at present
    I am after a two column look with the navigation buttons in the LH column and the body in the right. The body on the current live page is different to that on the testCSSnavigation.htm page as the test page is my default page.
    Some points on the testCSSnavigation.htm page
    1. The black box is an outer container called 'outer'
    2. The left column, called 'l-col', is in green
    3. The right column, called 'cont', is in blue
    4. I have put edges onto two of the buttons to highlight their position
    5. Blog does not have a button yet

    Ideally I would like the buttons to be in the left column and centred. At present they have a mind of their own and seem to be atop both columns. I am sure that the solution is frightfully simple but I can not see it. I would like this fixed as the missus is on my back about it.

    All donations gratefully recieved.
    Attached Images Attached Images
    ========================
    Carn the Tiges!
    www.petalsandpatches.com

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,343
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    To move the nav over just removed the default left padding and margin fro the menu.

    e.g.

    Code:
    ul#navbuttons {
        padding:0;
        list-style:none;
        width:130px;
        margin:0 auto;
    }
    ul#navbuttons img {
        border:none
    }
    Then tidy up the html like so:

    Code:
            <ul id="navbuttons">
                <li><a href="testCSSnavigation.htm"><img src="buttons/home.gif" alt="Petals & Patches home" height="30px" width="130px" ></a></li>
                <li><a href="clothdolls.htm"><img src="buttons/clothdolls.gif" alt="Petals & Patches cloth dolls patterns" height="30px" width="130px" ></a></li>
                <li><a href="stitcheries.htm"><img src="buttons/stitcheries.gif" alt="Petals & Patches stitcheries patterns" height="30px" width="130px" ></a></li>
                <li><a href="applique.htm"><img src="buttons/applique.gif" alt="Petals & Patches applique patterns" height="30px" width="130px" ></a></li>
                <li><a href="bears.htm"><img src="buttons/bears.gif" alt="Petals & Patches bear patterns" height="30px" width="130px" ></a></li>
                <li><a href="quilts.htm"><img src="buttons/quilts.gif" alt="Petals & Patches bear patterns" height="30px" width="130px" ></a></li>
                <li><a href="bags.htm"><img src="buttons/bags.gif" alt="Petals & Patches bag patterns" height="30px" width="130px" ></a></li>
                <li><a href="bags.htm"><img src="buttons/bags.gif" alt="Petals & Patches bag patterns" height="30px" width="130px" ></a></li>
                <li><a href="seasidemoments.htm"><img src="buttons/seasidemoments.gif" alt="Petals & Patches Seaside Moments patterns" height="30px" width="130px" ></a></li>
                <li><a href="blockofthemonth.htm"><img src="buttons/bom.gif" alt="Petals & Patches BoM patterns" height="30px" width="130px" ></a></li>
                <li><a href="accessories.htm"><img src="buttons/accessories.gif" alt="Petals & Patches accessories" height="30px" width="130px" ></a></li>
                <li><a href="ordering.htm"><img src="buttons/ordering.gif" alt="Petals & Patches bear ordering information" height="30px" width="130px" ></a></li>
                <li><a href="contactus.htm"><img src="buttons/contactus.gif" alt="Contacting Petals & Patches" height="30px" width="130px" ></a></li>
                <li><a href="stockists.htm"><img src="buttons/stockists.gif" alt="Petals & Patches pattern stockists" height="30px" width="130px" ></a></li>
                <li><a href="mailto:info&#64petalsandpatches.com?subject=E-mail request for Petals and Patches"><img src="buttons/e-mailus.gif" alt="E-mailing Petals & Patches" height="30px" width="130px" ></a></li>
                <li><a href="links.htm"><img src="buttons/links.gif" alt="Petals & Patches pattern stockists" height="30px" width="130px" ></a></li>
                <li><a href="http://ww8.aitsafe.com/cf/review.cfm?userid=A736163"><img src="buttons/reviewcart.gif" alt="Petals & Patches bear patterns" height="30px" width="130px" ></a></li>
                <li><a href="http://petalsandpatches.wordpress.com/">Blog</a></li>
            </ul>

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Paul
    Thank you for your prompt reply.
    I assume that the new CSS code you mention goes in the file called petalsandpatches-layout-1.css? That where I placed it.
    I then tidied up the html as you suggested.
    It now looks like the attachment.

    It still looks like the buttons are determined not to be bound by the left column.

    PS: - I added a new link called chalkboards.htm
    Attached Images Attached Images
    ========================
    Carn the Tiges!
    www.petalsandpatches.com

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,343
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    It looks as though the left column is in place here. The screenshot you posted means you probably entered the code incorrectly because you still have bullets on the list and the code I gave above removed the bullets

    You need to clear the floated side column (see faq on floats). You can do it using overflow:hidden (assuming that you don't want visible overflow later on):
    Code:
    #outer {
        text-align:left;
        border:1px solid #888888;
        width:800px;
        margin:auto;
        overflow:hidden;
    }
    Don't us the deprecated (in strict doctypes) align attribute as you are using css to handle this and it may conflict.

    Code:
        <div id="l-col" align="left">
    Don't use breaks to make space as they are not meant for that. If you have paragraphs then use the p element properly


    e.g. code snippet
    Code:
    .....    or to New Zealand, USA or UK. <br />
             We have a catalogue ....
    It should be:

    Code:
    <p>......
    or to New Zealand, USA or UK. </p>
    <p> We have a catalogue ..... </p>
    Hope that's of some use


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •