完全可以哦,滑动式的利用css的hover,也就是纯css菜单的原理,
点击式的利用的是锚点的原理。
实例如下:
<!doctype html><html>
<head>
<meta charset="utf-8">
<title>纯CSS实现的Tab</title>
<style>
*{ margin:0 padding:0}
#main{width:500px margin:100px auto}
#title>a{ float:left border:1px solid #000 padding:2px 4px display:block text-decoration:none color:#000}
#content{ width:500px height:300px border:1px solid #000 overflow:hidden}
#content>div{float:left padding:2px 4px width:500px height:300px}
#a1:hover #a2>#tab2{ display:block}
</style>
</head>
<body>
<div id="main">
<div id="title">
<a href="#tab1">tab1title</a>
<a href="#tab2">tab2title</a>
<a href="#tab3">tab3title</a>
<a href="#tab4">tab4title</a>
<div style="clear:both"></div>
</div>
<div id="content">
<div id="tab1"> tab1 content </div>
<div id="tab2"> tab2 content </div>
<div id="tab3"> tab3 content </div>
<div id="tab4"> tab4 content </div>
<div style="clear:both"></div>
</div>
</div>
</body>
</html>
怎么用css把背景图片拉伸 不是平铺 纯css实现的话可以使用css的background-size属性。语法如下示例:p{background-size:100% 100%}
共有两个值,第一个值是宽度,第二个值是高度。如果只设置第一个值,则第二个值预设为"auto"。
css怎么把背景图片拉伸至100%
.a {width: 500pxheight: 500pxbackground: url(img/1.jpg)background-size: 100%} 不知道是不是你想要的结果
具体使用方法如下:
背景图尺寸(数值表示方式):
程式码如下:
#background-size{
background-size:200px 100px
}
背景图尺寸(百分比表示方式):
程式码如下:
#background-size2{
background-size:30% 60%
}
背景图尺寸(等比扩充套件图片来填满元素,即cover值):
程式码如下:
#background-size3{
background-size:cover
}
背景图尺寸(等比缩小图片来适应元素的尺寸,即contain值):
程式码如下:
#background-size4{
background-size:contain
}
背景图尺寸(以图片自身大小来填充元素,即auto值):
程式码如下:
#background-size5{
background-size:auto
}
/css 背景图片如何拉伸,不是平铺。求例子
<style type = "text/css">
body {
background-image:url("xxx.jpg")
no-repeat center center fixed
background-size: contain
}
试试看看background-size: ,contain 或者cover, stackoverflow里的回复还有几句没看懂的,
-webkit-background-size: cover
-moz-background-size: cover
-o-background-size: cover
我删了后也能在IE和firefox里显示拉伸的背景图片,不知道加上去有什么作用
css怎么定义背景图片拉伸?
.bg {
MARGIN: 0px PADDING-RIGHT: 8pxPADDING-LEFT: 8pxMIN-HEIGHT: 10pxBACKGROUND: url(images/leftboxContentBg.jpg) #edf6fb repeat-x 0px 0pxCOLOR: #4d9ecf
}
试试
css背景图片拉伸 不用滤镜
暂时没看到完美解决办法 只能是滤镜对付ie6
css3新背景特性对付新的浏览器了
div {
background: url(example.jpg) left (100% 2em) no-repeat,
url(example2.jpg) bottom left (100% 2em) no-repeat,
url(example3.jpg) center center (10em 10em) repeat-y
}
在这里,(100% 2em) 是background-size 的值;第一个背景图片将会出现在左上角并会被拉伸至该div的100%宽度和2em的高度。
求背景图片拉伸?
没有直接办法,只能用层来实现,示例如下:
<div class="page_speeder_2010202423">
把你的网页程式码加在这里
</div>
注意<div></div>要放在网页的<body></body>内,而原来<body></body>内的所有内容都要移动到<div>内。
这样也不是最佳解决方案,但暂时只能这样。
幻灯片背景图片怎么拉伸开来 现在的背景是平铺的,同样的图片好几张组合起来,怎么把背景图片拉伸为一张
点选单中的格式——背景——点下拉箭头中的填充效果——点图片,再从电脑上找到要做成背景的图片,点确定,再点应用,如果是所有幻灯片都要这样的背景就点“全部应用”。
Dreamweaver8 怎么样把背景图片拉伸全屏??
Dreamweaver8 工具下面有个页面属性 你开启后设置背景 还有平铺 什么的 一些属性 你看一下就会用了
解决方法有两种:
一种是CSS,使用background-size:cover实现图片的拉伸效果,但是IE8及以下版本不支援background-size,于是可以使用微软的滤镜效果,但是IE6不支援。
程式码如下:
body{background:url(bg.jpg) center centerbackground-size:coverheight:900pxwidth:100%
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='bg.jpg', sizingMethod='scale')}
另一种是使用jQuery,在body中动态插入一个div,然后在div里包含一张图片,浏览器视窗改变大小时,动态设定背景图片的尺寸。
程式码如下:
$(function(){
$("body").append("<div id='main_bg' class="page_speeder_2001550029"/>")
$("#main_bg").append("<img src='bg.jpg' id='bigpic'>")
cover()
$(window).resize(function(){ 浏览器视窗变化
cover()
})
})
function cover(){
var win_width = $(window).width()
var win_height = $(window).height()
$("#bigpic").attr({width:win_width,height:win_height})
}