how to remove the bold from a headline?

后端 未结 9 1544
半阙折子戏
半阙折子戏 2021-02-06 20:11

I have a headline:

THIS IS A HEADLINE

How do i make the phrase \"THIS IS...\" not to be bold and the rest without a change

相关标签:
9条回答
  • 2021-02-06 20:36

    The heading looks bold because of its large size, if you have applied bold or want to change behaviour, you can do:

    h1 { font-weight:normal; }
    

    More: http://www.w3.org/TR/css3-fonts/#font-weight-prop

    0 讨论(0)
  • 2021-02-06 20:36

    You want font-weight, not text-decoration (along with suitable additional markup, such as <em> or <span>, so you can apply different styling to different parts of the heading)

    0 讨论(0)
  • 2021-02-06 20:37

    You can use font-weight:100 or lighter: this is working with i.e. Opera 16 and older, but I do not know why the h1 tags in Firefox are bolder, sorry.

    0 讨论(0)
  • 2021-02-06 20:40
    <h1><span>This is</span> a Headline</h1>
    
    h1 { font-weight: normal; text-transform: uppercase; }
    h1 span { font-weight: bold; }
    

    I'm not sure if it was just for the sake of showing us, but as a side note, you should always set uppercase text with CSS :)

    0 讨论(0)
  • 2021-02-06 20:41

    for "THIS IS" not to be bold - add <span></span> around the text

    <h1>><span>THIS IS</span> A HEADLINE</h1>
    

    and in style

    h1 span{font-weight:normal}
    
    0 讨论(0)
  • 2021-02-06 20:42

    you can simply do like that in the html part:

    <span>Heading Text</span>
    

    and in the css you can make it as an h1 block using display:

    span{
    display:block;
    font-size:20px;
    }
    

    you will get it as a h1 without bold ,
    if you want it bold just add this to the css:

    font-weight:bold;
    
    0 讨论(0)
提交回复
热议问题