CSS 在 Opera 和 IE 中看起来很糟糕;我应该从哪里开始?

发布于 2024-09-15 11:09:17 字数 2114 浏览 3 评论 0原文

我刚刚完成了我的网站,它在 FF、Safari 和 Chrome 中看起来都不错。 Opera看起来不错,但不如FF。 IE看起来很糟糕。

是否有任何应用程序可以检查不良 CSS 并修复它? 如果没有,跨浏览器调整网站最简单的方法是什么?

以下只是我在外观方面遇到的众多问题之一......

我在index.html 中有一个表单,其中包含多个输入。在输入的右侧,有一个用于提交表单的“搜索”按钮。该按钮应该位于右侧,但有时会下降一行,最终位于输入下方的左侧。这种情况仅发生在 Opera 10.53 和 IE 浏览器中。 (尚未测试任何其他 Opera 版本)。

这是代码:

<table border="0" align="center">
  <tr>
    <td>
      <div class="nav_container" id="nav_container">
        <div id="nav_container2" class="nav_container2">
          <form id="nav_form_main" name="nav_form_main" action="/search/" target="iframe001" method="get" onSubmit="reset_and_subm();">
            <div class="nav_lists" id="nav_list">
              <input name="nav_querystring" type="text" id="nav_querystring" style="width: 240px; font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold;" value="">
              <select name="nav_category_list" size="1" id="nav_category_list" style="width: 195px;" onChange="subcatSelection();">
                <option value="All categories" selected>-- All categories --</option>
                ALOT OF OPTIONS HERE
              </select>
              <select name="nav_city_list" id="nav_city_list" style="width: 180px;" onChange="areapicker();">
                <option id="Hela Sverige" value="Hela Sverige" selected>-- Hela Sverige --</option>
                ALOT OF OPTIONS HERE
              </select>                 
              <input type="submit" name="nav_submit" id="nav_submit" value="Sök" style="width: 58px; font-size: 13px;">
            </div>
          </div>
        </td>
      </tr>
    </table>

这里是涉及的 CSS:

.nav_container2 {
  position:relative;
  left:0px;
  top:10px;
}

.nav_container {
  background-image: url(../Graphics/menu_lvl1.gif);
  height: 101px;
  width: 720px;
  padding:0;
  margin:0;
}

如果您需要更多输入,请告诉我...

当然,这里问题最多的是 IE...Opera 中的一些问题,正如我上面提到的...其余的是美好的。

谢谢

I have just completed my website, and it looks good in FF, Safari and Chrome.
Opera looks alright, but not as good as FF.
IE looks very bad.

Is there any application for checking bad CSS and just fix it?
If not, what is the easiest way to cross-browser adjust a website?

Below is only one of the many problems I have with appearance...

I have a form in index.html which contains several inputs. To the right of the inputs, I have a "Search" button which submits the form. This button SHOULD be on the right, but sometimes drops one line to end up on the left below the inputs. This happens only in Opera 10.53 and IE browsers. (haven't tested any other Opera version).

Here is the code:

<table border="0" align="center">
  <tr>
    <td>
      <div class="nav_container" id="nav_container">
        <div id="nav_container2" class="nav_container2">
          <form id="nav_form_main" name="nav_form_main" action="/search/" target="iframe001" method="get" onSubmit="reset_and_subm();">
            <div class="nav_lists" id="nav_list">
              <input name="nav_querystring" type="text" id="nav_querystring" style="width: 240px; font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold;" value="">
              <select name="nav_category_list" size="1" id="nav_category_list" style="width: 195px;" onChange="subcatSelection();">
                <option value="All categories" selected>-- All categories --</option>
                ALOT OF OPTIONS HERE
              </select>
              <select name="nav_city_list" id="nav_city_list" style="width: 180px;" onChange="areapicker();">
                <option id="Hela Sverige" value="Hela Sverige" selected>-- Hela Sverige --</option>
                ALOT OF OPTIONS HERE
              </select>                 
              <input type="submit" name="nav_submit" id="nav_submit" value="Sök" style="width: 58px; font-size: 13px;">
            </div>
          </div>
        </td>
      </tr>
    </table>

And here is the CSS involved:

.nav_container2 {
  position:relative;
  left:0px;
  top:10px;
}

.nav_container {
  background-image: url(../Graphics/menu_lvl1.gif);
  height: 101px;
  width: 720px;
  padding:0;
  margin:0;
}

If you need more input just let me know...

Of course, it is IE with the most issues here... Some in Opera as I mentioned above... Rest is fine.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

滥情稳全场 2024-09-22 11:09:17

您可以使用以下站点验证您的 CSS,看看它是否符合 W3C 标准:

http:// jigsaw.w3.org/css-validator/

它会检查你的CSS,检查兼容性,并吐出错误(如果存在)。它会告诉您文件中的哪些地方有错误,以便您可以修复它们。我不知道有什么工具可以为你修复 CSS...不过我不会使用它,因为我不会通过这种方式学到任何东西。

您可以使用以下站点来验证您使用的 HTML 和其他标记语言:

http://validator.w3.org/

这些都是我在开发时经常使用的令人难以置信的工具。我还建议安装 Web 开发人员工具栏Firebug 让您的开发过程变得更加轻松。

使用这些工具将帮助您制作跨浏览器兼容的网站...如果某些内容不兼容,您可以使用这些工具来调试和修复您的工作。

我希望这有帮助!

You can use the following site to validate your CSS to see if it meets the W3C standards:

http://jigsaw.w3.org/css-validator/

It'll go though your CSS, check compatibility, and spit back errors if they exist. It'll show you where in your file you have mistakes so you can go fix them. I don't know about any tools that will fix your CSS for you... I wouldn't use it though because I wouldn't learn anything that way.

You can use the following site to validate your HTML and other markup languages you use:

http://validator.w3.org/

These are both incredible tools that I use frequently when developing. I would also recommend installing the Web Developer Toolbar and Firebug to make your life much easier when developing.

Using these tools will help you make cross-browser compatible websites... if something is not compatible, you can use these tools for debugging and fixing your work.

I hope this helps!

溺孤伤于心 2024-09-22 11:09:17

据我所知,还没有一个真正好的用于调试 CSS 的应用程序。不过你的顺序是正确的。从 Firefox 开始,然后是 chrome / safari、opera、IE。不过,我会根据使用情况按重要性顺序将 IE 置于 Opera 之上。

您应该能够使这些浏览器正常工作。对于 IE,请参阅条件注释以将额外的 CSS 应用到 IE 。您可以覆盖其他样式来纠正 IE 中看起来不太好的内容。

There is not really a good application that I know of for debugging CSS. You have the correct order though,. start with firefox, then chrome / safari, opera, IE. I would place IE above opera in order of importance based on usage though.

You should be able to get those browsers working well. When it comes to IE, look to conditional comments to apply additional CSS to IE only. You can override other styles to correct things in IE that do not look so good.

是你 2024-09-22 11:09:17

如果您还没有使用它,我建议您使用 CSS RESET。
这应该可以消除大部分跨浏览器的问题。
它给您留下了更明显的浏览器特定错误,这些错误可以通过特定的 css 文件轻松修复,并通过条件注释完成。

为了进行测试,我使用firefox、chrome、ie 8、ie 7、ie 6、opera、safari。
有些应用程序可以向您显示您没有的浏览器的屏幕截图,例如浏览器截图。但我发现它们并没有真正的帮助,如果它在 ie 7 和 ie 7 中表现良好的话。 8、chrome和FF我很高兴。

也许不能直接回答你的问题,但它可以帮助避免一开始就出现太多的不一致。 :)

If you're not already using it, i can recommend using a CSS RESET.
That should eliminate most of the crossbrowser bs.
It leaves you with the more obvious browser specific bugs, which are easily fixed with an specific css file, done with conditional comments.

For testing i do firefox, chrome, ie 8, ie 7, ie 6, opera, safari.
There are apps that show you screenshots for browsers you dont have like browsershots. But i find them not really helpful, if it shows well in ie 7 & 8, chrome and FF im happy.

Maybe does not directly anwser your question, but it can help avoiding too much inconsistency to start with. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文