网站背景

KuaiKan 2021-12-25 816

网站背景

背景

<style>
body {
    background-position: center top;
    background-size: 30px 30px;
    background-color: #fcfcfc;
    background-image: linear-gradient(to right,rgba(37,82,110,.1) 1px,transparent 1px),linear-gradient(to bottom,rgba(37,82,110,.1) 1px,transparent 1px);
}
</style>
< link rel ="stylesheet"  type ="text/css"  href ="styleB.css"  media ="screen and (min-width: 600px) and (max-width: 800px)" >

意思是当屏幕的宽度大于600小于800时,应用styleB.css

如果浏览器窗口的宽度为 600px 或更小时,把 <body> 元素的背景颜色更改为“浅蓝色”:

@media only screen and (max-width: 600px) {
  body {
    background-color: lightblue;
  }
}

您还可以针对不同的媒体使用不同的样式表,就像这样:

<link rel="stylesheet" media="screen and (min-width: 900px)" href="widescreen.css">
<link rel="stylesheet" media="screen and (max-width: 600px)" href="smallscreen.css">
....

https://www.w3school.com.cn/cssref/pr_mediaquery.asp

https://www.runoob.com/cssref/css3-pr-mediaquery.html

HTML:把两张图片并排(行)显示

<table><tr>
<td><img src=pic1.jpg border=0></td>
<td><img src=pic2.jpg border=0></td>
</tr></table>

1)所有段落首字下沉

p::first-letter { 
      color: #c69c6d; 
      float: left; 
      font-size: 5em; 
      margin: 0 .2em 0 0; 
    }
p {clear:both;} /*清除首字的浮动,避免影响p标签的高度与其相叠加*/


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回