Table of Contents
回复讨论(解决方案)
Home Web Front-end HTML Tutorial Can any hero give me some advice? . . _html/css_WEB-ITnose

Can any hero give me some advice? . . _html/css_WEB-ITnose

Jun 24, 2016 pm 12:22 PM

<!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" mrc="text/html; charset=gb2312" /><style type="text/css"><!--body { padding:0; margin:0; }a.oyj-clj:link{color:#FFFFFF;}a.oyj-clj:visited{color:#FFFFFF;}a.oyj-clj:hover{color:#FFFF00;}a.oyj-clj:active{color:#FFFFFF;}a.oyj-clj:link{text-decoration:none;} #oyj-oyj-ul {width:1000px;background-color:#000000;}#oyj-logo {padding-top:10px;margin-left:10px;height:109px;width:255px;position:absolute;}#oyj-huanying {height:20px;width:1000px;padding-top:10px;margin-left:0px;font-size:12px;color:#FFFFFF;}#oyj-ding {height:25px;width:1000px;}#oyj-zhuce {font-size:12px;padding-top:0;width:80px;height:20px;float:right;color:#FFFFFF;}#oyj-tel {font-size:12px;width:100px;height:20px;float:right;color:#ffffff;}#oyj-menu {height:20px;width:600px;padding-top:80px;margin-left:400px;}#oyj-menu ul li {color: #FFFFFF;float: left;font-size: 12px;	padding:0; 	margin:0;	list-style:none;}#oyj-menu ul {margin:0px auto 0px auto;padding:0; 	margin:0;	float:right;}#oyj-tel {font-size:12px;color:#ffffff;height:20px;width:300pxpadding-top:50px;margin-left:700px;}#oyj-ul {line-height: 24px;list-style-type: none;background:#666;}#oyj-ul a {display: block;width: 80px;text-align:center;}#oyj-ul a:link {color:#ffffff;/*未点击时链接字体颜色*/text-decoration:none;}#oyj-ul a:visited {color:#FFFFff;text-decoration:none;}#oyj-ul a:hover {color:#FFFF00;text-decoration:none;font-weight:bold;}#oyj-ul li {float: left;width: 80px;background:#FF0099;/*主导航条背景*/}#oyj-ul li a:hover {background:#FF66CC;/*鼠标移位颜色*/}#oyj-ul li ul {line-height: 27px;list-style-type: none;text-align:left;left: -999em;width: 80px;position: absolute;}#oyj-ul li ul li {float: left;width: 100px;background: #000000;/*子菜单背景*/}#oyj-ul li ul a {display: block;width: 100px;text-align:center}#oyj-ul li ul a:link {color:#ffffff;text-decoration:none;}#oyj-ul li ul a:visited {color:#ffffff;text-decoration:none;}#oyj-ul li ul a:hover {color:#F3F3F3;text-decoration:none;font-weight:normal;background:#C00;}#oyj-ul li:hover ul {left: auto;}#oyj-ul li.sfhover ul {left: auto;}#content {clear: left;}--></style><script type=text/javascript><!--//--><![CDATA[//><!--function menuFix() {var sfEls = document.getElementById("oyj-ul").getElementsByTagName("li");for (var i=0; i<sfEls.length; i++) {sfEls[i].onmouseover=function() {this.className+=(this.className.length>0? " ": "") + "sfhover";}sfEls[i].onMouseDown=function() {this.className+=(this.className.length>0? " ": "") + "sfhover";}sfEls[i].onMouseUp=function() {this.className+=(this.className.length>0? " ": "") + "sfhover";}sfEls[i].onmouseout=function() {this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),"");}}}window.onload=menuFix;//--><!]]></script><body><div id=oyj-header style="width: 100%; background-color:#000000; height:129px;"><div id=oyj-oyj-ul style="width:1000px;  margin:0 auto;"><div id=oyj-ding><div id=oyj-huanying>*欢迎来到达诚网络,我们会用我们的真诚为您服务*                                                                                                                                                                                                                                                                         联系电话:18672175995<div id=oyj-zhuce><a href="#" class="oyj-clj">登陆</a><a href="#" class="oyj-clj">注册</a></div><div align="right"></div></div></div><div id=oyj-logo><img src="1.png" width="252" height="109" /></div><div id=oyj-menu><ul id="oyj-ul"><li><a href="#">首页</a></li><li><a href="#">虚拟主机</a><ul><li><a href="#">国内主机</a></li><li><a href="#">香港主机</a></li><li><a href="#">美国主机</a></li></ul></li><li><a href="#">云VPS</a><ul><li><a href="#">国内云VPS</a></li><li><a href="#">香港云VPS</a></li><li><a href="#">美国云VPS</a></li></ul></li><li><a href="#">免费CDN</a></li><li><a href="#">服务器租用</a><ul><li><a href="#">国内服务器租用</a></li><li><a href="#">香港服务器租用</a></li><li><a href="#">美国服务器租用</a></li></ul></li><li><a href="#">帮助中心</a></li></ul></div></div></div></body></head>
Copy after login

在oyj-logo上 CSS有position:absolute;在本地预览页面正常,在服务器预览会错位,怎样修改达到完美效果?


回复讨论(解决方案)

你那么多 是用来做什么的?定位的么?用空格来定位?好吧,I have no words to say...

贴个你说的乱的网址瞧瞧

贴个你说的乱的网址瞧瞧
http://oyj424.ceshiyuming.yousn-cn.vip3237.net/templets/default/header.html

试试加个top试试

#oyj-logo {padding-top:10px;margin-left:10px;height:109px;width:255px;position:absolute;top:15px;}
Copy after login

用你给的网页另存为改的:

<!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=gb2312" mrc="text/html; charset=gb2312" /><style type="text/css"><!--body { padding:0; margin:0; }a.oyj-clj:link{color:#FFFFFF;}a.oyj-clj:visited{color:#FFFFFF;}a.oyj-clj:hover{color:#FFFF00;}a.oyj-clj:active{color:#FFFFFF;}a.oyj-clj:link{text-decoration:none;} #oyj-oyj-ul {width:1000px;background-color:#000000;}#oyj-logo {	padding-top:10px;	margin-left:10px;	height:109px;	width:255px;	position:absolute;	zoom:1;	top:15px;}#oyj-huanying {height:20px;width:1000px;padding-top:10px;margin-left:0px;font-size:12px;color:#FFFFFF;}#oyj-ding {height:25px;width:1000px;}#oyj-zhuce {font-size:12px;padding-top:0;width:80px;height:20px;float:right;color:#FFFFFF;}#oyj-tel {font-size:12px;width:100px;height:20px;float:right;color:#ffffff;}#oyj-menu {height:20px;width:600px;padding-top:80px;margin-left:400px;}#oyj-menu ul li {color: #FFFFFF;float: left;font-size: 12px;	padding:0; 	margin:0;	list-style:none;}#oyj-menu ul {margin:0px auto 0px auto;padding:0; 	margin:0;	float:right;}#oyj-tel {font-size:12px;color:#ffffff;height:20px;width:300pxpadding-top:50px;margin-left:700px;}#oyj-ul {line-height: 24px;list-style-type: none;background:#666;}#oyj-ul a {display: block;width: 80px;text-align:center;}#oyj-ul a:link {color:#ffffff;/*未点击时链接字体颜色*/text-decoration:none;}#oyj-ul a:visited {color:#FFFFff;text-decoration:none;}#oyj-ul a:hover {color:#FFFF00;text-decoration:none;font-weight:bold;}#oyj-ul li {float: left;width: 80px;background:#FF0099;/*主导航条背景*/}#oyj-ul li a:hover {background:#FF66CC;/*鼠标移位颜色*/}#oyj-ul li ul {line-height: 27px;list-style-type: none;text-align:left;left: -999em;width: 80px;position: absolute;}#oyj-ul li ul li {float: left;width: 100px;background: #000000;/*子菜单背景*/}#oyj-ul li ul a {display: block;width: 100px;text-align:center}#oyj-ul li ul a:link {color:#ffffff;text-decoration:none;}#oyj-ul li ul a:visited {color:#ffffff;text-decoration:none;}#oyj-ul li ul a:hover {color:#F3F3F3;text-decoration:none;font-weight:normal;background:#C00;}#oyj-ul li:hover ul {left: auto;}#oyj-ul li.sfhover ul {left: auto;}#content {clear: left;}--></style><script type=text/javascript><!--//--><![CDATA[//><!--function menuFix() {var sfEls = document.getElementById("oyj-ul").getElementsByTagName("li");for (var i=0; i<sfEls.length; i++) {sfEls[i].onmouseover=function() {this.className+=(this.className.length>0? " ": "") + "sfhover";}sfEls[i].onMouseDown=function() {this.className+=(this.className.length>0? " ": "") + "sfhover";}sfEls[i].onMouseUp=function() {this.className+=(this.className.length>0? " ": "") + "sfhover";}sfEls[i].onmouseout=function() {this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),"");}}}window.onload=menuFix;//--><!]]></script><body><div id=oyj-header style="width: 100%; background-color:#000000; height:129px;"><div id=oyj-oyj-ul style="width:1000px;  margin:0 auto;"><div id=oyj-ding><div id=oyj-huanying>*欢迎来到达诚网络,我们会用我们的真诚为您服务*                                                                                                                                                                                        联系电话:11111111<div id=oyj-zhuce><a href="#" class="oyj-clj">登陆</a><a href="#" class="oyj-clj">注册</a></div><div align="right"></div></div></div><div id=oyj-ding2 style="width:1000px; height:109;"><div id=oyj-logo><img src="http://oyj424.ceshiyuming.yousn-cn.vip3237.net/1.png" width="252" height="109" /></div><div id=oyj-menu><ul id="oyj-ul"><li><a href="#">首页</a></li><li><a href="#">虚拟主机</a><ul><li><a href="#">国内主机</a></li><li><a href="#">香港主机</a></li><li><a href="#">美国主机</a></li></ul></li><li><a href="#">云VPS</a><ul><li><a href="#">国内云VPS</a></li><li><a href="#">香港云VPS</a></li><li><a href="#">美国云VPS</a></li></ul></li><li><a href="#">免费CDN</a></li><li><a href="#">服务器租用</a><ul><li><a href="#">国内服务器租用</a></li><li><a href="#">香港服务器租用</a></li><li><a href="#">美国服务器租用</a></li></ul></li><li><a href="#">帮助中心</a></li></ul></div></div></div></div></body></head>
Copy after login

改了两个地方:
1
#oyj-logo {
    padding-top:10px;
    margin-left:10px;
    height:109px;
    width:255px;
    position:absolute;
    zoom:1;
    top:15px;
}
2
div id=oyj-ding2删除position:absolute

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

See all articles