一个网上商城的.css文件怎么写,就是简单的那种

html-css012

一个网上商城的.css文件怎么写,就是简单的那种,第1张

给个最简单的,你自己慢慢研究吧.

这是首页的:

<html>

<link href="css.css" style="sheetrel" type="text/css"

<head></head>

<body>

<div class="a"> /**建立一个层,显示欢迎信息和网站LOGO的***//

<div class="b">

</div>

<div class="c">

欢迎光临XXX商城

</div>

</div>

</body>

</html>

这是CSS文件的内容

.a{

border:none //设置边框

width:100%

height:30% //设置高度和宽度

}

.b{

background:url(xxxxx)//LOGO图片的路径

width:40%

height:100%//设置LOGO图片的高和宽

}

.c{

width:50%

height:100%//设置高和宽

float:right//设置欢迎信息的位置,靠左还是右

font:"宋体"

font-size:12px

color:#ff9900 //设置欢迎信息的字体,大小,颜色

}

这是最简单的,因为是手写,可能有点难看,你可以粘贴到Deamweaver里修改,看看各种变化,便于理解.

手机浏览器一般都不支持 float 浮动,所以可以用 display: inline-block 来代替它,当然你也可以用table来布局。用两个 display:inline-block 的块元素,并设定它们的宽度:width:49% 就可以实现一栏两列的布局了。

你好,这个问题应该是css兼容性问题导致的。

目前绝大部分移动浏览器还不支持animation这个属性,而是支持-webkit-animation(这类加前缀的)属性,在问题中:

.ih { background: #000 opacity:.3width: 90% height: 25% margin-left:-45% position: absolutebottom: 120pxleft:50%

    animation:ih 2s

}

只设置了,animation: ih 2s而没有写兼容的 -webkit-animation: ih 2s所以动画在移动浏览器中就不动了。你可以试下将上面代码改为:

.ih { background: #000 opacity:.3width: 90% height: 25% margin-left:-45% position: absolutebottom: 120pxleft:50%

    -webkit-animation:ih 2s

    -moz-animation:ih 2s

    -ms-animation:ih 2s

    -o-animation:ih 2s

    animation:ih 2s

}

希望能帮你解决问题,望采纳~~