平凡的理想主义者 2015-08-28 03:02 采纳率: 0%
浏览 1675

向html中插入外部样式表

这是html文件 1.html
<!DOCTYPE html>



CSSTest4





This is some text.This is some text.This is some text.
This is some text.This is some text.This is some text.
This is some text.This is some text.This is some text.
This is some text.This is some text.This is some text.
This is some text.This is some text.This is some text.
This is some text.This is some text.This is some text.
This is some text.This is some text.This is some text.
This is some text.This is some text.This is some text.



这是CSS文件 1.css
@CHARSET "UTF-8";
img{
float:right;
border:2px dotted yellow;
margin:0px 0px 30px 30px;
}
p{background-color: gray}

不知道为什么1.css对1.html不起作用?

  • 写回答

3条回答 默认 最新

  • wn_hello 2015-08-28 03:04
    关注

    你给出的html代码是全部的html代码吗?为啥连标签都没有,你在css中是对img标签和p标签操作的,你的html并没有这些标签,而且调用外部的css文件是需要link或者import的,请搞清楚html的基础语法。

    评论

报告相同问题?