html+css管理界面,divcss代码简单的后台管理界面

www.css5.net

body{font-size:12px;}

ul,li,h2{margin:0;padding:0;}

ul{list-style:none;}

#top{width:900px;height:40px;margin:0 auto;background-color:#CCCC00}

#top h2{width:150px;height:40px;background-color:#99CC00;float:left;font-size:14px;text-align:center;line-height:40px;}

#topTags{width:750px;height:40px;margin:0 auto;background-color:#CCCC00;float:left}

#topTags ul li{float:left;width:100px;height:25px;margin-right:5px;display:block;text-align:center;cursor:pointer;padding-top:15px;}

#main{width:900px;height:500px;margin:0 auto;background-color:#F5F7E6;}

#leftMenu{width:150px;height:500px;background-color:#009900;float:left}

#leftMenu ul{margin:10px;}

#leftMenu ul li{width:130px;height:30px;display:block;background:#99CC00;cursor:pointer;line-height:30px;text-align:center;margin-bottom:5px;}

#leftMenu ul li a{color:#000000;text-decoration:none;}

#content{width:750px;height:500px;float:left}

.content{width:740px;height:490px;display:none;padding:5px;overflow-y:auto;line-height:30px;}

#footer{width:900px;height:30px;margin:0 auto;background-color:#ccc;line-height:30px;text-align:center;}

.content1 {width:740px;height:490px;display:block;padding:5px;overflow-y:auto;line-height:30px;}

window.οnlοad=function(){

function $(id){return document.getElementById(id)}

var menu=$("topTags").getElementsByTagName("ul")[0];//顶部菜单容器

var tags=menu.getElementsByTagName("li");//顶部菜单

var ck=$("leftMenu").getElementsByTagName("ul")[0].getElementsByTagName("li");//左侧菜单

var j;

//点击左侧菜单增加新标签

for(i=0;i

ck[i].οnclick=function(){

$("welcome").style.display="none"//欢迎内容隐藏

//循环取得当前索引

for(j=0;j<8;j++){

if(this==ck[j]){

if($("p"+j)==null){

openNew(j,this.innerHTML);//设置标签显示文字

}

clearStyle();

$("p"+j).style.backgroundColor="yellow";

clearContent();

$("c"+j).style.display="block";

}

}

return false;

}

}

//增加或删除标签

function openNew(id,name){

var tagMenu=document.createElement("li");

tagMenu.id="p"+id;

tagMenu.innerHTML=name+"   "+"off.gif";

//标签点击事件

tagMenu.οnclick=function(evt){

clearStyle();

tagMenu.style.backgroundColor="yellow";

clearContent();

$("c"+id).style.display="block";

}

//标签内关闭图片点击事件

tagMenu.getElementsByTagName("img")[0].οnclick=function(evt){

evt=(evt)?evt:((window.event)?window.event:null);

if(evt.stopPropagation){evt.stopPropagation()} //取消opera和Safari冒泡行为;

this.parentNode.parentNode.removeChild(tagMenu);//删除当前标签

var color=tagMenu.style.backgroundColor;

//设置如果关闭一个标签时,让最后一个标签得到焦点

if(color=="#ffff00"||color=="yellow"){//区别浏览器对颜色解释

if(tags.length-1>=0){

clearStyle();

tags[tags.length-1].style.backgroundColor="yellow";

clearContent();

var cc=tags[tags.length-1].id.split("p");

$("c"+cc[1]).style.display="block";

}

else{

clearContent();

$("welcome").style.display="block"

}

}

}

menu.appendChild(tagMenu);

}

//清除标签样式

function clearStyle(){

for(i=0;i

menu.getElementsByTagName("li")[i].style.backgroundColor="#FFCC00";

}

}

//清除内容

function clearContent(){

for(i=0;i<7;i++){

$("c"+i).style.display="none";

}

}

}

管理菜单

  • 个人资料
  • 相册管理
  • 日志管理
  • 留言管理
  • 风格管理
  • 系统管理
  • 帮助信息

欢迎使用用户管理系统!

个人资料
相册管理
日志管理
留言管理
风格管理
系统管理
帮助信息

d7df01d2c1c9ae0dedeb2dbbc6e3a657.png

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的蔡徐坤偶像界面HTMLCSS 代码示例: HTML 代码: ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>蔡徐坤个人网站</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="header"> <h1>蔡徐坤</h1> <nav> <ul> <li><a href="#">首页</a></li> <li><a href="#">音乐</a></li> <li><a href="#">视频</a></li> <li><a href="#">资讯</a></li> </ul> </nav> </div> <div class="banner"> <img src="https://i.loli.net/2021/09/09/XH6n3t2s9fZcYKv.png" alt="蔡徐坤"> </div> <div class="content"> <h2>蔡徐坤简介</h2> <p>蔡徐坤,1998年8月2日出生于湖南省长沙市,中国内地男歌手、演员、舞者。2014年,蔡徐坤在全国舞蹈比赛《中华舞蹈大赛》中获得全国总冠军。2016年,参加选秀节目《燃烧吧少年》获得冠军。2017年,以练习生身份参加选秀节目《偶像练习生》。</p> <h2>蔡徐坤作品</h2> <ul> <li><a href="#">1. 《No Exception》</a></li> <li><a href="#">2. 《You Can Be My Girl》</a></li> <li><a href="#">3. 《Wait Wait Wait》</a></li> <li><a href="#">4. 《I Wanna Get Love》</a></li> </ul> </div> <div class="footer"> <p>© 2021 蔡徐坤个人网站</p> </div> </body> </html> ``` CSS 代码: ``` /* 全局样式 */ body { margin: 0; padding: 0; font-family: Arial, sans-serif; } /* 头部样式 */ .header { background-color: #333; color: #fff; padding: 10px; } .header h1 { margin: 0; font-size: 32px; } .header nav ul { margin: 0; padding: 0; list-style: none; } .header nav ul li { display: inline-block; } .header nav ul li a { display: block; padding: 10px 20px; color: #fff; text-decoration: none; } .header nav ul li a:hover { background-color: #555; } /* 横幅样式 */ .banner img { display: block; margin: 0 auto; max-width: 100%; height: auto; } /* 内容样式 */ .content { padding: 20px; } .content h2 { margin-top: 0; } .content ul { margin: 0; padding: 0; list-style: none; } .content ul li { margin-bottom: 10px; } .content ul li a { color: #333; text-decoration: none; } .content ul li a:hover { text-decoration: underline; } /* 底部样式 */ .footer { background-color: #333; color: #fff; text-align: center; padding: 10px; } ``` 你可以将上述代码保存为 `index.html` 和 `style.css` 文件,然后在浏览器中打开 `index.html` 文件,查看效果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值