首页 > 其他分享 >HTML——day13

HTML——day13

时间:2023-03-11 14:55:31浏览次数:41  
标签:repeat 方位 image HTML background day13 images position

css背景

背景颜色:background—color

背景图片:

<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Document</title>     <style>         div {             width: 200px;             height: 200px;            /* transparent;/*表示透明的清澈的背景*/          /*  pink;*/            background-image: url(images/views.jpg);/*图片路径非常重要,*/            background-repeat: repeat-x/*背景图片的属性,是怎样平铺的沿着x或者y或者不平铺这些都是对于我们的图片比我们的框框小的情况下*/;           /* background-position:x y ;                      垂直居中           */
          background-position:right top;/*方位名词,顺序无所谓*/           /*如果我们只写一个方位名词name另一个就是默认center*/          /* background-position: x y;/*这里的位置必须是先x后y*/         /*精确位置可以和方位进行混合带你前提是前面一定是x方位后面一定是y的方位*/         }     </style> </head> <body>     <div>
    </div> </body> </html> ---------------------------------------------------------------------------- 下面是我们做的一个案例很简单的插入图片 ------------------------------------------------------------------- <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Document</title>   <style>       body {           background-image: url(images/ganjiang.jpg);          /* background-position: center top;/*水平居中 垂直居中*/          background-position: center 50px;           background-repeat: no-repeat;       }             h4 {           background-color: pink;           background-image: url(images/ly.png);           background-repeat: no-repeat;         background-position: left ;         width: 100px;          text-indent: 2em;          font-weight: 400;                 }   </style> </head> <body>    <h4>成长守护</h4>              </body> </html> --------------------------------------------------------------------

 

 

标签:repeat,方位,image,HTML,background,day13,images,position
From: https://www.cnblogs.com/222wan/p/17206041.html

相关文章

  • HTML——day12
    简洁版小米侧边篮:<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <meta name="viewport" content="width=device-width, initi......
  • HTML——day11
    css的元素的显示模式元素的显示模式:指的是将标签分成不同的种类,我们可以更好的选择使网页得到更好的布局分为块元素(div一行只要一个)和行内元素(span一行中好几个)块元素:h......
  • HTML基本标签及特殊符号
    1、基础标签-hn系列标签:h1h2h3h4h5h6(标题)-p标签(段落)-br标签(换行)-hr标签(分界线)2、文本标签-strong/b标签(文本加粗)-em/i标签(文......
  • HTML——day10
    css:伪类选择器:给我们的链接添加一个特殊效果,分为链接伪类,结构伪类,等等用我们的:表示添加在名称前面例如:hover  :first-child链接伪类:<head>    <meta chars......
  • HTML标准结构
    <!DOCTYPEhtml><htmllang="zh-CN">  <head>    <metacharset="UTF-8">    <title>我是一个标题</title>  </head>  <body>   ......
  • HTML表格
    ​表格: <table><tr><th>表格1</th></tr><tr><td>表格2</td></tr></table> 快捷键:table>tr*数量>td*数量 属性......
  • 前端面试题(html+css)
    HTML1、h5新增标签header、footer、 nav、article、aside、audio、video……等2、html语义化HTML语义化就是指在使用HTML标签构建页面时,要求尽可能的使用具有语义的......
  • day13笔记
    上节课复习:x+b1、读写都是以bytes2、针对所有文件3、一定不能指定encodingwithopen('a.txt',mode='rb')asf:res=f.read()......
  • 解决vue中v-html元素中标签样式失效问题
    最近在项目中遇到移动端和pc端样式冲突的问题。加上scoped会导致v-html下绑定的标签样式不生效、第三方引用的类库对其修改也不生效,特此总结一下几点,用来解决: Vue为v-......
  • Element UI:能在一个html中使用它提供的组件吗?
    一、寻找组件找到需要使用的组件,比如一个表单  二、创建html文件导入element样式库、脚本库和它依赖的vue2库。<!DOCTYPEhtml><html><head>......