所以我使用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;
}
答案 0 :(得分:2)
每当您导入自定义字体时,请务必包含您需要的所有权重和样式。普通字体重量通常为400,粗体通常为700.下面的样式表将包含Roboto字体所需的几乎所有内容。
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
答案 1 :(得分:1)
你可以用这个简单的方法来加粗单词
使用<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>
&#13;
我在我的网站上使用此方法加粗
答案 2 :(得分:1)
您希望将<b></b>
标记添加到HTML文件而不是强大,或者您也可以通过CSS将其添加到这样:
strong {
font-weight: strong;
}
您还可以正常保存文字,只需添加一些颜色即可,或者更吸引人或引人注目:
strong {
color: red;
}
请记住我使用CSS的一件事,包括强标记,因为您保留了要在<strong></strong>
标记中修饰的单词。
答案 3 :(得分:0)
我更喜欢使用<span>
使用CSS font-weight:bold;
而不是<strong>
或<b>
。我发现使用它更符合现代样式惯例。如果您已经在使用CSS文件,那么为什么要将您的样式放在一个可以合并为一个的位置?