< a href =“#"是什么意思? class ="view">意思是? [英] What does <a href="#" class="view"> mean?

查看:96
本文介绍了< a href =“#"是什么意思? class ="view">意思是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的html页面中,我看到一个链接,其查看源代码"如下:

In my html page, I see a link whose 'view source' code is as below :

<a href="#" class="view">

当我将鼠标悬停在该链接上并单击它时,它会显示一个有效的链接.但是我无法找到此URL的生成位置和生成方式.我发现在一个CSS中定义了a.view类,但在页面源中找不到URL.有人可以帮我找到该URL吗?

I see a valid link when I hover my mouse on it and when I click it, it works. But I am not able to find where and how this URL gets generated. I found the class a.view being defined in one of the CSS, but couldn't find the URL in the page source.. Can somebody help me out on whr i can find this URL ?

推荐答案

我也想回复,对同一事物的解释与其他事物有所不同.我相信您大部分都知道,但这可能会对其他人有所帮助.

I felt like replying as well, explaining the same thing as the others a bit differently. I am sure you know most of this, but it might help someone else.

<a href="#" class="view">

The

href="#"

part是确保链接不会自行指向的常用方法. #属性用于创建指向同一文档中其他部分的链接.例如,点击以下链接:

part is a commonly used way to make sure the link doesn't lead anywhere on it's own. the #-attribute is used to create a link to some other section in the same document. For example clicking a link of this kind:

<a href="#news">Go to news</a>

将带您到任何地方

<a name="news"></a>

代码.因此,如果您指定#时不带任何名称(例如您的情况),则该链接将无处可通.

code. So if you specify # without any name like in your case, the link leads nowhere.

The

class="view"

part为它提供了CSS或javascript可以使用的标识符.在CSS文件中(如果有的话),您将在所有标记有"view"类的元素上找到特定的样式化过程.

part gives it an identifier that CSS or javascript can use. Inside the CSS-files (if you have any) you will find specific styling procedures on all the elements tagged with the "view"-class.

要找出指定URL的位置,请查看 javascript代码.它可以直接写在同一文档中,也可以包含在另一个文件中.

To find out where the URL is specified I would look in the javascript code. It is either written directly in the same document or included from another file.

在源代码中搜索类似的内容:

Search your source code for something like:

<script type="text/javascript"> bla bla bla </script>

<script> bla bla bla </script>

,然后搜索对您的视图"类的任何引用.随附的javascript文件可能如下所示:

and then search for any reference to your "view"-class. An included javascript file can look something like this:

<script type="text/javascript" src="include/javascript.js"></script>

在这种情况下,请在"include"文件夹下打开javascript.js并在该文件中进行搜索.最常见的是,include包含在<head></head>之间或靠近</body> -tag.

In that case, open javascript.js under the "include" folder and search in that file. Most commonly the includes are placed between <head> and </head> or close to the </body>-tag.

查找链接的更快方法是搜索链接到的实际链接.例如,如果您被定向到 http://www.google.com/search?q=html 单击它时,在您的Web项目中所有文件中搜索"google.com"或其他内容,只需记住其中包含的文件即可.

A faster way to find the link is to search for the actual link it goes to. For example, if you are directed to http://www.google.com/search?q=html when you click it, search for "google.com" or something in all the files you have in your web project, just remember the included files.

在许多文本编辑器中,您可以一次打开所有文件,然后在所有文件中搜索某些内容.

In many text editors you can open all the files at once, and then search in them all for something.

这篇关于&lt; a href =“#"是什么意思? class ="view"&gt;意思是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆