温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

css外部样式表怎么写

发布时间:2022-03-11 15:14:38 来源:亿速云 阅读:768 作者:iii 栏目:web开发

这篇文章主要介绍“css外部样式表怎么写”,在日常操作中,相信很多人在css外部样式表怎么写问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”css外部样式表怎么写”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

  1.外部样式表:

  <head>

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

  </head>

  2.内部样式表:

  <head>

  <style type="text/css">

  &hellip;&hellip;

  </style>

  </head>

  3.内联表

  <p style="color:red;margin:0"></p>

  css语法由3部分构成:select {property: value}

  如果值为多个单词,则要给值加引号:p {font-family: "sans serif";}

  多重声明:p {text-align: center; color:red;}

  选择器分组:h2, h3, h4, h5, h6, h7 {color: green;}

  继承:body {font-family: Verdana, sans-serif;}所有子元素都从body继承属性

  a.css第一行:@charset "utf-8";

  派生选择器:li strong {&hellip;}用于选择元素<li><strong>&hellip;</strong></li>

  id选择器:#id1 {&hellip;}

  类选择器:。class1 {&hellip;}

  背景色:background-color:gray;

  背景图像:background-image:url(/ab/cd/e.gif);

  背景重复:background-repeat:repeat-x|repeat-y|no-repeat;

  背景定位:background-position:center|top|bottom|right|left|50% 50%|100px 200px;

  背景关联:background-attachment:scroll|fixed|inherit;

  内边距:padding, padding-top, padding-right, padding-bottom, padding-left

  边框:border, border-top, border-right, border-bottom, border-left, &hellip;

  外边距:margin, margin-top, margin-right, margin-bottom, margin-left

  position: static, relative, absolute, fixed

  float: left, right

  a:link {&hellip;}

  a:visited {&hellip;}

  a:hover {&hellip;}

  a:active {&hellip;}

到此,关于“css外部样式表怎么写”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

css
AI