用CSS实现java C#等程序关键字加亮的效果。
<head>
<link href=https://blog.csdn.net/weixin_45822171/article/details/"prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src=https://blog.csdn.net/weixin_45822171/article/details/"prettify.js"></script>
<title>Web.java</title>
</head>
<body onload="prettyPrint()">
<pre class="prettyprint">
package org.lc.util;
import java.io.IOException;
public class Web {
public static void main(String args[]){
System.out.println(getAddrByIP("127.0.0.1"));
}
public static String getAddrByIP(String ip) throws IOException{
java.net.URL server;
String str="";
server=new java.net.URL("http://www.ip.cn/getip.php?action=queryip&ip_url="+ip);
java.net.URLConnection con=server.openConnection();
java.io.InputStream in=con.getInputStream();