Jump to content

Menu corrupted on mozilla & position not fixed


AGazzaz

Recommended Posts

Hello,I am glad to be on such a great forum.i am new to CSS and i have created a page to be aTemplate for mysiteit works fine on konqueror and opera konqueror.jpgcorrupted on mozilla and firefox mozilla.jpgalthough i placed a 1px solid white border for the menu but it did not appearby the way i am using Linux so i do not have Internet Explorer so if somebody would test it for me i would be very thankfulthe style code for my menu

  <style>ul.menu {float:left;padding:0;margin-top:0;}a.menu {float:left;width:6em;text-decoration:none;color:white;background-color:#36648B;padding:0.2em 0.6em;border-right:1px solid white;}a:hover {background-color:#4F94CD;}li {list-style:none;border:2px white solid; display:inline;}p {margin-left:2%;text-indent: 1cm}img.pentium {margin-left:-20px;}body {color : #1a5886;}  </style>

the html code for the menu (table code included)

<table>  <tbody>    <tr>      <td style="width: 148px;"><!--Upper Menu-->      <ul class="menu">        <li><a class="menu" href="index.html">Home</a></li>        <li><a class="menu" href="products.html">Products</a></li>        <li><a class="menu" href="software.html">Software</a></li>        <li><a class="menu" href="support.html">Support</a></li>        <li><a class="menu" href="contact.html">Contactus</a></li>      </ul><!--Upper Menu END--><img class="pentium" src="pentium4.jpg" width="160">      </td>      <td style="width: 783px;"><!--About startech start-->      <p align="justify"><strong>STARTECH</strong><!--WHATEVER TO BE WRITTEN ON THE SITE GOES HERE-->      </td>    </tr>  </tbody></table>

The second problem:try resizing the browser you are viewing the page with you will find the menu going down to the center of the table and i want it to stay on the topof course any suggestions about the look of the site are most welcomeThank you all and Good Luck

Link to comment
Share on other sites

hi AGazzaz,i tried to look at your coding and came up with this. i am NO big time coder ok- i am just starting to take this serious, so i'm no pro. what i basically did was to fix the menu so that it stays put when u scroll. i tested it on firefox and opera. oh... and i seperated the css from the html, so that its 2 separate documents now.the css:

#leftside {float:left;margin:-15px 0 0;width:145px;}.leftsidemenu {float:left;width:6em;text-decoration:none;color:white;background-color:#36648B;padding:0.2em 0.6em;border-right:1px solid white;}#leftside ul {float:left;padding:0;margin-top:0;}.leftsidemenu:hover {background-color:#4F94CD;}.menublock {margin-bottom:10px;}#leftside li {list-style:none;border:2px white solid;display:inline;}p {margin-left:2%;text-indent: 1cm}img.pentium {margin-left:-20px;}body {color : #1a5886;}

the html: (you might wanna think about using div class or id instead of tables.)

<!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" lang="en" xml:lang="en"><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link rel="stylesheet" href="AGazzaz.css" type="text/css" media="screen,projection" /></head><body><div id="leftside"><p class="menublock"><a class="leftsidemenu" href="index.html">Home</a><a class="leftsidemenu" href="products.html">Products</a><a class="leftsidemenu" href="software.html">Software</a><a class="leftsidemenu" href="support.html">Support</a><a class="leftsidemenu" href="support.html">Contact</a></p></div><table>  <tbody>    <tr>      <td style="width: 148px;"><!--Upper Menu--><!--Upper Menu END--><img class="pentium" src="pentium4.jpg" width="160">      </td>      <td style="width: 783px;"><!--About startech start-->      <p align="justify"><strong>STARTECH</strong>you will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text here<br><br>you will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text here<br><br>you will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text here<br>you will find some text hereyou will find some text hereyou will find some text hereyou will find some text hereyou will find some text here<br><!--WHATEVER TO BE WRITTEN ON THE SITE GOES HERE-->      </td>    </tr>  </tbody></table></body></html>

best regards

Link to comment
Share on other sites

thank you Ible-Whitei found out that the problem was windows/linux problemnotice the size of the menu i have posted as a screenshot and that size that appears in your browser; big difference huh :)since the width of the image was nearly equal to the width of the menu in linux so i decided to put them together [the picture under the menu] so i placed them in one cell in the tablewhat you did taking the menu out of the table so it is not affected by the second cell of the table, wether the table is expanded by extra text or not nothing will change to the menubut thank you so much for making my code tidy it was something i really needed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...