Table of Contents
Reply to the discussion (solution)
Home Web Front-end HTML Tutorial Please help: After defining the font with css, all Chinese characters in the navigation bar and 'heading' cannot be displayed_html/css_WEB-ITnose

Please help: After defining the font with css, all Chinese characters in the navigation bar and 'heading' cannot be displayed_html/css_WEB-ITnose

Jun 24, 2016 pm 12:21 PM

css html

Looking for a solution: After defining the font with css, only English can be displayed in the navigation bar and

;

, if it is changed to Chinese, nothing will be displayed (the output is empty). Chinese can be displayed normally in other places on the webpage.

Some html related codes are as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta charset="UTF-8"></head><body><div id="bg_top">  <div id="wrapper">    <div id="header">      <div id="logo"><a href="./index.html"><img src="./images/logo.png" width="300" height="92" border="0" alt="Logo" /></a></div>      <div id="header_photos">      	<div class="two"></div>      	<span class="three"><img src="./images/header-flower3.png" alt="3" width="118" height="121" /></span>        <div class="one"><img src="./images/header-flower1.png" alt="1" width="118" height="121" /></div>      </div>      <!--end header photos-->      <div id="menu">        <ul id="navigation">          <li><a href="./index.html" class="active">Home</a></li>          <li><a href="./categories.html">Categories</a></li>          <li><a href="./contact.html" style="border:none;">Contact</a></li>        </ul>        <!--end navigation-->      </div>      <!--end menu-->    </div>    <!--end header-->    <div id="content_bg">      <div id="sidebar">        <!-- start menu -->         <div id="menu_string"><img src="./images/tag-string.png" width="178" height="22" alt="string" /></div>        <div id="menu_wrapper">          <div id="menu_header">            <div id="menu_footer">              <h3>shop</h3>              <ul>                <li><a href="">New Arrivals</a></li>                <li><a href="">On Sale</a></li>                <li><a href="./categoriea.html">For Newborn (Birth+)</a></li>                <li><a href="./categorieb.html">For Infant (6 Months+)</a></li>                <li><a href="./categoriec.html"For >Toddler (12Months +)</a></li>              </ul>              <br class="clear" />            </div>          </div>        </div>        <!-- end menu -->......      <div class="clear"></div>    </div>    <!--end content bg-->......  </div>  <!--end wrapper--></div><!--end bg_top--><script type="text/javascript"> Cufon.now(); </script></body></html>
Copy after login



Part of the css related code is as follows:
@charset "utf-8";/* CSS Document *//*Template Layout*/body {	background-color:#eeebda;	background-image:url(../images/page-bg.jpg);	background-position:top;	background-repeat:repeat;	margin:0px;	padding:0px;	color:#6f5b40;	font-family:Arial, Helvetica, sans-serif, "微软雅黑";	font-size:13px;	line-height:1.5em; 	text-align:center; }a, a:link, a:visited {	color:#675237;	outline: none; }a:hover {	color:#af9d87;	text-decoration:none;}#bg_top { 	background:url(../images/header.png) center top no-repeat;	min-height: 100%; 	text-align:left;	width:100%;	margin-top:80px;}#wrapper {	width:972px;	margin:0px auto;}#header {	height:222px;	width:972px;	margin:0px auto;}/*menu*/#menu { 	height:30px;	padding:16px 0 6px 0;	clear:both;}ul#navigation {	margin:0px 0 0 30px; 	padding:0px;	float:left;	z-index:100; 	width:760px;}ul#navigation li {	float:left;	list-style:none;	display:inline;	padding:0px;	margin:0px;}ul#navigation a {	float:left; 	color:#675237; 	padding:0px 13px 20px 13px; 	text-decoration:none; 	font:24px arial, serif, "微软雅黑";	text-transform:lowercase;	letter-spacing:1px; }ul#navigation li.hover a, ul#navigation li:hover a, ul#navigation a.active, ul#navigation a:hover {	color:#8d7e6b; }/* General Content*/h1 {	color:#af9d87;	font-size:30px;	margin:0px;	padding:0px;}h2 {	color:#675237;	font-size:20px;}h3 {	color:#675237;	font-size:18px;}/*side menu tag*/#sidebar {	margin-left:29px;	float:left;}#menu_string {	width:178px;	height:22px;	margin:-20px 0 0 0;	z-index:101; /*makes dropdown sit on top of flash & map*/}#menu_wrapper {	width:178px;	background:url(../images/tag-tile.jpg) repeat-y;	margin:0 0 18px 0;}#menu_header {	width:178px;	background:url(../images/tag-top.jpg) no-repeat top;}#menu_footer {	width:178px;	background:url(../images/tag-bottom.jpg) no-repeat bottom;	min-height:265px;	padding-bottom:40px;}#menu_wrapper h3 {	text-align:center;	margin:0;	padding:20px 0 0 0;	color:#ded6c5;	font-size:24px;}#menu_wrapper ul {	width:178px;	padding:5px 0 0 0;	margin:0;	list-style:none;	color:#846324;	font-size:13px;	font-family:Arial, Helvetica, sans-serif, "微软雅黑";	text-align:center;}#menu_wrapper ul li {	margin:0;	padding:0;	list-style:none;	float:left;	clear:left;}#menu_wrapper ul li a {	display:block;	float:left;	clear:left;	padding:4px;	text-decoration:none;	width:170px;/*178*/	text-align:center;	color:#846324;	line-height:normal;}#menu_wrapper ul li a:hover {	text-decoration:underline;}......
Copy after login


Reply to the discussion (solution)

The coding is under control and nothing should happen. Question, I also copied the code and ran it locally, and it can be displayed.

The encoding is under control, so there should be no problems. I also copied the code and ran it locally, and it can be displayed.


Chinese characters cannot be displayed


The encoding is under control, so there should be no problems. I also copied the code and ran it locally, and it can be displayed. .


The Chinese language cannot be displayed

Both Chinese and English are normal. Please try another browser.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

What is the viewport meta tag? Why is it important for responsive design? What is the viewport meta tag? Why is it important for responsive design? Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

The article discusses the &lt;iframe&gt; tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

See all articles