Alternative to the HTML Bold tag

后端 未结 21 1816
野性不改
野性不改 2020-12-23 15:35

Okay, so I know that in HTML you can use the tag, but isn\'t there a \"weight=bold\" attribute that I can use in the

相关标签:
21条回答
  • 2020-12-23 16:21

    The <b> tag is alive and well. <b> is not deprecated, but its use has been clarified and limited. <b> has no semantic meaning, nor does it convey vocal emphasis such as might be spoken by a screen reader. <b> does, however, convey printed empasis, as does the <i> tag. Both have a specific place in typograpghy, but not in spoken communication, mes frères.

    To quote from http://www.whatwg.org/

    The b element represents a span of text to be stylistically offset from the normal prose without conveying any extra importance, such as key words in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is boldened.
    0 讨论(0)
  • 2020-12-23 16:21

    You can use the font-weight attribute on your

    For example:

    <p>This is my paragraph</p>
    

    You can either have your CSS inline as below:

    <p style="font-weight:bold;">This is my paragraph</p>
    

    Or have it in your external CSS stylesheet as below:

    p{
      font-weight:bold;
    }
    
    0 讨论(0)
  • 2020-12-23 16:23
    <p style="font-weight:bold;"></p>
    
    0 讨论(0)
  • 2020-12-23 16:27

    You can use following :

    <p id="p1">Some Text here </p>
    #p1{
       font-weight: bold;
    }
    

    OR

    <Strong><p>Some text here </p></strong>
    

    OR

    You can use <h1> tag which is somewhat similar to bold

    0 讨论(0)
  • 2020-12-23 16:27

    Nowadays people tend to use website builders (CMS like Wordpress) instead of coding their own blog from scratch. Even professional web developers do it because it's faster.

    It would be nice if you could mention the advantages and things to keep in mind when coding your own blog in real life, for example:

    • More flexibility (customization)
    • Pay a domain name
    • Pay and choose a web hosting
    • Security and maintenance
    • Copyright and license of some website builders' templates and graphics. Your website could be locked to a particular web host if you used your host's website builder. So you cannot move to another web host, because if you do you could no longer use that template.
    • Experience trouble when asking for website builder's tech support when the website goes down.
    • Some templates are not search engine friendly and this affects your website ranking (SEO)

    Anyways, you can use css/css3 or JavaScript for making interactive webpage. Even you can upload your all sort of code into a server formatting the default blog theme.

    0 讨论(0)
  • 2020-12-23 16:28

    If the text's meaning is semantically strong, use the strong element. If not, use a semantic named class (one that clearly shows the meaning of the element, don't mix presentation and data by calling it bold etc) and reference it in your CSS.

    HTML

    <span class="important-message">I'm important!</span>
    

    CSS

    .important-message {
       font-weight: bold;
    }
    

    Some people still use the b element as a presentational hook, but it hasn't been deprecated, though most people favour the strong element nowadays. Just make sure they are used correctly.

    0 讨论(0)
提交回复
热议问题