如何在html文件中包含css文件

<link rel=stylesheet type="text/css" href="style.css">

包含你想要的文件href="file path"

在css文件中,如果想指定某一个元素,或某一种类型的样式,可以用id或者class,

#blue{
	color:blue;
}

代表id为blue的元素是蓝色的。

p.abc{
	color:red;
}

p中class为abc的,(两个条件:p&&abc),是红色的

        <p id="blue">//蓝色的
            Video provides a powerful way to help you prove your point. When you click Online
            Video, you can paste in the embed code for the video you want to add. You can also
            type a keyword to search online for the video that best fits your document. To make
            your document look professionally produced, Word provides header, footer, cover page,
            and text box designs that complement each other. For example, you can add a matching
            cover page, header, and sidebar. Click Insert and then choose the elements you want
            from the different galleries. Themes and styles also help keep your document coordinated.
            When you click Design and choose a new Theme, the pictures, charts, and SmartArt
            graphics change to match your new theme. When you apply styles, your headings change
            to match the new theme. Save time in Word with new buttons that show up where you
            need them.
        </p>
            <div class="abc">//不是红色的
                abc
            </div>
        
	<p class="abc">//红色的
            To change the way a picture fits in your document, click it and a button for layout
            options appears next to it. When you work on a table, click where you want to add
            a row or a column, and then click the plus sign. Reading is easier, too, in the new
            Reading view. You can collapse parts of the document and focus on the text you want.
            If you need to stop reading before you reach the end, Word remembers where you left
            off - even on another device. Video provides a powerful way to help you prove your
            point. When you click Online Video, you can paste in the embed code for the video
            you want to add. You can also type a keyword to search online for the video that
            best fits your document. To make your document look professionally produced, Word
            provides header, footer, cover page, and text box designs that complement each other.
            For example, you can add a matching cover page, header, and sidebar.
        </p>
	<p class="abc">//红色的
            Click Insert and then choose the elements you want from the different galleries.
            Themes and styles also help keep your document coordinated. When you click Design
            and choose a new Theme, the pictures, charts, and SmartArt graphics change to match
            your new theme. When you apply styles, your headings change to match the new theme.
            Save time in Word with new buttons that show up where you need them. To change the
            way a picture fits in your document, click it and a button for layout options appears
            next to it. When you work on a table, click where you want to add a row or a column,
            and then click the plus sign. Reading is easier, too, in the new Reading view. You
            can collapse parts of the document and focus on the text you want. If you need to
            stop reading before you reach the end, Word remembers where you left off - even on
            another device.
        </p>

猜你喜欢

转载自blog.csdn.net/weixin_38993125/article/details/80070930
今日推荐