Welcome to Dream.In.Code
Become an Expert!

Join 150,424 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,085 people online right now. Registration is fast and FREE... Join Now!




CSS TheVertical Position Problem in IE

 
Reply to this topicStart new topic

CSS TheVertical Position Problem in IE

bmeisner
27 Mar, 2008 - 01:13 PM
Post #1

New D.I.C Head
*

Joined: 27 Mar, 2008
Posts: 5


My Contributions
The following code works Opera, Firefox, Safari and Netscape. But when I test it in IE the navigation buttons change their vertical position from where they should appear. What do I have to do to get the page to look the same in all browsers?

CODE


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Header and Horizantal Navaigation - JAS</title>
<style type="text/css">

#navagation {
    height: 194px;
    background-image: url(images/Banner.jpg);
    width: 800px;
    position:absolute;
    left: 0px;
    top: 0px;
}
#navagation ul {
    padding: 0px;
    list-style-type: none;
    margin-left: 190px;
}
#navagation ul li {
    display: inline;
}
#navagation ul li a {
    float: left;
    height: 6px;
    padding: 8px;
    text-decoration: none;
    font-size: 10px;
    color: #CC0000;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-weight: bold;
    margin-top: 126px;
}
#navagation  ul  li a:hover {
    color: #FFFFFF;
}
#navagation ul li.current a:link {
    border-bottom-color: #CC0000;
    border-bottom-style: solid;
}

</style>
</head>
<body>
<div id="navagation">
  <ul type="disc">
    <li class="current"><a href="Horizonatl.html">Home</a></li>
    <li><a href="about.html">About Susie</a></li>
    <li><a href="services">Services</a></li>
    <li><a href="work">How It Works</a></li>
    <li><a href="start.html">Getting Started</a></li>
    <li><a href="testimonials.html">Testimonials</a></li>
    <li><a href="faq.html">FAQ</a></li>
    <li><a href="contact.html">Contact</a></li>
  </ul>
</div>
</body>
</html>

Attached Image
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: CSS TheVertical Position Problem In IE
27 Mar, 2008 - 01:25 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,660



Thanked: 314 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
I am not seeing any difference between IE and FF with the page there. Are you sure it is not just the natural display of the browsers that is different? I mean they are separate programs that draw things just ever so slightly different. But as far as visual look they are virtually identical. You are never going to get a site looking EXACTLY to the microscopic level looking the same. That is why you have to plan your design with a little flexibility in mind. This isn't the world of print.

Can you perhaps take two screenshots of the same menu? one from FF and one from IE so we can see the difference.

Thanks! smile.gif
User is offlineProfile CardPM
+Quote Post

bmeisner
RE: CSS TheVertical Position Problem In IE
27 Mar, 2008 - 02:14 PM
Post #3

New D.I.C Head
*

Joined: 27 Mar, 2008
Posts: 5


My Contributions
QUOTE(Martyr2 @ 27 Mar, 2008 - 02:25 PM) *

I am not seeing any difference between IE and FF with the page there. Are you sure it is not just the natural display of the browsers that is different? I mean they are separate programs that draw things just ever so slightly different. But as far as visual look they are virtually identical. You are never going to get a site looking EXACTLY to the microscopic level looking the same. That is why you have to plan your design with a little flexibility in mind. This isn't the world of print.

Can you perhaps take two screenshots of the same menu? one from FF and one from IE so we can see the difference.

Thanks! smile.gif


Hope this helps. As you can see the nav buttons move up into the header space when using IE

Thanks


Attached Image Attached Image
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: CSS TheVertical Position Problem In IE
27 Mar, 2008 - 02:34 PM
Post #4

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,660



Thanked: 314 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
I see it now, thanks for the pics.

Here is your answer.... Firefox apparently adds a margin to the top of the UL tag, IE doesn't. So how to solve it is specifying the actual top margin for the UL element so that both browsers know what to make the top margin.

CODE

#navagation ul {
    padding: 0px;
    list-style-type: none;
    margin-left: 190px;
    margin-top: 15px;
}


Here we added a 15px top margin to the UL element and that appears to solve the situation for both browsers. If you want to move it up or down, just adjust the margin-top property specified above.

Hope that solves your problem. smile.gif
User is offlineProfile CardPM
+Quote Post

bmeisner
RE: CSS TheVertical Position Problem In IE
27 Mar, 2008 - 02:52 PM
Post #5

New D.I.C Head
*

Joined: 27 Mar, 2008
Posts: 5


My Contributions
QUOTE(Martyr2 @ 27 Mar, 2008 - 03:34 PM) *

I see it now, thanks for the pics.

Here is your answer.... Firefox apparently adds a margin to the top of the UL tag, IE doesn't. So how to solve it is specifying the actual top margin for the UL element so that both browsers know what to make the top margin.

CODE

#navagation ul {
    padding: 0px;
    list-style-type: none;
    margin-left: 190px;
    margin-top: 15px;
}


Here we added a 15px top margin to the UL element and that appears to solve the situation for both browsers. If you want to move it up or down, just adjust the margin-top property specified above.

Hope that solves your problem. smile.gif



Works perfect! Thanks for your help.

This post has been edited by Martyr2: 27 Mar, 2008 - 03:46 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 08:40PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month