不知道为什么,给div里面的文字设置超链接,但就是点不过去
这是CSS代码:
#container { margin:0 auto; width:1200px; }#header { height:110px; background:#87CEEB;filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; }#menu { height:30px; background:#09c;filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; }#mainContent { height:600px;filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; }#sidebar { float:left; width:200px; height:600px; background:#9ff;filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; }#sidebar2 { float:right; width:200px; height:600px; background:#9ff;filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; }#content { height:600px; background:#cff;filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; }#footer { height:60px; background:#6cf;filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; }
这是页面代码:
<body> <div id="container"> <div id="header"> <div id="up_left"> <h3 id="您好-欢迎光临论坛">您好,欢迎光临论坛!</h3> <script type="text/javascript"> var d = new Date() document.write(d.getFullYear() + '年' + (d.getMonth() + 1) + '月' + d.getDate() + '日' + ' 星期' + '日一二三四五六'.charAt(new Date().getDay())); </script> </div> <div id="up_right"> <form action="user/login.action" method="post"> 姓名: <input type="text" name="userName" id="userName"> 密码: <input type="password" name="password" id="password"> <input type="submit" value="登录" /> <a href="user/register.action">点击注册....</a> </form> </div> </div> <div id="menu"><a href="diary/main.jsp">平凡的世界</a></div> <div id="mainContent"> <div id="sidebar"><a href="diary/main.jsp">平凡的世界</a></div> <div id="sidebar2"><a href="diary/main.jsp">平凡的世界</a></div> <div id="content"><a href="diary/main.jsp">平凡的世界</a></div> </div> <div id="footer"><a href="diary/main.jsp">平凡的世界</a></div> </div></body>
不用怀疑了,我给每个层都添加了这样的链接,其他的都可以,但就是id为"sidebar"和"sidebar2"的这两个层不行,
跳转不过去,这是为什么呢
回复讨论(解决方案)
你是给文字加了超链接,并不是div。
写成这样:
你是给文字加了超链接,并不是div。
写成这样:
我知道原因了,因为它是三个平行的层,"sidebar"和"sidebar2"分别是向左和向右的层,中间的"content"覆盖住了它们
然后我上网查了一下,说是用position:absoulte;z-index:5555;
为什么我加了没用啊
这个要怎样才能中间的"content"层浮到最下面去
margin-left: 100px;
你给content层定一个宽度800px;然后float:left.
好啦,我在content里面加了margin:0 200px;就刚好啦,谢谢啦

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

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

HTMLisaspecifictypeofcodefocusedonstructuringwebcontent,while"code"broadlyincludeslanguageslikeJavaScriptandPythonforfunctionality.1)HTMLdefineswebpagestructureusingtags.2)"Code"encompassesawiderrangeoflanguagesforlogicandinteract

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

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.

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.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

How to design the dotted line segmentation effect in the menu? When designing menus, it is usually not difficult to align left and right between the dish name and price, but how about the dotted line or point in the middle...


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1
Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.