Div容器内的HTML+CSS样式/文本格式

Div容器内的HTML+CSS样式/文本格式,html,css,stylesheet,Html,Css,Stylesheet,我试图在Index.HTML中的一个段落中加粗和着色某些单词,或者使它们倾斜、大小不同等等 但是通常的格式化标记HTML不起作用 我有一个样式表,其中包含了我的所有风格和网站属性,但我只想改变三个字,例如在段落中。我该怎么做 index.html: 将单词包装成一个字母,然后对其应用样式 HTML: 请参见此将单词包装为a,然后对其应用样式 HTML: 请看此检查此小提琴: 这是一个小例子 我用这个词把它加粗,但用这个词也可以 用来使单词变成斜体。我还用Word把它做成蓝色。检查一下这把小提琴:

我试图在Index.HTML中的一个段落中加粗和着色某些单词,或者使它们倾斜、大小不同等等

但是通常的格式化标记HTML不起作用

我有一个样式表,其中包含了我的所有风格和网站属性,但我只想改变三个字,例如在段落中。我该怎么做

index.html:

将单词包装成一个字母,然后对其应用样式

HTML:

请参见此

将单词包装为a,然后对其应用样式

HTML:

请看此

检查此小提琴:

这是一个小例子

我用这个词把它加粗,但用这个词也可以

用来使单词变成斜体。我还用Word把它做成蓝色。

检查一下这把小提琴:

这是一个小例子

我用这个词把它加粗,但用这个词也可以

用来使单词变成斜体。我还使用Word将其变为蓝色。

用法:

用法:


您可以通过预定义的HTML标记strong、i、em获得所需的结果,也可以设置单独的类来分配给不同的元素

这是您可以保存的文档,请尝试

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
        <style>
            body {
                font-size:100%;
                font-family:arial;
            }

            .boldme {
                font-weight:bold;
            }

            .italicme {
                font-style:italic;
            }

            .iambigger {
                font-size:150%;
            }

            .colormered {
                color:#FF0000;
            }
        </style>
    </head>
<body>
    <div class="da-slide">
        <h2>This is the Heading</h2>
        <p>And <span class="iambigger">HERE</span> is where I want to make <span class="italicme">this</span> word <span class="boldme">BOLD</span> and this <span class="colormered">WORD</span> in a different color, for example.</p>
        <p>And by the way, <span class="boldme italicme iambigger colormered">I can have combinations of all</span></p>
        <a href="#" class="da-link">Read more</a>
        <div class="da-img">
            <img src="img/pp-slider/imac.png" alt="image01" />
        </div>
    </div>
</body>
</html>

如果您还需要了解其他信息,请告诉我…

您可以通过预定义的HTML标记strong、i、em获得所需的结果,也可以设置用于分配给不同元素的各个类

这是您可以保存的文档,请尝试

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
        <style>
            body {
                font-size:100%;
                font-family:arial;
            }

            .boldme {
                font-weight:bold;
            }

            .italicme {
                font-style:italic;
            }

            .iambigger {
                font-size:150%;
            }

            .colormered {
                color:#FF0000;
            }
        </style>
    </head>
<body>
    <div class="da-slide">
        <h2>This is the Heading</h2>
        <p>And <span class="iambigger">HERE</span> is where I want to make <span class="italicme">this</span> word <span class="boldme">BOLD</span> and this <span class="colormered">WORD</span> in a different color, for example.</p>
        <p>And by the way, <span class="boldme italicme iambigger colormered">I can have combinations of all</span></p>
        <a href="#" class="da-link">Read more</a>
        <div class="da-img">
            <img src="img/pp-slider/imac.png" alt="image01" />
        </div>
    </div>
</body>
</html>
如果您还需要了解其他信息,请告诉我…

这是您的答案

HTML:

<div id="da-slider" class="da-slider">
    <div class="da-slide">
        <h2>This is the Heading</h2>
        <p>And HERE is where I want to make this word <span>BOLD</span> and this <span>WORD</span> in a different color, for example</p>
        <a href="#" class="da-link">Read more</a>
    <div class="da-img"><img src="img/pp-slider/imac.png" alt="image01" /></div>
</div>
</div>
希望这有帮助。

这是答案

HTML:

<div id="da-slider" class="da-slider">
    <div class="da-slide">
        <h2>This is the Heading</h2>
        <p>And HERE is where I want to make this word <span>BOLD</span> and this <span>WORD</span> in a different color, for example</p>
        <a href="#" class="da-link">Read more</a>
    <div class="da-img"><img src="img/pp-slider/imac.png" alt="image01" /></div>
</div>
</div>
希望这有帮助。

我强烈推荐。我强烈推荐。
span {
    font-weight: bold;
    font-style: italic;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
        <style>
            body {
                font-size:100%;
                font-family:arial;
            }

            .boldme {
                font-weight:bold;
            }

            .italicme {
                font-style:italic;
            }

            .iambigger {
                font-size:150%;
            }

            .colormered {
                color:#FF0000;
            }
        </style>
    </head>
<body>
    <div class="da-slide">
        <h2>This is the Heading</h2>
        <p>And <span class="iambigger">HERE</span> is where I want to make <span class="italicme">this</span> word <span class="boldme">BOLD</span> and this <span class="colormered">WORD</span> in a different color, for example.</p>
        <p>And by the way, <span class="boldme italicme iambigger colormered">I can have combinations of all</span></p>
        <a href="#" class="da-link">Read more</a>
        <div class="da-img">
            <img src="img/pp-slider/imac.png" alt="image01" />
        </div>
    </div>
</body>
</html>
<div id="da-slider" class="da-slider">
    <div class="da-slide">
        <h2>This is the Heading</h2>
        <p>And HERE is where I want to make this word <span>BOLD</span> and this <span>WORD</span> in a different color, for example</p>
        <a href="#" class="da-link">Read more</a>
    <div class="da-img"><img src="img/pp-slider/imac.png" alt="image01" /></div>
</div>
</div>
.da-slide p span {
    font-weight: bold;
}