如何使用Bootstrap正确显示UTF-8? [英] How to display UTF-8 correctly with Bootstrap?
问题描述
这是错误的:
我的源代码:
<!DOCTYPE html>
< html>
< head>
< title>ThịnhVượng< / title>
< meta content-type =text / html; charset = utf-8>
< meta name =viewportcontent =width = device-width,initial-scale = 1>
< link rel =stylesheettype =text / csshref =bootstrap / css / bootstrap.min.css>
< script type =text / javascriptsrc =jquery / jquery-1.11.3.min.js>< / script>
< script type =text / javascriptsrc =bootstrap / js / bootstrap.min.js>< / script>
< / head>
< body>
< nav class =navbar navbar-inverse>
< div class =container-fluid>
< div class =navbar-header>
< a class =navbar-brandhref =#>ThịnhVượng< / a>
< / div>
< div>
< ul class =nav navbar-nav>
< li class =active>< a href =#> Trangchủ< / a>< / li>
< li class =dropdown>< a class =dropdown-toggledata-toggle =dropdownhref =#> Trangchủ< span class =caret >< /跨度>< / A>
< ul class =dropdown-menu>
< li>< a href =#>Thiếtkế< / a>< / li>
< li>< a href =#> Thicông< / a>< / li>
< li>< a href =#>Sửachữa< / a>< / li>
< li>< a href =#>Điệnnước - Điềuhòa< / a>< / li>
< li>< a href =#>Tưvấnphongthủy< / a>< / li>
< li>< a href =#> Tintức< / a>< / li>
< li>< a href =#>Liênhệ< / a>< / li>
< / ul>
< / li>
< li>< a href =#> Page 2< / a>< / li>
< li>< a href =#>第3页< / a>< / li>
< / ul>
< / div>
< / div>
< / nav>
< div class =container>
< div class =jumbotron>
< h1>我的第一个Bootstrap网站!< / h1>
< p>随着我们从Bootstrap添加越来越多的组件,此页面将会增长...< / p>
< a href =#class =btn btn-info btn-lg>< span class =glyphicon glyphicon-search>< / span>搜索和LT; / A>
< / div>
< div class =row>
< div class =col-md-3>
Lorem ipsum dolor sit amet,consectetur adipisicing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua。< / p>
< / div>
< div class =col-md-3>
< p>您可以使用最小化静脉注射的方式,使用ullamco laboris nisi ut aliquip ex ea commodo consequat。< / p>
< / div>
< div class =col-md-3>
< p>如果您有任何疑问,请联系我们,我们会尽快回复您。
< / div>
< div class =col-md-3>
< ul class =nav nav-pills nav-stacked>
< li class =active>< a href =#>主页< / a>< / li>
< li class =dropdown>
< a class =dropdown-toggledata-toggle =dropdownhref =#>菜单1< span class =caret>< / span>< / a>
< ul class =dropdown-menu>
< li>< a href =#>子菜单1-1< / a>< / li>
< li>< a href =#>子菜单1-2< / a>< / li>
< li>< a href =#>子菜单1-3< / a>< / li>
< / ul>
< / li>
< li>< a href =#>菜单2< / a>< / li>
< li>< a href =#>菜单3< / a>< / li>
< / ul>
< / div>
< div class =clearfix visible-lg>< / div>
< / div>
< / div>
< / body>
< / html>
使用HTML5方法
< meta charset =UTF-8>
另外,确保您在中使用的文本编辑器将文件以UTF格式保存-8 格式。
This is error:
my source code:
<!DOCTYPE html>
<html>
<head>
<title>Thịnh Vượng</title>
<meta content-type="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
<script type="text/javascript" src="jquery/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Thịnh Vượng</a>
</div>
<div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Trang chủ</a></li>
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">Trang chủ<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Thiết kế</a></li>
<li><a href="#">Thi công</a></li>
<li><a href="#">Sửa chữa</a></li>
<li><a href="#">Điện nước - Điều hòa</a></li>
<li><a href="#">Tư vấn phong thủy</a></li>
<li><a href="#">Tin tức</a></li>
<li><a href="#">Liên hệ</a></li>
</ul>
</li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="jumbotron">
<h1>My first Bootstrap website!</h1>
<p>This page will grow as we add more and more components from Bootstrap...</p>
<a href="#" class="btn btn-info btn-lg"><span class="glyphicon glyphicon-search"></span> Search</a>
</div>
<div class="row">
<div class="col-md-3">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div class="col-md-3">
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div class="col-md-3">
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.</p>
</div>
<div class="col-md-3">
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Menu 1 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Submenu 1-1</a></li>
<li><a href="#">Submenu 1-2</a></li>
<li><a href="#">Submenu 1-3</a></li>
</ul>
</li>
<li><a href="#">Menu 2</a></li>
<li><a href="#">Menu 3</a></li>
</ul>
</div>
<div class="clearfix visible-lg"></div>
</div>
</div>
</body>
</html>
Use the HTML5 approach
<meta charset="UTF-8">
Also, make sure that the text editor you're working in saves the file in UTF-8 format.
这篇关于如何使用Bootstrap正确显示UTF-8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!