CSS不是被提供的,也许是因为角色没有被逃脱? [英] CSS is not being aplied, maybe due to character's not being escaped?

查看:237
本文介绍了CSS不是被提供的,也许是因为角色没有被逃脱?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要澄清一点,现在我已经停了一个小时,因为我不知道是什么问题。我粘贴了一个完整的例子,在jsbin.com上也是这样。



JSBIN LINK



代码



 <!DOCTYPE html> 
< html>
< head>
< meta charset =utf-8>
< meta name =viewportcontent =width = device-width>
< title> JS Bin< / title>
< / head>
< body>
< table width =100%>
< tr>
< td class =darkstylestyle =width:15%;>
< div> URI< / div>
< / td>
< td class =lightstylestyle =width:85%;> someurl< / td>
< / tr>
< tr>
< td class =darkstylestyle =width:15%;>
< div>置信度< / div>
< / td>
< td class =lightstylestyle =width:85%;> Low< / td>
< / tr>
< tr>
< td class =darkstylestyle =width:15%;>
< div> Attack< / div>
< / td>
< td class =lightstylestyle =width:85%;>从app.foo.bar这样的子域设置的Cookie只能由浏览器传输到该域。但是,范围到父级域的cookie可能会发送到父级或父级的任何子域。< / td>
< / tr>
< tr>
< td class =darkstylestyle =width:15%; word-wrap:break-word;>
< div> OtherInfo< / div>
< / td>
< td class =lightstylestyle =width:85%;>
< div> aaa用于比较的原始域名为&#13;
myurl.ca&#13;
DERPCOOKIE =& amp; amp; amp; amp& amp; amp; amp;& amp; amp;#13;
COOKIE3 = ASDASD-97867867848-uPKyGldjZwWptQWPkC2wgZ0yW5cCx9ePuVoJjVxyJlrsV1BRT5&#13;
MORECOOKIE_GOODIES = N98R4398R7Y3BF78645389M4D4M37645D348RSJM3645SDN83TY74SWM457R35MYRS3M4875UR3,S4MR34MYRS834JRYMS3784R3487R3M4RM378R34RM,3&#13;
MORECOOKIE_GOODIESB = 894FH34897RFH32948FJ3489RFH3478FGH3289RH234F68Y3GH7948RFH3DFC8734HRF938FH39408RJ394FHJ349FH34&#13;
< / div>
< / td>
< / tr>
< / table>
< / body>
< / html>

编辑:



CSS



  .lightstylediv {
color:#000;
font-weight:bold;
}
.lightstyle {
vertical-align:text-top;
背景:#b3b3b3;
}

darkstyle 是相同的东西,只是不同的颜色。



如果你删除包含< div> aaaThe或的div中的所有内容它的工作正常。



& amp; amp& amp; quot; 正在显示为&而不是,我该如何解决?



&#13 ; 只是回车,所以不应该影响不好。



字符串很长,但它们可能是打破原因的原因表 width

解决方案

这很简单,




  • 您需要设置 table-layout:fixed to table

  • 您正在向错误的 td break-word c>

  • 避免使用内联样式

  • 我想猜,认为你是在 vertical-align:top 而不是 text-顶部



片段



  table {table-layout:fixed; width:100%}。darkstyle {color:#000; font-weight:700;宽度:15%; vertical-align:top;}。lightstyle {background:#b3b3b3;宽度:85%; word-wrap:break-word}  

 < table> < TR> < td class =darkstyle> URI< / td> < td class =lightstyle> someurl< / td> < / TR> < TR> < td class =darkstyle>置信度< / td> < td class =lightstyle>低< / td> < / TR> < TR> < td class =darkstyle>攻击< / td> < td class =lightstyle>从app.foo.bar这样的子域设置的Cookie仅由浏​​览器传输到该域。但是,范围到父级域的cookie可能会发送到父级或父级的任何子域。< / td> < / TR> < TR> < td class =darkstyle> OtherInfo< / td> < td class =lightstyle>用于比较的起始域是:&#13; myurl.ca&安培;#13; DERPCOOKIE =&放大器;放大器; QUOT;&放大器;放大器; QUOT;&安培;#13; COOKIE3 = ASDASD-97867867848-uPKyGldjZwWptQWPkC2wgZ0yW5cCx9ePuVoJjVxyJlrsV1BRT5&安培;#13; MORECOOKIE_GOODIES = N98R4398R7Y3BF78645389M4D4M37645D348RSJM3645SDN83TY74SWM457R35MYRS3M4875UR3,S4MR34MYRS834JRYMS3784R3487R3M4RM378R34RM,3及#13; MORECOOKIE_GOODIESB = 894FH34897RFH32948FJ3489RFH3478FGH3289RH234F68Y3GH7948RFH3DFC8734HRF938FH39408RJ394FHJ349FH34&安培;#13; < / TD> < / tr>< / table>  


I need to clarify: I've been stuck on this for an hour now because I'm not sure what the issue is. I pasted a full example which breaks on jsbin.com as well.

JSBIN LINK

Code

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>JS Bin</title>
</head>
<body>
    <table width="100%">
        <tr>
            <td class="darkstyle" style="width: 15%;">
                <div>URI</div>
            </td>
            <td class="lightstyle" style="width: 85%;">someurl</td>
        </tr>
        <tr>
            <td class="darkstyle" style="width: 15%;">
                <div>Confidence</div>
            </td>
            <td class="lightstyle" style="width: 85%;">Low</td>
        </tr>
        <tr>
            <td class="darkstyle" style="width: 15%;">
                <div>Attack</div>
            </td>
            <td class="lightstyle" style="width: 85%;">Cookies set from a subdomain like app.foo.bar are transmitted only to that domain by the browser. However, cookies scoped to a parent-level domain may be transmitted to the parent, or any subdomain of the parent.</td>
        </tr>
        <tr>
            <td class="darkstyle" style="width: 15%; word-wrap: break-word;">
                <div>OtherInfo</div>
            </td>
            <td class="lightstyle" style="width: 85%;">
                <div>aaaThe origin domain used for comparison was: &#13;
myurl.ca&#13;
DERPCOOKIE=&amp;quot;&amp;quot;&#13;
COOKIE3=ASDASD-97867867848-uPKyGldjZwWptQWPkC2wgZ0yW5cCx9ePuVoJjVxyJlrsV1BRT5&#13;
MORECOOKIE_GOODIES=N98R4398R7Y3BF78645389M4D4M37645D348RSJM3645SDN83TY74SWM457R35MYRS3M4875UR3,S4MR34MYRS834JRYMS3784R3487R3M4RM378R34RM,3&#13;
MORECOOKIE_GOODIESB=894FH34897RFH32948FJ3489RFH3478FGH3289RH234F68Y3GH7948RFH3DFC8734HRF938FH39408RJ394FHJ349FH34&#13;
                </div>
            </td>
        </tr>
    </table>
</body>
</html>

EDIT :

CSS

.lightstylediv{
  color: #000;
  font-weight: bold;
}
.lightstyle{
  vertical-align: text-top; 
  background:#b3b3b3;
}

darkstyle is the same thing, just different color.

If you remove everything in the div containing <div>aaaThe or Then it works fine.

The &amp;quot;&amp;quot; is being displayed as &quot instead of ", how do I fix this?

&#13; is just carriage return so shouldn't affect it poorly.

The strings are very long however and they could be the reason it's breaking the table width?

解决方案

This is quite simple,

  • you need to set table-layout:fixed to table
  • you were applying break-word on the wrong td
  • avoid using inline styles
  • I'm gonna guess and think you are after vertical-align:top instead of text-top

Snippet

table {
  table-layout: fixed;
  width: 100%
}
.darkstyle {
  color: #000;
  font-weight: 700;
  width: 15%;
  vertical-align: top;
}
.lightstyle {
  background: #b3b3b3;
  width: 85%;
  word-wrap: break-word
}

<table>
  <tr>
    <td class="darkstyle">
      URI
    </td>
    <td class="lightstyle">someurl</td>
  </tr>
  <tr>
    <td class="darkstyle">
      Confidence
    </td>
    <td class="lightstyle">Low</td>
  </tr>
  <tr>
    <td class="darkstyle">
      Attack
    </td>
    <td class="lightstyle">Cookies set from a subdomain like app.foo.bar are transmitted only to that domain by the browser. However, cookies scoped to a parent-level domain may be transmitted to the parent, or any subdomain of the parent.</td>
  </tr>
  <tr>
    <td class="darkstyle">
      OtherInfo
    </td>
    <td class="lightstyle">
      The origin domain used for comparison was: &#13; myurl.ca&#13; DERPCOOKIE=&amp;quot;&amp;quot;&#13; COOKIE3=ASDASD-97867867848-uPKyGldjZwWptQWPkC2wgZ0yW5cCx9ePuVoJjVxyJlrsV1BRT5&#13; MORECOOKIE_GOODIES=N98R4398R7Y3BF78645389M4D4M37645D348RSJM3645SDN83TY74SWM457R35MYRS3M4875UR3,S4MR34MYRS834JRYMS3784R3487R3M4RM378R34RM,3&#13;
      MORECOOKIE_GOODIESB=894FH34897RFH32948FJ3489RFH3478FGH3289RH234F68Y3GH7948RFH3DFC8734HRF938FH39408RJ394FHJ349FH34&#13;
    </td>
  </tr>
</table>

这篇关于CSS不是被提供的,也许是因为角色没有被逃脱?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆