css笔记

xiaoxiao2021-02-28  101

css是对html的具体的标签进行完善

css和html结合方式

1,每一个html标签中都有一个style样式属性,该属性的值就是css代码

<div style="color:red background-color:blue"></div>

2,使用style标签的方式,一般定义在head中,先加载到内存中

<style type="text/css"> body{ margin:0px; } //id选择器 div#imgtext{ border: blue dashed 1px; height:450px; width:1000px; position:absolute; top:400px; left:20px; } </style>

3,使用css的@import语句导入css文件

<style type="text/css"> @import url(cssDemo.css); </style> 其中cssDemo.css文件就是方式1中的<style>中的内容

4,使用link链接css样式表

在<head>中加入链接语句

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

待续。。。。。

<link rel="stylesheet" type="text/css" href="cssDemo.css">
转载请注明原文地址: https://www.6miu.com/read-23466.html

最新回复(0)