Results 1 to 5 of 5

Thread: [Solved]Horizontal Navigation *Not what you think!*

  1. #1
    New user
    Join Date
    11-16-10.
    Posts
    2

    Default [Solved]Horizontal Navigation *Not what you think!*

    Hello Contao Community. I have recently set up my own website using the Contao CMS, and I ran into a little problem. I need to somehow make a horizontal navigation menu. The problem is that I just need good old fashioned links. I do not need a fancy javascript menu; just links will do. I have searched the forums and found nothing on this. The problem when I try to do it with custom css is that instead of this:

    Link | Link | Link

    I get this:

    Link
    |
    Link
    |
    Link

    My code is as follows:

    Custom HTML (Note: The links are not set up yet):
    Code:
    <div class="headNav" >
    Warenkorb <pre> | </pre>
    ZahlungsundVersandbedingungen <pre> | </pre>
    AGB <pre> | </pre>
    Kontakt
    </div>
    CSS:
    Code:
    .headNav
    {
    	width:500px;
    	float:right;
    	margin:10px 0;
    	text-align:right;
    }
    Can somebody help me with this issue? I really need to finish the site and this is pretty much my only obstacle.
    Thank you very much

  2. #2
    imported_Nina
    Gast

    Default Re: Horizontal Navigation *Not what you think!*

    Welcome taladude

    Your problem is the usage of <pre> because this HTML-element forces a new line.

    So just delete the <pre> and it will work. Though I wonder, why you use a "Custom HTML"-module instead of a navigation-module?

  3. #3
    New user
    Join Date
    11-16-10.
    Posts
    2

    Default Re: Horizontal Navigation *Not what you think!*

    Nina, thank you very much for responding :D doing what you said did the trick . I now have the layout that I need. I didn't use the default menu because it is vertical. I understand that I could've edited the template, but I was short on time and I don't really know PHP . But my problem is solved now, so thank you again . Maybe later I will learn some PHP.

  4. #4
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: [Solved]Horizontal Navigation *Not what you think!*

    Just in case anybody finds this thread:

    The original contao menu is not vertical; it is displayed vertical when not styled as it html default. :roll:

    Solve it using css. One option looks like: li { display: inline; }

  5. #5
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: [Solved]Horizontal Navigation *Not what you think!*

    best option for horizontal is to use:

    Code:
    ul li,ul li,ul li a,ul li span.active { display:inline-block;}
    ul li a,,ul li span.active { padding: 3px 5px;}
    Then you just need a fix for IE7 (which doesn't support inline-block, but inline)
    IE7 conditional stylesheet
    Code:
    ul li,ul li,ul li a,ul li span.active { display:inline;}

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
  •