1. 怎样写CSS样式代码
CSS的定义由三个部分构成:选择符(selector),属性(properties)和属性的取值(value)。
CSS语法:
selector {property: value}
选择符 {属性:值}
选择符有多种:类型选择符、通配选择符、属性选择符等。
类型选择符:一般是你要定义样式的HTML标记,例如BODY、P、TABLE……,你可以通过此方法定义它的属性和值,属性和值要用冒号隔开。
例子:body {color: black},此例的效果是使页面中的文字为黑色。
如果需要对一个选择符指定多个属性时,我们使用分号将所有的属性和值分开。
例子:p {text-align: center; color: red} (段落居中排列;并且段落中的文字为红色)
这里只是最基本的写法,建议你去找教程学习,比如w3cschool里的CSS教程。
在此推荐经典教程《精通CSS》。
参考资料里有一些稍微详细的内容,建议你看一看。
2. 这个html代码怎么写
h1{font-size:14px;color:red;font-family:"华文行楷";text-algin:center;}
p{text-indent:25px;ling-height:25pt;letter-spacing:03pt;}
p span{color:green;font-family:"隶书","斜体";}
a:link{color:red;text-decoration:none;}
a:hover{color:blue;}
一级标题
正文段落段首缩进两个汉字;字间距正文段落段首缩进两个汉字;字间距
3. 通过css代码写html代码
楼上几位可笑~水平不够就不要误导别人
<html>
<head>
<title></title>
<style type="text/css">
#header{……}
#header div.lc{……}
#header div.rc{……}
#header div.tit{……}
#header div.tit a.titlink{……}
#header div.tit a.titlink:visied{……}
#header div.desc{……}
</style>
</head>
<body>
<div id="header">
<div class="lc"></div>
<div class="rc"></div>
<div class="tit"><a href="#"></a></div>
<div class="desc"></div>
</div>
</body>
</html>
4. CSS 这样的代码怎么写
HTML部分:
<div id="tbox">
<a id="tbox_0" href="#">;生活</a>
<a id="tbox_1" href="#">;视频</a>
<a id="tbox_2" href="#">;团购</a>
<a id="tbox_3" href="#">;游戏</a>
<a id="tbox_4" href="#">;美图</a>
<a id="gotop" href="javascript:void(0);" title="返回顶部" target="_self">;返回顶部</a>
</div>js部分:
function a(x,y){
l = $('.footer').offset().left;//默认值
w = $('.footer').width();//默认值
$('#tbox').css('left',(l + w + x) + 'px');
$('#tbox').css('bottom',y + 'px');
}
function b(){
//h = $(window).height();
h = 300;
t = $(document).scrollTop();
if(t > h){
$('#gotop').fadeIn("slow");
}else{
$('#gotop').fadeOut("slow");
}
}
$(document).ready(function(e) {
a(10,10);
b();
$('#gotop').click(function(){
$(document).scrollTop(0);
})
/*
$("#tbox a").css({opacity:0.8});
$("#tbox a").hover(function(){
$(this).css({opacity:1});
},function(){
$("#tbox a").css({opacity:0.8});
})
*/
});
$(window).resize(function(){
a(10,10);
});
$(window).scroll(function(e){
b();
});CSS部分:
*html{background-image:url(about:blank);background-attachment:fixed;}
#tbox{width:55px;height:415px;float:right;position:fixed;z-index:999;
_position:absolute;
_bottom:auto;
_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,8)||0)-(parseInt(this.currentStyle.marginBottom,8)||0)));
_margin-bottom:8px;
}
#tbox a{width:55px;height:55px;position:absolute;cursor:pointer;background:#000000}
5. css代码写在哪
css代码的,首先我们是有3种方式来书写css的,可以写在外部的css文件中,或者是写在head的<style></style>;中,还有就是写在元素的行中,通过代码来理解:
<html>
<head>
<style>; //通过style实现
#nav{
width:900px;
height:30px;
}
#nav ul li{
float:left;
padding:5px 30px;
}
#nav ul li{
float:left;
width:60px;
}
</style>
<link rel='stylesheet' type='text/css' href='./css/index1.css'>; //通过外部文件实现
</head>
<body>
<div class="nav" style="width:400px">; //通过行内实现
<ul>
<li>
<a href="">;首页</a>
</li>
<li>
<a href="">;兴趣爱好</a>
</li>
<li>
<a href="index.php">;好友印象</a>
</li>
<li>
<a href="register.php">;会员注册</a>
</li>
<li>
<a href="dengtu.php">;会员登录</a>
</li>
</ul>
</div>
</body>
</html>
6. 这个css代码应该怎么写呢
销售 销售 销售 销售 销售 销售 销售 销售 销售 销售 qq群;301909232。