css in html how to,如何在HTML / CSS中的段落中加粗單詞?

I am a beginner in web programming and have some very simple questions.

我是網絡編程的初學者,有一些非常簡單的問題。

I'm trying to bold several words in one paragraph but I don't know how to do that using HTML/CSS. I've figured out how to bold entire paragraphs, but not individual words yet. How can I bold one word, like "bold" in my example?

我試圖在一個段落中加粗幾個單詞,但我不知道如何使用HTML / CSS。我已經想出如何加粗整段,但還沒有個別單詞。如何在一個單詞中加粗,就像我的例子中的“粗體”一樣?

This bolds an entire paragraph:

這大膽整個段落:

p.n1

{

font:15px bold 30px Georgia,serif;

}

I am in bold.

7 个解决方案

#1

27

This is in bold. This is not.

You might find Mozilla Developer Network to be a very handy and reliable reference.

您可能會發現Mozilla Developer Network是一個非常方便和可靠的參考。

#2

6

I know this question is old but I ran across it and I know other people might have the same problem. All these answers are okay but do not give proper detail or actual TRUE advice.

我知道這個問題已經過時了,但我跑過去了,我知道其他人可能會遇到同樣的問題。所有這些答案都沒問題,但沒有提供適當的細節或真正的真實建議。

When wanting to style a specific section of a paragraph use the span tag.

想要設置段落的特定部分的樣式時,請使用span標記。

Andy Warhol (August 6, 1928 - February 22, 1987)

was an American artist who was a leading figure in the visual art movement known as pop

art.

Andy Warhol (August 6, 1928 - February 22, 1987) was an American artist who was a leading figure in the visual art movement known as pop art.

安迪沃霍爾(1928年8月6日 - 1987年2月22日)是一位美國藝術家,他是視覺藝術運動中的領軍人物,被稱為流行藝術。

As the code shows, the span tag styles on the specified words: "Andy Warhol". You can further style a word using any CSS font styling codes.

如代碼所示,指定單詞上的span標簽樣式:“Andy Warhol”。您可以使用任何CSS字體樣式代碼進一步設置單詞樣式。

{font-weight; font-size; text-decoration; font-family; margin; color}, etc.

Any of these and more can be used to style a word, group of words, or even specified paragraphs without having to add a class to the CSS Style Sheet Doc. I hope this helps someone!

這些和更多的任何一個都可用於設置單詞,單詞組甚至指定段落的樣式,而無需向CSS樣式表文檔添加類。我希望這可以幫助別人!

#3

3

p.boldpara {font-weight:bold;}

Stack overflow is good site for developers. I really like this site

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值