合并两段HTML代码

weixin_38473303 2018-12-23 09:01:14

两段代码单独运行没有问题,合并到一起后,浮动按钮的代码不运行了。请老师指教,应该怎样合并,谢谢!
第一段代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
</head>
<style>
/* 浮动列表==================================================== */
tr>td>div>ul{
position: fixed;
top: 0px;
left: 0px;
}
/* 列表样式=================================================== */
*{ margin:0px; padding:0px; font-family:雅黑; font-size:14px; }
#menu{ width:150px; padding: 50px; } /* 列表与div的距离 */
#menu ul{ list-style:none; background-color: #f4f4f4; position: fixed;padding: 30px;} /* 列表的衬托 */
#menu ul li{ height:30px; line-height:30px; margin-top: 10px;}
#menu ul li:nth-child(1){
margin-top: 0;
}
#menu ul li a{width:149px;color: #666;text-decoration: none;display: block;border:1px solid
blue;padding-left:10px;padding-right:10px;transition: all 0.5s;/*所有改变产生0.5秒的过度效果*/}
#menu ul li a:hover{ color: #fff;border: 1px solid #f66;background-color: #f66;}
#合议笔录题目{
min-height:60px;
text-align:center; /* 文字居中 */
font-family:方正小标宋简体; /* 字体 */
font-size:30px; /* 字体大小 */
}
#合议时间{
text-indent:2em; /* 字体大小 */
}
#合议地点{
text-indent:2em;
}
#合议列席人员{
text-indent:2em;
}
#合议之记录人员{
text-indent:2em;
}
#合议之评议事项{
text-indent:2em; /* 段落缩进40px */
}
#合议之评议内容{
text-indent:2em;
}
#合议之评议结论{
text-indent:2em;
}

div{
margin:30px;
max-width:1200px; /* 宽度800 */
width:auto;
min-height:20px; /* 最小高度20 */
padding:3px; /* 内边距 */
line-height:30px; /* 文本行高30 */
text-indent:40px /* 段落缩进40px */
word-wrap:break-word; /* 允许长单词换行到下一行 */
overflow-x:hidden; /* 没有水平滚动条 */
overflow-y:auto; /* 竖向滚动条自动 */
font-family:正文字体; /* 字体 仿宋_GB2312*/
color:字体颜色; /* 字体颜色 blue*/
font-size:正文字号px; /* 字体大小 22px*/
margin:2px auto; /* div间距、水平居中 */
}
div>p{
font-family:正文字体; /* 字体 仿宋_GB2312*/
color:字体颜色; /* 字体颜色 blue*/
font-size:正文字号px; /* 字体大小 22px*/
}
.border{
border: 1px solid #FF0000; /* div边框颜色 #FF0000*/
}
/* 列表项背景色跟随焦点div变化========================= */
.listyle{
background-color:#f66 !important;
width:170px !important;
}
</style>
<body>
<body bgcolor="网页背景"> /* 网页背景颜色 "#FFFFF0"*/
<table border=0 width="100%">
<tr>
<td width="150px"
valign="top"
line-height:30px; >
<div id="menu">
<ul>
<li><a href="合议笔录.html#合议笔录题目">合议笔录题目</a></li>
<li><a href="合议笔录.html#合议时间">合议时间</a></li>
<li><a href="合议笔录.html#合议地点">合议地点</a></li>
<li><a href="合议笔录.html#合议列席人员">合议列席人员</a></li>
<li><a href="合议笔录.html#合议之记录人员">合议之记录人员</a></li>
<li><a href="合议笔录.html#合议之评议事项">合议之评议事项</a></li>
<li><a href="合议笔录.html#合议之评议内容">合议之评议内容</a></li>
<li><a href="合议笔录.html#合议之评议结论">合议之评议结论</a></li>
</ul>
</div>
</td>
<td>
<div class="abc" ID="合议笔录题目" onpaste="divOnPaste(this)" contenteditable="true" onclick="setClick(1)" onblur="setBlur(this,'合议笔录题目-行政一审裁定驳回起诉-行政一审裁定驳回起诉')" onfocus="setFocus(this,'合议笔录题目-行政一审裁定驳回起诉');">绑定行政一审裁定驳回起诉合议笔录题目</div>
<div class="abc" ID="合议时间" onpaste="divOnPaste(this)" contenteditable="true" onclick="setClick(2)" onblur="setBlur(this,'合议时间-行政一审裁定驳回起诉-行政一审裁定驳回起诉')" onfocus="setFocus(this,'合议时间-行政一审裁定驳回起诉');">绑定行政一审裁定驳回起诉合议时间</div>
<div class="abc" ID="合议地点" onpaste="divOnPaste(this)" contenteditable="true" onclick="setClick(3)" onblur="setBlur(this,'合议地点-行政一审裁定驳回起诉-行政一审裁定驳回起诉')" onfocus="setFocus(this,'合议地点-行政一审裁定驳回起诉');">绑定行政一审裁定驳回起诉合议地点</div>
<div class="abc" ID="合议列席人员" onpaste="divOnPaste(this)" contenteditable="true" onclick="setClick(4)" onblur="setBlur(this,'合议列席人员-行政一审裁定驳回起诉-行政一审裁定驳回起诉')" onfocus="setFocus(this,'合议列席人员-行政一审裁定驳回起诉');">绑定行政一审裁定驳回起诉合议列席人员</div>
<div class="abc" ID="合议之记录人员" onpaste="divOnPaste(this)" contenteditable="true" onclick="setClick(5)" onblur="setBlur(this,'合议之记录人员-行政一审裁定驳回起诉-行政一审裁定驳回起诉')" onfocus="setFocus(this,'合议之记录人员-行政一审裁定驳回起诉');">绑定行政一审裁定驳回起诉合议之记录人员</div>
<div class="abc" ID="合议之评议事项" onpaste="divOnPaste(this)" contenteditable="true" onclick="setClick(6)" onblur="setBlur(this,'合议之评议事项-行政一审裁定驳回起诉-行政一审裁定驳回起诉')" onfocus="setFocus(this,'合议之评议事项-行政一审裁定驳回起诉');">绑定行政一审裁定驳回起诉合议之评议事项</div>
<div class="abc" ID="合议之评议内容" onpaste="divOnPaste(this)" contenteditable="true" onclick="setClick(7)" onblur="setBlur(this,'合议之评议内容-行政一审裁定驳回起诉-行政一审裁定驳回起诉')" onfocus="setFocus(this,'合议之评议内容-行政一审裁定驳回起诉');">绑定行政一审裁定驳回起诉合议之评议内容</div>
<div class="abc" ID="合议之评议结论" onpaste="divOnPaste(this)" contenteditable="true" onclick="setClick(8)" onblur="setBlur(this,'合议之评议结论-行政一审裁定驳回起诉-行政一审裁定驳回起诉')" onfocus="setFocus(this,'合议之评议结论-行政一审裁定驳回起诉');">绑定行政一审裁定驳回起诉合议之评议结论</div>
</td>
</tr>
</table>
</body>
<script>
/* 粘贴事件-去掉网页格式标签=======/<(?:.|\s)*?>/g===或====/<\/?.+?>/g==或保留br和p标签==/<\/?(?!br|p)[^>]*>/ig;============= */
String.prototype.stripHTML = function () { var reTag = /<(?:.|\s)*?>/g; return this.replace(reTag, "<p>"); } //所有标签替换为<p>
function divOnPaste(d) { setTimeout(function () { d.innerHTML = d.innerHTML.stripHTML(); }, 10); }
/* 列表项背景色跟随焦点div变化============================================ */
function setClick(num){
var theNumber=parseInt(num)-1;
var liList=document.getElementsByTagName("li");
var listLength=liList.length;
for(var i=0;i<listLength;i++){
liList[i].className="";
}
liList[theNumber].className="listyle";
}
/* ======================================================================== */
function setFocus(obj,str2) {
obj.setAttribute("class", "border");
window.external.setPosition(str2);
}
function setBlur(obj, str2) {
obj.setAttribute("class", "");
/* window.external.setCurrentValue(obj.innerHTML, str2); */
window.external.setCurrentValue(obj.innerText, str2);
}
function init(s1, s2, s3, s4, s5, s6, s7, s8) {
document.getElementById("合议笔录题目").innerHTML = s1.replace(/\r\n/g,"<p>");
document.getElementById("合议时间").innerHTML = s2.replace(/\r\n/g,"<p>");
document.getElementById("合议地点").innerHTML = s3.replace(/\r\n/g,"<p>");
document.getElementById("合议列席人员").innerHTML = s4.replace(/\r\n/g,"<p>");
document.getElementById("合议之记录人员").innerHTML = s5.replace(/\r\n/g,"<p>");
document.getElementById("合议之评议事项").innerHTML = s6.replace(/\r\n/g,"<p>");
document.getElementById("合议之评议内容").innerHTML = s7.replace(/\r\n/g,"<p>");
document.getElementById("合议之评议结论").innerHTML = s8.replace(/\r\n/g,"<p>");
}
function setElementFocus(name) {
var obj = document.getElementById(name);
if(obj != null) {
obj.focus();
setFocus(obj);
location.href = "#" + name;
}
}
</script>
</html>


第二段代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>右侧悬浮菜单</title>

<style type="text/css">
/* reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0}
fieldset,img{border:0;}
:focus{outline:0;}
ol,ul{list-style:none;list-style-position:outside;}
table{border-collapse:collapse;border-spacing:0;}
address,caption,cite,code,dfn,em,i,strong,th,var,optgroup{font-style:normal;font-weight:normal;}
body,button,input,select,textarea{font:12px/1.5 微软雅黑,arial,sans-serif;}
button,input,select,textarea,h1,h2,h3,h4,h5,h6{font-size:100%;}
body{color:#333;min-width: 1120px;}
a{color:#333;text-decoration:none;}
a:hover{color:#f60;text-decoration:underline;}
a:hover em,a:hover i,a:hover span{cursor:pointer;}
.cf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
.cf{*zoom:1;}

/*** guide ***/
.guide{width:60px;margin-left:770px;position:fixed;left:50%;bottom:134px;_position:absolute;_top:expression(documentElement.scrollTop+documentElement.clientHeight - this.clientHeight - 134+'px');display:block;}
.guide a{display:block;width:60px;height:50px;background:url(images/sprite_v2.png) no-repeat;margin-top:10px;text-decoration:none;font:16px/50px "Microsoft YaHei";text-align:center;color:#fff;border-radius:2px;}
.guide a span{display:none;text-align:center;}
.guide a:hover{text-decoration:none;background-color:#39F;color:#fff;}
.guide a:hover span{display:block;width:60px;background:#39F}
.guide .find{background-position:-84px -236px;}
.guide .report{background-position:-146px -236px;}
.guide .edit{background-position:-83px -185px;}
.guide .top{background-position:-145px -185px;}
</style>

</head>
<body>

<div style="height:1000px;"></div>
<script src="/demos/googlegg.js"></script>
<div class="guide">
<div class="guide-wrap">
<a href="#" class="edit" title="背景"><span onclick="window.external.funcInFoxtable('背景窗口');">背景</span></a>
<a href="#" class="find" title="帮助"><span onclick="window.external.funcInFox('帮助.txt');">帮助</span></a>
<a href="#" class="report" title="信息"><span onclick="window.external.funcInFoxtable('文书信息');">信息</span></a>
<a href="javascript:window.scrollTo(0,0)" class="top" title="回顶部"><span>回顶部</span></a>
</div>
</div>

<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">


</div>
</body>

</html>


...全文
295 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
winzond 2018-12-23
  • 打赏
  • 举报
回复
第二段代码要链接JS文件,没法测试,其实你可以直接可以审核元素,看看是哪里的样式表有冲突,找到冲突点,你就能解决了
weixin_38473303 2018-12-23
  • 打赏
  • 举报
回复
引用 1 楼 winzond 的回复:
第二段代码要链接JS文件,没法测试,其实你可以直接可以审核元素,看看是哪里的样式表有冲突,找到冲突点,你就能解决了


谢谢指教!已解决。

61,129

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧