如何在响应式屏幕响应特定显示时使SVG图像具有特定大小?

时间:2017-05-19 18:16:21

标签: javascript css svg responsive

我不知道是否需要使用javascript,但不知道如何在屏幕点击特定显示器时将SVG图像设为特定大小(例如, 640×480像素)?

我的SVG图像已经响应,但我希望它在移动显示屏中看起来更小。

谢谢!

2 个答案:

答案 0 :(得分:0)

你可以在你的CSS中有一个部分:

Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000024: Not able to find EJB matching "StatelessEJBLocator for "/EjbComponent/LibrarySessionBean", view is interface com.tutorialspoint.stateless.LibrarySessionBeanRemote, affinity is None"
    at org.jboss.ejb.client.EJBClientContext.discoverAffinityNone(EJBClientContext.java:716)
    at org.jboss.ejb.client.EJBClientContext.performLocatedAction(EJBClientContext.java:698)
    at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146)
    at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:96)
    at com.sun.proxy.$Proxy0.addBook(Unknown Source)
    at com.tutorialspoint.test.EJBTester.main(EJBTester.java:37)
    Suppressed: java.io.IOException: JBREM000202: Abrupt close on Remoting connection 32e5e0c7 to localhost/127.0.0.1:8080 of endpoint (anonymous) <72a094c>
        at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:173)
        at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:162)
        at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
        at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
        at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
        at org.xnio.nio.WorkerThread.run(WorkerThread.java:567)
        at ...asynchronous invocation...(Unknown Source)
        at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:465)
        at org.jboss.remoting3.FutureConnection.getConnection(FutureConnection.java:117)

答案 1 :(得分:0)

标记     

  <svg 
    width="120" 
    height="120" 
    viewBox="0 0 120 120"
    xmlns="http://www.w3.org/2000/svg">
    <rect x="10" y="10" width="1000" height="1000"/>
  </svg>

</div>


样式

svg { /* make it generally responsive */
  display: block;
  width: 100%;
  height: 100%;
}

.box {
  max-width: 300px;
}

@media (min-width: 600px) { /* when 600px and bigger */
  .box {
    max-width: 200px;
  }
}

https://jsfiddle.net/sheriffderek/z9fw1ndr/