怎么在网页中用link引用一个css后,又怎么可以直接在css中写代码后还可以显示?

html-css014

怎么在网页中用link引用一个css后,又怎么可以直接在css中写代码后还可以显示?,第1张

你好,这种情况,可以在html代码中使用内联样式或者行内样式。

内联样式:将css写在style标签对中,一般style标签对写在head标签内

行内样式:如<p style="color:red">hello</p>

若满意,望采纳,谢谢!

方法1、link标签加载CSS

<ol><li><p><link

href

=

"Styles/Styles1.css"

rel

=

"stylesheet"

type

="text/css"

/></p><p><link

href

=

"Styles/Styles2.css"

rel

=

"stylesheet"

type

="text/css"

/></p></ol>复制代码

方法2、在CSS文件中加载CSS

<ol><li>

@import

url(form.css)</ol>复制代码

方法3、直接在网页中加载

<ol><li><style

type="text/css">

<li>

h1{color:Bluetext-decoration:underline}

<li></style></ol>复制代码