用htm和css还原设计稿。 这还原设计稿是什么意思

html-css010

用htm和css还原设计稿。 这还原设计稿是什么意思,第1张

设计稿即为设计图,是用PS等设计软件做出的效果图。用htm和css还原设计稿的意思就是用html和css代码把设计图做成网页效果。需要用到html、css、js等前端技术。

如果把室内效果图比作设计稿,那么装修的过程就是还原设计稿。

实现代码如下:

<divclass="wrap">

<divclass="img"></div>

<divclass="notice">1</div>

</div>

<divclass="wrap">

<divclass="img"></div>

<divclass="notice">12</div>

</div>

<divclass="wrap">

<divclass="img"></div>

<divclass="notice">13</div>

</div>

<style>

.wrap{

width:50px

margin-bottom:10px

position:relative

}

.img{

width:50px

height:50px

border:1pxsolid#000

}

.notice{

width:20px

height:20px

line-height:20px

font-size:10px

color:#fff

text-align:center

background-color:#f00

border-radius:50%

position:absolute

right:-10px

top:-10px

}

</style>

扩展资料:

注意事项

主要用到position定位,CSSposition属性用于指定一个元素在文档中的定位方式。top、right、bottom、left 属性则决定了该元素的最终位置。

static是position的默认值。

<!DOCTYPEhtml>

<htmllang="en">

<head>

<metacharset="UTF-8">

<title>CSS-position-static</title>

<linkrel="stylesheet"href="https://cdn.bootcss.com/normalize/8.0.0/normalize.css">

<style>

.container{

background-color:#868686

width:100%

height:300px

}

.content{

background-color:yellow

width:100px

height:100px

position:static

left:10px/*这个left没有起作用*/

}

</style>

</head>

<body>

<divclass="container">

<divclass="content">

</div>

</div>

</body>

</html>