小编CTU*_*ago的帖子

基于设备正确设置图像大小的最佳方法

作为今天的设计师,我今天生活中最大的障碍之一就是将图像放在适合所有设备上所有浏览器的网页上.只是为了适应一个图像我试图创建一个像下面的代码,并按高度检查,并确保图像适合和图像在屏幕的中间.我想要的是在屏幕中间放置一个600x894的图像,无论设备和浏览器如何.如果屏幕尺寸较小,那么图像也应该更小.什么是最好的方法呢?

img {position:absolute;left:50%;top:50%;display:block;}
@media only screen and (max-height : 600px)  {img{width: 389px;height: 580px;margin-left: -194px;margin-top: -290px}}
@media only screen and (max-height : 700px)  {img{width: 456px;height: 680px;margin-left: -228px;margin-top: -340px}}
@media only screen and (max-height : 800px)  {img{width: 524px;height: 780px;margin-left: -262px;margin-top: -390px}}
@media only screen and (max-height : 900px)  {img{width: 591px;height: 880px;margin-left: -295px;margin-top: -440px}}
Run Code Online (Sandbox Code Playgroud)

html css html5

7
推荐指数
1
解决办法
326
查看次数

Java Double无法解除引用

我需要乘以radius*radius*pi找到圆的确切区域,但我写下的代码不起作用.它是不断给予双重不能被解除引用的错误...

错误

 ----jGRASP exec: javac -g Circle.java
Circle.java:7: error: double cannot be dereferenced
      BigDecimal area = radius.multiply(pi);
                              ^
1 error
Run Code Online (Sandbox Code Playgroud)

import java.math.*;
public class Circle {
   public BigDecimal findArea(double radius){
      double pi = 3.14159;
      radius = radius * radius;
      BigDecimal bd = new BigDecimal("1");
      BigDecimal area = pi.multiply(radius);
      return area;
   }
}
Run Code Online (Sandbox Code Playgroud)

java bigdecimal

-3
推荐指数
1
解决办法
235
查看次数

标签 统计

bigdecimal ×1

css ×1

html ×1

html5 ×1

java ×1