0
내가 여기 약간의 파일 는 higlightjs가
<!DOCTYPE html>
<html>
<head>
<title>highlightjs</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/darcula.min.css">
</head>
<body>
<pre>
<code class="php">
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use DB;
use Session;
class ProductController extends Controller
{
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$posts = DB::table("posts")->get();
return view('posts',compact('posts'));
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
DB::table("posts")->delete($id);
Session::put('success', 'Your Record Deleted Successfully.');
return redirect()->route('posts');
}
}
</code>
</pre>
<pre>
<code class="xml hljs">
<body>
<p class="title" id='title'>Title</p>
<h2>Why is this HTML code not highlighted?</h2>
<p>Teeeeest</p>
</body>
</code>
</pre>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>
을 한 내가 본 웹 사이트처럼 HTML 코드를 강조하기 위해 노력하고 HTML 코드를 강조 가져올 수 없습니다
그리고 작동하지 않습니다. 그는 아마 내가하지 않은 무언가를하고있다. 근데 뭐?? PHP가 올바르게 강조 표시되었습니다. HTML 코드를 강조 표시하는 방법은 무엇입니까?
각 태그마다이 작업을 수행해야합니까? – lewis4u
예, 그렇지 않으면 코드 태그 사이에 html 코드가 브라우저에서 렌더링됩니다. – esra
나는 당신의 대답에 감사드립니다. – lewis4u