相关疑难解决方法(0)

如何将<div>与页面的中间(水平/宽度)对齐

我有一个设置为800pxdiv标签.当浏览器宽度大于800px时,它不应该拉伸,但它应该将它带到页面的中间.widthdiv

html css center alignment

805
推荐指数
20
解决办法
244万
查看次数

CSS:transform:translate(-50%, - 50%)使文本模糊

我想把我的中心div和我使用这种方法,但它使我的文本div模糊:

<!-- language: lang-css -->

#div {
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}
Run Code Online (Sandbox Code Playgroud)

有没有办法让我的中心div

css text transform blurry css3

77
推荐指数
1
解决办法
5万
查看次数

WebKit:带有css scale + translate3d的模糊文本

我发现Chrome和其他WebKit浏览器大量模糊任何已应用translate3d的css缩放内容的问题.

这是一个JS小提琴:http://jsfiddle.net/5f6Wg/.(在Chrome中查看.)

.test {
  -webkit-transform: translate3d(0px, 100px, 0px);
}

.testInner
{
  /*-webkit-transform: scale(1.2);*/
  -webkit-transform: scale3d(1.2, 1.2, 1);
  text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
<div class="test">
  <div class="testInner">
    This is blurry in Chrome/WebKit when translate3d and scale or scale3d are applied.
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

有没有任何已知的解决方法?我在上面的简单示例中得到了这个,我可以简单地使用translate而不是translate3d - 这里的重点是将代码剥离到最基本的要素.

webkit blurry scale css3 translate3d

56
推荐指数
4
解决办法
9万
查看次数

CSS3过渡搞乱了webkit中的字体?

自从我添加了一个css过渡(第一个是悬停,第二个是动画)它似乎搞砸了我的字体,它们看起来"不同".

这是完全奇怪的,我已经找了好几个小时,找不到任何东西,我也无法弄清楚它为什么会发生.

在firefox中似乎没问题,但是safari和chrome有问题.

http://www.simplerweb.co.uk

左下方齿轮动画下方的所有内容看起来都像一个较轻的字体重量,导航菜单看起来看起来一样.

我完全迷失在这一个.

这是动画的CSS.

.gearone {height:100px;
width:100px;
top:-10px;
left:-10px;
position:absolute;
background-position:center;
background-repeat:no-repeat;
background-image:url(../images/gearone.png);
 -webkit-animation-name:             backrotate; 
    -webkit-animation-duration:        13s; 
    -webkit-animation-iteration-count:  infinite;
    -webkit-transition-timing-function:linear;


-moz-animation-name: backrotate;
     -moz-animation-duration: 13s;
      -moz-animation-timing-function: linear;
    -moz-animation-iteration-count: infinite;
}

.geartwo {height:100px;
width:100px;
position:absolute;
background-position:center;
background-repeat:no-repeat;
background-image:url(../images/gearone.png);
top:20px;
left:10px;

 -webkit-animation-name:             rotate; 
    -webkit-animation-duration:         13s; 
    -webkit-animation-iteration-count:  infinite;
    -webkit-transition-timing-function:linear;


    -moz-animation-name: rotate;
     -moz-animation-duration: 13s;
      -moz-animation-timing-function:linear;
    -moz-animation-iteration-count: infinite;

}


@-webkit-keyframes rotate {
  from {
    -webkit-transform: rotate(0deg);

  }
  to { 
    -webkit-transform: rotate(360deg);

  }
}

@-moz-keyframes rotate {
from {

    -moz-transform: rotate(0deg);
  }
  to { …
Run Code Online (Sandbox Code Playgroud)

html css css3 css-transitions css-animations

12
推荐指数
3
解决办法
1万
查看次数

Chrome动画会使文字变得模糊

一切都在Firefox上运行良好,但chrome显示动画文本模糊.我做了所有的事情-webkit-font-smoothing: subpixel-antialiased;,-webkit-transform: translate3d(0,0,0);以及之前提到的一切:

基于Webkit的模糊/失真文本后期动画通过translate3d

但问题仍然存在.

我做了一个非常简单的例子来向你展示它的样子.我该如何解决这个问题?

var text = 1;

function next() {

  var next = (text == 2) ? 1 : 2;
  document.getElementById('text' + text).className = 'out';
  document.getElementById('text' + next).className = 'in';
  text = next;
}
Run Code Online (Sandbox Code Playgroud)
body {
  padding: 0;
  margin: 0;
  font-family: tahoma;
  font-size: 8pt;
  color: black;
}
div {
  height: 30px;
  width: 100%;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}
div div {
  opacity: 0;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0; …
Run Code Online (Sandbox Code Playgroud)

html css google-chrome

12
推荐指数
2
解决办法
3600
查看次数

使用变换(-50%, - 50%)使部分居中时,文字会变得模糊

我使用此代码将一个部分居中:(这是我可以做的唯一方法,以此部分为中心)

<div class="clock-section">
          <h5 id="clock-title">We are coming really soon</h5>
                <hr class="hr" id="cdhr">
              </div>
Run Code Online (Sandbox Code Playgroud)

CSS:

.clock-section {
    position:absolute;
    top:50%;
    left:50%;
     transform:translate(-50%, -50%);
}
Run Code Online (Sandbox Code Playgroud)

该部分很好地集中,但问题是文本变得模糊,而且hr看起来很丑陋和模糊,
我已经尝试了所有方法,如webfont平滑等,但根本不起作用!:(
任何人都可以帮助我吗?
谢谢......

html css transform blur

5
推荐指数
1
解决办法
647
查看次数

变换时文本模糊:平移,并且它与带动画的另一个元素相邻

在下面的示例中,包含一些文本的DIV(示例A)在transform: translate应用CSS 时会略微模糊.

而在文本示例B中,字体是尖锐的.

该问题仅在Google Chrome上发生,并且可在FireFox 46.0.1上正常运行.我能够重现它:

  • 谷歌浏览器版本51.0.2704.84米
  • 谷歌浏览器版本53.0.2768.0金丝雀(64位)

实例:

http://jsbin.com/calidefune/edit?html,output

我想知道,如果我的代码出现问题,或者是Chrome中的错误.

也有任何想法如何解决它是值得欢迎的,考虑到我想transform: translate尽可能保持,我主要针对最新的Chrome和FireFox.

到目前为止我注意到的事项:

  • 在不同的字体大小下,不同级别会出现模糊效果.
  • 使用webkit-font-smoothing : none;没有帮助.
  • 任何字体(系统默认或自定义)都会出现问题.
  • 我正在使用Window 8.1.

#test {
  position: fixed;
  font-size: 20px;
  top: 60%;
  left: 40%;
}

#splashScreen__spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -90px);
  width: 50px;
  height: 50px;
}

#splashScreen__infos {
  position: fixed;
  font-size: 20px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-font-smoothing: none;
}

.loadingSpinner {
  width: inherit;
  height: inherit;
  border: 5px solid …
Run Code Online (Sandbox Code Playgroud)

html css google-chrome css3

5
推荐指数
1
解决办法
2059
查看次数