gpt4 book ai didi

仅 IE8 中的 CSS 问题

转载 作者:行者123 更新时间:2023-11-28 10:57:14 25 4
gpt4 key购买 nike

我继承了一个使用 Google 的 GSNewsBar 的网站.该向导创建包含链接样式表的代码。

在除 IE8 之外的所有浏览器上都可以正确显示(甚至是 IE7!)- enter image description here

但在 IE8 中,搜索词列表不会换行。我已经在覆盖 div 宽度的代码中添加了本地样式,并且在 IE8 中使用开发人员工具,我可以看到它正在正确设置宽度(下面屏幕截图中的蓝色轮廓)。但是文本没有换行。有人可以帮我从这里出去吗?我已经尝试将 word-wrap:break-word 添加到覆盖样式中,这确实会强制它换行,但它会在单词中间而不是单词之间中断。 enter image description here

这是完整的代码,包括覆盖样式:

<!-- Begin News Bar Wizard Generated Code++ -->
<!--
// Created with a Google AJAX Search Wizard
//http://www.google.com/uds/solutions/wizards/newsbar.html
-->

<!--
// The Following div element will end up holding the actual newsbar.
// You can place this anywhere on your page.
-->
<div id="newsBar-bar" style="padding-left:10px">
<span style="color:#a5a599">Loading Google News Results</span>
</div>

<!-- Ajax Search Api and Stylesheet
// Note: If you are already using the AJAX Search API, then do not include it
// or its stylesheet again
-->
<script src="http://www.google.com/uds/api?file=uds.js&v=1.0&source=uds-nbw"
type="text/javascript"></script>
<style type="text/css">
@import url("http://www.google.com/uds/css/gsearch.css");
</style>

<!-- News Bar Code and Stylesheet -->
<script type="text/javascript">
window._uds_nbw_donotrepair = true;
</script>
<script src="http://www.google.com/uds/solutions/newsbar/gsnewsbar.js?mode=new"
type="text/javascript"></script>
<style type="text/css">
@import url("http://www.google.com/uds/solutions/newsbar/gsnewsbar.css");
</style>

<style type="text/css">
.gs-result .gs-title * { color: #243c60; }
.titleBox_gsnb { line-height: 1.1; padding-bottom: .25em; }
.statusBoxRoot_gsnb {
width: 300px;
/*word-wrap: normal;*/
}
</style>

<script type="text/javascript">
function LoadNewsBar() {
var newsBar;
var options = {
largeResultSet : true,
title : "Google News Results",
horizontal : false,
linkTarget : GSearch.LINK_TARGET_BLANK,
resultStyle : GSnewsBar.RESULT_STYLE_COMPRESSED,
autoExecuteList : {
executeList : [<?php print $google_news_string; ?>]

}
}

newsBar = new GSnewsBar(document.getElementById("newsBar-bar"), options);
}
// arrange for this function to be called during body.onload
// event processing
GSearch.setOnLoadCallback(LoadNewsBar);
</script>
<!-- ++End News Bar Wizard Generated Code++ -->

更新 - 根据下面的评论,当在一个完全空白的、没有样式的页面中使用搜索词时,搜索词会正确换行,因此页面上的现有样式中必须有一些东西导致这。这是来自 Chrome 元素检查器的所选元素 (statusBoxRoot_gsnb) 的计算样式内容(非常长,抱歉):

-webkit-animation-delay: 0s;
-webkit-animation-direction: normal;
-webkit-animation-duration: 0s;
-webkit-animation-fill-mode: none;
-webkit-animation-iteration-count: 1;
-webkit-animation-name: none;
-webkit-animation-play-state: running;
-webkit-animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
-webkit-appearance: none;
-webkit-backface-visibility: visible;
-webkit-background-clip: border-box;
-webkit-background-composite: source-over;
-webkit-background-origin: padding-box;
-webkit-background-size: auto auto;
-webkit-border-fit: border;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-image: none;
-webkit-border-vertical-spacing: 0px;
-webkit-box-align: stretch;
-webkit-box-direction: normal;
-webkit-box-flex: 0;
-webkit-box-flex-group: 1;
-webkit-box-lines: single;
-webkit-box-ordinal-group: 1;
-webkit-box-orient: horizontal;
-webkit-box-pack: start;
-webkit-box-reflect: none;
-webkit-box-shadow: none;
-webkit-color-correction: default;
-webkit-column-break-after: auto;
-webkit-column-break-before: auto;
-webkit-column-break-inside: auto;
-webkit-column-count: auto;
-webkit-column-gap: normal;
-webkit-column-rule-color: #383833;
-webkit-column-rule-style: none;
-webkit-column-rule-width: 0px;
-webkit-column-span: 1;
-webkit-column-width: auto;
-webkit-font-smoothing: auto;
-webkit-highlight: none;
-webkit-hyphenate-character: auto;
-webkit-hyphenate-limit-after: auto;
-webkit-hyphenate-limit-before: auto;
-webkit-hyphens: manual;
-webkit-line-break: normal;
-webkit-line-clamp: none;
-webkit-locale: auto;
-webkit-margin-after-collapse: collapse;
-webkit-margin-before-collapse: collapse;
-webkit-marquee-direction: auto;
-webkit-marquee-increment: 6px;
-webkit-marquee-repetition: infinite;
-webkit-marquee-style: scroll;
-webkit-mask-attachment: scroll;
-webkit-mask-box-image: none;
-webkit-mask-clip: border-box;
-webkit-mask-composite: source-over;
-webkit-mask-image: none;
-webkit-mask-origin: border-box;
-webkit-mask-position: 0% 0%;
-webkit-mask-repeat: repeat;
-webkit-mask-size: auto auto;
-webkit-nbsp-mode: normal;
-webkit-perspective: none;
-webkit-perspective-origin: 150px 31px;
-webkit-rtl-ordering: logical;
-webkit-svg-shadow: none;
-webkit-text-combine: none;
-webkit-text-decorations-in-effect: none;
-webkit-text-emphasis-color: #383833;
-webkit-text-emphasis-position: over;
-webkit-text-emphasis-style: none;
-webkit-text-fill-color: #383833;
-webkit-text-security: none;
-webkit-text-stroke-color: #383833;
-webkit-text-stroke-width: 0px;
-webkit-transform: none;
-webkit-transform-origin: 150px 31px;
-webkit-transform-style: flat;
-webkit-transition-delay: 0s;
-webkit-transition-duration: 0s;
-webkit-transition-property: all;
-webkit-transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
-webkit-user-drag: auto;
-webkit-user-modify: read-only;
-webkit-user-select: text;
-webkit-writing-mode: horizontal-tb;
alignment-baseline: auto;
background-attachment: scroll;
background-clip: border-box;
background-color: transparent;
background-image: none;
background-origin: padding-box;
background-position: 0% 0%;
background-repeat: repeat;
background-size: auto auto;
baseline-shift: baseline;
border-bottom-color: #383833;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
border-bottom-style: none;
border-bottom-width: 0px;
border-collapse: separate;
border-left-color: #383833;
border-left-style: none;
border-left-width: 0px;
border-right-color: #383833;
border-right-style: none;
border-right-width: 0px;
border-top-color: #383833;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-top-style: none;
border-top-width: 0px;
bottom: auto;
box-shadow: none;
box-sizing: content-box;
caption-side: top;
clear: none;
clip: auto;
clip-path: none;
clip-rule: nonzero;
color: #383833;
color-interpolation: srgb;
color-interpolation-filters: linearrgb;
color-rendering: auto;
cursor: auto;
direction: ltr;
display: block;
dominant-baseline: auto;
empty-cells: show;
fill: black;
fill-opacity: 1;
fill-rule: nonzero;
filter: none;
float: none;
flood-color: black;
flood-opacity: 1;
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
font-style: normal;
font-variant: normal;
font-weight: normal;
glyph-orientation-horizontal: 0deg;
glyph-orientation-vertical: auto;
height: 62px;
image-rendering: auto;
kerning: 0;
left: auto;
letter-spacing: normal;
lighting-color: white;
line-height: 18px;
list-style-image: none;
list-style-position: outside;
list-style-type: disc;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
marker-end: none;
marker-mid: none;
marker-start: none;
mask: none;
max-height: none;
max-width: none;
min-height: 0px;
min-width: 0px;
opacity: 1;
orphans: 2;
outline-color: #383833;
outline-style: none;
outline-width: 0px;
overflow-x: visible;
overflow-y: visible;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
page-break-after: auto;
page-break-before: auto;
page-break-inside: auto;
pointer-events: auto;
position: static;
resize: none;
right: auto;
shape-rendering: auto;
speak: normal;
stop-color: black;
stop-opacity: 1;
stroke: none;
stroke-dasharray: none;
stroke-dashoffset: 0;
stroke-linecap: butt;
stroke-linejoin: miter;
stroke-miterlimit: 4;
stroke-opacity: 1;
stroke-width: 1;
table-layout: auto;
text-align: left;
text-anchor: start;
text-decoration: none;
text-indent: 0px;
text-overflow: clip;
text-rendering: auto;
text-shadow: none;
text-transform: none;
top: auto;
unicode-bidi: normal;
vector-effect: none;
vertical-align: baseline;
visibility: visible;
white-space: normal;
widows: 2;
width: 300px;
word-break: normal;
word-spacing: 0px;
word-wrap: normal;
writing-mode: lr-tb;
z-index: auto;
zoom: 1;

我找不到从 IE8 的开发人员工具中复制/粘贴的简单方法,因此这里是应用于所选元素 (statusBoxRoot_gsnb) 的样式的屏幕截图。我希望有人会在前几行中看到一些非常明显的东西,这样您就不必通读所有内容!

: enter image description here

最佳答案

问题似乎是 IE-8(并且只有那个 ..)将内部只有一个空格的跨度视为空(自闭合标签)。

Google 正是出于这个原因在关键字之间添加了空格,以便它们在需要时中断。

幸运的是,他们为该跨度添加了一个类,因此我们可以通过 CSS 来欺骗它

.statusItemSep_gsnb:after{content:' ';}

这会在它们之后放置一个空格并使 IE 正常运行。

工作示例 http://jsfiddle.net/gaby/V8uHF/

关于仅 IE8 中的 CSS 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6048153/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com