为什么在网页中添加语法高亮后滚动条不工作
Why scroll bar is not working after adding syntax highlighter in webpage?
我在我的网页中应用了语法高亮,但是当我最小化窗口或在不同的屏幕上检查它时,文本就出来了。
我已经尝试了很多,但问题仍然发生。我已经使用了语法高亮笔形式的rawgit。
还有其他选择吗?
<!DOCTYPE HTML>
<html lang="en">
<head>
<link rel="stylesheet" href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css"/>
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
</head>
<body>
<pre class="prettyprint"><code>
package com.up;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.glassfish.jersey.media.multipart.FormDataParam;
@Path("/files")
public class FileUploadService {
@POST
@Path("/upload")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response uploadFile(
@FormDataParam("file") InputStream uploadedInputStream,
@FormDataParam("file") FormDataContentDisposition fileDetail
) {
String fileLocation = "F://" + fileDetail.getFileName();
try {
FileOutputStream out = new FileOutputStream(new File(fileLocation));
int read = 0;
byte[] bytes = new byte[1024];
out = new FileOutputStream(new File(fileLocation));
while ((read = uploadedInputStream.read(bytes)) != -1) {
out.write(bytes, 0, read);
}
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
String output = "File successfully uploaded to : " + fileLocation;
return Response.status(200).entity(output).build();
}
} </code></pre>
</body>
</html>
为您的prettyprint添加溢出滚动
.prettyprint {
overflow:scroll;
}
相关文章:
- 可以'无法使滚动条正常工作
- 如何隐藏滚动条,但希望它继续工作
- jquery ui选择菜单滚动条不工作
- 动态添加/创建的移动滚动条无法正常工作
- Facebook滚动条如何工作
- 使微小的滚动条与不断变化的动画内容一起工作
- AJAX加载内容后滚动条不工作
- 隐藏滚动条以保持其工作状态(具体情况)
- jquery滚动条工作不正常
- Javascript;CSS:隐藏滚动条,保持滚动事件工作
- 高库存滚动条没有'不能在svg foreignObject中工作
- iframe内的滚动条不工作-zindex问题
- jquery scrollTop工作,但不移动滚动条
- 为什么在网页中添加语法高亮后滚动条不工作
- jQuery自定义滚动条不工作
- Javascript库SLY -滚动条不工作
- Javascript检测滚动条不工作
- 马利胡自定义滚动条-滚动到id插件不工作的页面
- 为什么不是't表格'的正文滚动条在InternetExplorer11上工作
- 启用浏览器滚动条工作