谷歌浏览器不会在HTML网页中添加粗体字

问题描述 投票:1回答:4

所以我使用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;
    }
html css google-chrome dreamweaver
4个回答
2
投票

无论何时导入自定义字体,请务必包含所需的所有权重和样式。普通字体重量通常为400,粗体通常为700.下面的样式表将包含Roboto字体所需的几乎所有内容。

<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,400italic,700italic' rel='stylesheet' type='text/css'>

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>

我在我的网站上使用这种方法加粗


1
投票

您想要将<b></b>标记添加到您的HTML文件而不是强大,或者您可以通过CSS执行此操作,如下所示:

strong {
  font-weight: strong;
}

您还可以以正常方式保存文本,只需添加一些颜色以显示或更具吸引力或引人注目:

strong {
  color: red;
}

记住我使用CSS的一件事,包括强标签,因为你保留了你想在<strong></strong>标签中装饰的那个词。


0
投票

我更喜欢使用<span>与CSS font-weight:bold;而不是<strong><b>。我发现使用它更符合现代样式惯例。如果您已经在使用CSS文件,那么为什么要将您的样式放在一个可以合并为一个的位置?

© www.soinside.com 2019 - 2024. All rights reserved.