Solved

Why is my CSS styled menu lining vertically(for a fraction of second when page is loading) and then displays horizontally in asp.net?

Posted on 2011-02-18
2
447 Views
Last Modified: 2012-05-11
I am using CSS to style my menu.
I don't know why my  menu lining vertically(for a fraction of second when page is loading) and then displays horizontally like how it is supposed to do. why is it doing like this? I don't what this to happenning?

CSS
div.hideSkiplink
{
    background-color:#3a4f63;
    width:100%;
}

div.menu
{
    padding: 4px 0px 4px 8px;
}

div.menu ul
{
    list-style: none;
    margin: 0px;
    padding: 0px;
    width: auto;
}

div.menu ul li a, div.menu ul li a:visited
{
    background-color: #465c71;
    border: 1px #4e667d solid;
    color: #dde4ec;
    display: block;
    line-height: 1.35em;
    padding: 4px 20px;
    text-decoration: none;
    white-space: nowrap;
}

div.menu ul li a:hover
{
    background-color: #bfcbd6;
    color: #465c71;
    text-decoration: none;
}

div.menu ul li a:active
{
    background-color: #465c71;
    color: #cfdbe6;
    text-decoration: none;
}
0
Comment
Question by:AppDevs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
Krummelz earned 500 total points
ID: 34925570
This happens because the menu was made with UL tags, which are used for lists. The "list-style: none;" is what makes it change to be horizontal. If you would rather not have it change while the page is loading, you should then re-create the menu without using UL tags. I recommend a DIV with other DIV tags inside.
0
 

Author Comment

by:AppDevs
ID: 34925682
This is my ASPX code:
Can you please help me to modify it?
<div class="clear hideSkiplink">
                <asp:LoginView ID="NavbarLogin" runat="server" EnableViewState="false">
                            <ContentTemplate>
                                <asp:Menu ID="Navigation" Orientation="Horizontal" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false">
                                    <Items>
                                        <asp:MenuItem NavigateUrl="Home.aspx" Text="Home" ToolTip="My personal home page"/>
                                                                                                                        <asp:MenuItem NavigateUrl="javascript:void(0);" Text="Second Page" ToolTip="Second Page">
                                                                                                                                    <asp:MenuItem Text="Show my page" Value="Show my page" ToolTip="My page" NavigateUrl="SecondPage.aspx"></asp:MenuItem>
                                    </Items>
                                </asp:Menu>
                            </ContentTemplate>
                                   </asp:LoginView>
            </div>
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Fix Form size HTML 16 30
CSS Flex space-between 2 20
Dictionary and array of [N] size - performance tuned 12 40
locate sql commands in C# visual studio Project 6 37
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question