Google Chrome HTML 网页中的文字未加粗
Google Chrome not bolding words in HTML webpage
所以我使用的是 Dreamweaver,DW 编辑器上出现了粗体字,但是当我在 Chrome 中打开网页时,我没有看到粗体字。哦,有趣的是,Safari 和 Firefox 似乎显示粗体字,而 Chrome 则不能。这让我相信这是一个仅 Chrome 的问题。我的 Chrome 浏览器怎么了?
下面是一段使用粗体文本的代码:
<strong><br>
<h4>Membership</h4>
</strong>
<p dir="ltr"><strong>Eligibility:</strong> All users must be <strong>18</strong> years of age or older and be eligible to legally work in the U.S.</p>
<p dir="ltr"><strong>Account:</strong> All information provided in your account must be accurate in order to achieve the best results from using our service. We are not liable for consequences that may result from fraudulent misrepresentation. </p>
<p dir="ltr"><strong>Profile:</strong> Profile pictures must be appropriate for the professional atmosphere and clearly contain the person representing the corresponding profile only. Failure to comply will result in suspension of membership. </p>
<strong> <br>
这就是设置 HTML 样式的原因:
<head>
<!-- This needs to be on every HTML page -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>ProConnect</title>
<link rel="icon" type="image/png" sizes="96x96" href="img/favicon-96x96.png">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/legal.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<meta http-equiv="refresh" content="" >
<link type="text/css" rel="stylesheet" href="css/legal.css"/>
</head>
CSS:
.container{
margin-right: auto;
margin-left: auto;
}
p{
text-align: justify;
}
你可以用这个简单的方法把字加粗
使用 <b>
标签将单词加粗
只需添加 <strong>
标记,您的单词不会加粗 您也必须向其中添加此 css 规则 font-weight: bold;
只有这样它才会起作用
<b>bold word</b> normal text
<b><br>
<h4>Membership</h4>
</b>
<p dir="ltr"><b>Eligibility:</b> All users must be <b>18</b> years of age or older and be eligible to legally work in the U.S.</p>
<p dir="ltr"><b>Account:</b> All information provided in your account must be accurate in order to achieve the best results from using our service. We are not liable for consequences that may result from fraudulent misrepresentation. </p>
<p dir="ltr"><b>Profile:</b> Profile pictures must be appropriate for the professional atmosphere and clearly contain the person representing the corresponding profile only. Failure to comply will result in suspension of membership. </p>
<b> <br>
我用这个方法在我的网站加粗
无论何时导入自定义字体,请确保包含您需要的所有粗细和样式。正常字体粗细通常为 400,粗体通常为 700。下面的样式 sheet 几乎包含了 Roboto 字体所需的所有内容。
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
您想将 <b></b>
标签添加到您的 HTML 文件而不是 strong 或者您可以通过 CSS 来完成,也像这样:
strong {
font-weight: strong;
}
您也可以保持文本正常,只添加一些颜色使其看起来更吸引人或更引人注目:
strong {
color: red;
}
记住我用过的一件事 CSS 包括强标签,因为你在 <strong></strong>
标签中保留了你想要修饰的词。
所以我使用的是 Dreamweaver,DW 编辑器上出现了粗体字,但是当我在 Chrome 中打开网页时,我没有看到粗体字。哦,有趣的是,Safari 和 Firefox 似乎显示粗体字,而 Chrome 则不能。这让我相信这是一个仅 Chrome 的问题。我的 Chrome 浏览器怎么了?
下面是一段使用粗体文本的代码:
<strong><br>
<h4>Membership</h4>
</strong>
<p dir="ltr"><strong>Eligibility:</strong> All users must be <strong>18</strong> years of age or older and be eligible to legally work in the U.S.</p>
<p dir="ltr"><strong>Account:</strong> All information provided in your account must be accurate in order to achieve the best results from using our service. We are not liable for consequences that may result from fraudulent misrepresentation. </p>
<p dir="ltr"><strong>Profile:</strong> Profile pictures must be appropriate for the professional atmosphere and clearly contain the person representing the corresponding profile only. Failure to comply will result in suspension of membership. </p>
<strong> <br>
这就是设置 HTML 样式的原因:
<head>
<!-- This needs to be on every HTML page -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>ProConnect</title>
<link rel="icon" type="image/png" sizes="96x96" href="img/favicon-96x96.png">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/legal.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<meta http-equiv="refresh" content="" >
<link type="text/css" rel="stylesheet" href="css/legal.css"/>
</head>
CSS:
.container{
margin-right: auto;
margin-left: auto;
}
p{
text-align: justify;
}
你可以用这个简单的方法把字加粗
使用 <b>
标签将单词加粗
只需添加 <strong>
标记,您的单词不会加粗 您也必须向其中添加此 css 规则 font-weight: bold;
只有这样它才会起作用
<b>bold word</b> normal text
<b><br>
<h4>Membership</h4>
</b>
<p dir="ltr"><b>Eligibility:</b> All users must be <b>18</b> years of age or older and be eligible to legally work in the U.S.</p>
<p dir="ltr"><b>Account:</b> All information provided in your account must be accurate in order to achieve the best results from using our service. We are not liable for consequences that may result from fraudulent misrepresentation. </p>
<p dir="ltr"><b>Profile:</b> Profile pictures must be appropriate for the professional atmosphere and clearly contain the person representing the corresponding profile only. Failure to comply will result in suspension of membership. </p>
<b> <br>
我用这个方法在我的网站加粗
无论何时导入自定义字体,请确保包含您需要的所有粗细和样式。正常字体粗细通常为 400,粗体通常为 700。下面的样式 sheet 几乎包含了 Roboto 字体所需的所有内容。
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
您想将 <b></b>
标签添加到您的 HTML 文件而不是 strong 或者您可以通过 CSS 来完成,也像这样:
strong {
font-weight: strong;
}
您也可以保持文本正常,只添加一些颜色使其看起来更吸引人或更引人注目:
strong {
color: red;
}
记住我用过的一件事 CSS 包括强标签,因为你在 <strong></strong>
标签中保留了你想要修饰的词。