Dreamweaver 按钮链接 CSS 帮助
大家好,我目前在 CSS 链接方面遇到问题。基本上,我希望当我将鼠标悬停在链接上并单击它们等时,链接的颜色会发生变化。但由于某种原因,当我在浏览器上查看它时,它不起作用。下面是我的 HTML 代码和 CSS 代码,它们是单独的文件并链接在一起。提前致谢。 (如果代码显示不正确,我深表歉意,但它都在那里)
编辑:不用担心它现在已修复:D 感谢您的帮助
Hey guys I'm currently having trouble with my CSS linking. Basically I want the colour of my links to change when I hover over them, and click on them and such. But for some reason it is not working when I view it on a browser. Below is my HTML code and my CSS code, they are seperate files and are linked togather. Thanks in advance. (I apologise if the codes are not appearing correctly but it is all there)
EDIT: Don't worry its fixed now :D thanks for the help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,您没有在任何地方定义 a:hover、a:vistied 或 a:active ,这就是控制您正在寻找的行为的原因。
from what I see, you don't have a:hover,a:vistied, or a:active defined anywhere, which is what controls the behavior you're looking for.
您是手动编码还是使用 Dreamweaver 作为所见即所得?
注意:这可能是因为您的问题中的文件格式不正确,因此 Markdown 可能会从显示中删除一些字符。
据我所知,CSS 文件编写不正确。我将为您提供一个适合整个文件的示例:
上面的代码片段在 HTML 中查找
标记,当找到该标记时,它会给出它宽度为 510px 并向左浮动。这里的问题是 HTML 页面或 HTML 4.01 本身没有
标记。您需要做的是将其更改为:通过添加“.”在 CSS 中的“content”之前,它将“content”从
更改为查找具有class="content"
作为属性的标记。另外,要使
标签在悬停时更改等,请使用
:hover
、的伪元素(伪属性?): active
和:visited
分别表示用户将鼠标悬停在链接上、单击链接以及之前访问过链接时的情况。示例:
在此示例中,除非用户将鼠标放在链接上,否则链接将显示为蓝色。
Are you coding by hand or using Dreamweaver as a WYSIWYG?
NOTE: This could be because the files aren't formatted well in your question, so Markdown could have dropped some characters from the display.
From what I can see, the CSS file isn't written correctly. I'm going to give one example for you which fits for the whole file:
This snippet above looks for the
<content>
tag in the HTML, and when it finds that tag, it will give it a width of 510px and floats it to the left. The problem here is that there are no<content>
tags in your HTML page OR in HTML 4.01 itself. What you need to do is change it to this:By adding the '.' before 'content' in the CSS, it changes 'content' from
<content>
to finding a tag that hasclass="content"
as an attribute.Also, to get the
<a>
tags to change on hover, etc, use the pseudo-elements (pseudo-attributes?) of:hover
,:active
, and:visited
, for when a user hovers over a link, clicks on a link, and has previously visited a link, respectively.Example:
In this example, a link will display as blue unless the user has their mouse on the link.