We help IT Professionals succeed at work.
Get Started

Margin top not workling for anchor inside li item

510 Views
Last Modified: 2013-11-19
I am novice to front end designing..I am trying to create a horizontal navigation menu..i have the the anchor tags inside li.. when i apply margin-top to anchor tag...it is not working.

   <ul id="navigationMenu">
                <li><a href="#" class="selectedmenu">Home </a></li>
                <li><a href="#" class="normalmenu">Menu1s </a></li>
                <li><a href="#" class="normalmenu">Menu2</a></li>
            </ul>
            <!-- end navigation menu-->
        

Open in new window


CSS:
#navigationMenu li
{
    background: gray;
    display: inline-block;
    padding: 10px 50px;
    display: inline-block;
    float: left;
    border: 2px solid black;
}


#navigationMenu li a
{
 
  font-size: 20px;
  text-decoration: none;
   border: 1px solid red;
   font-weight: bold;
 margin-top: 30px;
   
}

The margin-top for anchor tag inside li is not working...whereas margin left and right are working fine..I know that we can achieve this y setting padding top of li..Since i am new i like ti know why the anchor tag margin top is not working
Comment
Watch Question
Web Architect
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE