href 相关问题

超链接(或链接)是对读者可以直接遵循或自动遵循的文档的引用。

关于:blank#blocked on <a href="file:///XXX">Link</a>(Markdown 页面)

在 Markdown 页面中(Microsoft TFS Wiki) 我尝试为文件链接创建 A 标签: 文件.txt 点击(Chrome)后,我得到了 关于:空白#被阻止

回答 2 投票 0

同一页面上页面其他部分的 Angular 17 独立链接

这是我定义链接的地方 这是我定义链接的地方 <div class="form-column"> <a href="#" (click)="scrollTo('form-container')" class="heading" >Book a Clarity Call</a > </div> 这是我定义id的地方 <div class="post-card-container" id="form-container"> 以下是我在组件内的函数 import { Cimport { Component, ElementRef } from '@angular/core'; import { CommonModule } from '@angular/common'; @Component({ selector: 'app-contact-us', standalone: true, imports: [CommonModule], templateUrl: './contact-us.component.html', styleUrl: './contact-us.component.scss', }) export class ContactUsComponent { constructor(private elementRef: ElementRef) {} scrollTo(elementId: string): void { const element = document.getElementById(elementId); if (element) { element.scrollIntoView({ behavior: 'smooth', block: 'start' }); } } } 我尝试将组件模板的一部分用作链接,单击该链接后,它必须将我带到模板中 id 所在的部分,但不起作用。 你的scrollTo方法有很多代码 只需将其更改为: scrollTo(elementId: string) { window.location.hash = elementId; }

回答 1 投票 0

为什么向我的图像添加属性链接会移动我的图像?

我正在尝试插入两个垂直堆叠的图像(弹性列),如果两个图像不在属性标签内,我可以这样做。但是,当我将它们放入标签中时,图片会偏移......

回答 2 投票 0

href 值我使用 Cheerio

我正在尝试使用cheerio进行抓取。不过我遇到了一个小问题。我在客户端获得的所有 href 值都以“/url?q=”开头。例如这样: '/url?q=https://www.nimh.ni...

回答 1 投票 0

通过href(html)发送数据并通过请求函数(django)获取

我有一个 html 页面,我在模型字段上循环。 html 是: {% for issues_list %} {{ Problem.id }} - {{ Problem.incident_date }} - {{ Problem.incident_specs }} - {{ 我有一个 html 页面,我在模型字段上循环。 HTML 是: {% for problem in problems_list %} <p> {{ problem.id }} - {{ problem.incident_date }} - {{ problem.incident_specs }} - {{ problem.incident_location }} - {{ problem.incident_reason }} {% for action in actions_list %} {% if action.action_incident_id_id == problem.id %} <form method="post"> <input hidden name='problem_id' value="{{ problem.id }} "> <a class="btn btn-primary" type="submit" href="{% url 'ex_action' %}"> Button </a> <!-- action="{% url 'ex_action' %}"--> </form> {% endif %} {% endfor %} </p> {% endfor %} 这是一个 ex_action 函数: def ex_action(request): return render(request, 'problems/ex_action.html', {'actions_list': actions_list}) 它工作得很好,但我需要将一个 Problem.id 从 for 循环传递到 ex_action 中,我不知道该怎么做。 我尝试了一些像href="{% url 'ex_action'?=problem_id=problem.id %}"这样的结构,并通过像request.GET.get('problem_id')或request.GET['problem_id']这样的东西来获取它,但是在html上得到了TemplateSyntaxError,在django代码或MultiValueDictKeyError上没有得到结果。 阅读了很多docs\issues,发现人们使用ajax\js来解决它,但我不知道如何解决。 请帮忙。 感谢 Zatigem 上面的回答(抱歉,花了很长时间 - 我试图应用你的答案,但忘记了),我们应该使用这样的结构: path('ex-action/int:problem_id',views.ex_action, name='ex_action'),将 Problem_id 传递给表单。 再次非常感谢,Zatigem!

回答 1 投票 0

如何超链接图像

我想要超链接图像,但如何向图像添加 href 标签? 当报告显示时,您... 我想超链接图像,但如何向图像添加 href 标签? <div class="laptop"> <img class='report' src="http://testtest/Report1.png"/> 当报告显示时,您可以单击它并转到该站点。 h1{ font-family: Arial Rounded MT Bold; font-size: 33px; color: #0F4194; float: left; margin: 50px 0px 15px 700px; } .laptop{ width:1024px; height:661px; float: center; margin-right: -150px; background: url('http://mlamannadev.com/Images/Laptop2.png'); background-repeat: no-repeat; background-position: top left; background-size: contain; width: 1024px; z-index:4; } .report{ position:absolute; animation:round 16s infinite; opacity:0; z-index:-1; margin-left: auto; margin-right: auto; display: block; } @keyframes round{ 25%{opacity:1;} 40%{opacity:0;} } img:nth-child(4){animation-delay:0s;} img:nth-child(3){animation-delay:4s;} img:nth-child(2){animation-delay:8s;} img:nth-child(1){animation-delay:12s;} <!DOCTYPE html> <html> <head> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <h1><center>Service Driven, Customer-Centric Solutions, <br> Empowered by Innovation.</center></h1> <div class="laptop"> <img class='report' src="http://mlamannadev.com/Images/Report1.png"/> <img class='report' src="http://mlamannadev.com/Images/Report2.png"/> <img class='report' src="http://mlamannadev.com/Images/Report3.png"/> <img class='report' src="http://mlamannadev.com/Images/Report2.png"/> </div> </body> </html> 将 <img> 标签放入 <a> 标签内并提供 href。 <a href="/link/to/site"> <img src="" /> </a> 正如其他人在评论中提到的,您希望将图像包围在锚点 <a> 标签中,并将 href 属性应用于锚点标签,就像普通的超链接一样。 这是直接来自 Carlton 提到的 W3 学校链接的代码。 <p> An image as a link: <a href="https://www.w3schools.com"> <img border="0" alt="W3Schools" src="logo_w3s.gif" width="100" height="100"> </a> </p> 要超链接图像,您可以使用带有 href 属性的 HTML a 标签,并将其包裹在图像的 img 标签周围。这是一个例子: <a href="https://www.example.com"><img src="image.jpg" alt="Description of the image"></a> 有两种方法可以实现这一目标! 方法1:使用锚标记 用锚标签 <img> 元素包裹 <a> 标签。 在开始的 <a> 标签中,添加 href 属性,后跟要链接到的 URL(用引号引起来)。 这是修改后的代码: <div class="laptop"> <a href="your_desired_link"> <img class='report' src="http://testtest/Report1.png"/> </a> </div> 方法2:使用CSS(用于背景图像) 如果您要链接的图像使用 CSS 设置为背景图像,您可以在锚标记中使用 background-image 属性。 以下是修改 CSS 的方法: .laptop { /* Existing styles */ background-image: url('http://mlamannadev.com/Images/Laptop2.png'); cursor: pointer; /* Add cursor pointer for hover effect */ } .laptop a { /* Wrap the styles within an anchor tag */ position: absolute; top: 0; left: 0; width: 100%; /* Set width and height to cover the entire element */ height: 100%; opacity: 0; /* Make the element invisible initially */ } .laptop:hover a { /* Change opacity on hover to show link functionality */ opacity: 0.7; /* Adjust opacity as desired */ } 补充说明: 请记住将“your_desired_link”替换为您要链接到的实际 URL。 您可以向 title 标签添加 <a> 属性,以提供将鼠标悬停在图像上时显示的描述性文本。 我希望这有帮助!

回答 4 投票 0

在用户首选搜索引擎中搜索的URL

我经常在描述中放置搜索链接。今天最新的是一篇关于图形编程的文章,我想说的是, 如果这有效,你应该看不到

回答 1 投票 0

将带 href 的超链接添加到命名格式 I18n vuejs

我查看了此页面上的 vue 文档,了解如何解决此问题:https://kazupon.github.io/vue-i18n/guide/formatting.html#named-formatting 我认为我的所有语法都是正确的并且......

回答 2 投票 0

使用WGET获取页面链接

抱歉,第一次使用这里。 我在用着 wget --spider --force-html -r -l5 http://example.com 2>&1 | grep '^--' | grep '^--' | awk '{print $3}' > urls.txt 它效果很好,但似乎没有复制...

回答 1 投票 0

从所有<a>标签获取href值,包括嵌套的<a>标签

我已经搜索了几个小时(不应该有任何重复)并尝试了许多不同的方法,使用RegEx(正则表达式)和DOMdocument,但没有成功。 非标准 HTML 代码:...

回答 3 投票 0

如何将 PHP 变量回显到样式表的 href 属性中测试网站

我有这三个文件: 索引.php 测试网站 我有这三个文件: index.php <?php include('variables.php') ?> <!DOCTYPE html> <html lang="en"> <head> <title>TestWebsite</title> <link rel="stylesheet" href="<?php echo($folder . 'css/styles.css')?>"> </head> 变量.php <?php $folder = "C:/xampp/htdocs/Website/"; css/styles.css /* Insert styling stuff here */ index.php和variables.php存储在根目录下。由于某种原因,样式表拒绝链接,我需要帮助找出原因。不过这工作得很好: <link rel="stylesheet" href="styles.css"> 尝试将 <?php echo($folder . 'css/styles.css')?> 放入单独的 php 文件中,看看我是否正确附加了目录。 尝试将 styles.css 从其父文件夹移动到主目录中 试过 <link rel="stylesheet" href="<?php echo $folder ?>css/styles.css"> 在index.php中有使用$folder的include()并且工作得很好。 我开始怀疑这是否是范围问题 您没有为本地文件路径指定协议。在这种情况下,它是协议路径file://。

回答 1 投票 0

如何通过reactjs/nextjs中的Link href传递查询?

我试图通过我的链接href传递查询参数,但查询似乎没有通过。单击此处的编辑按钮后,我所通过的查询无处可寻...

回答 1 投票 0

从无头浏览器页面中的第一个表获取href链接(playwright._impl._errors.Error:事件循环已关闭!Playwright是否已停止?)

我试图从无头浏览器页面的第一个表中获取 href 链接,但该错误对我没有帮助,因为它没有告诉我它是什么,只是下面有很多 ^ 符号。 我不得不换...

回答 1 投票 0

从无头浏览器页面中的第一个表获取href链接

我试图从无头浏览器页面的第一个表中获取 href 链接,但该错误对我没有帮助,因为它没有告诉我它是什么,只是下面有很多 ^ 符号。 我不得不切换到

回答 1 投票 0

为什么 Facebook Business 登录 Instagram 在连接到 Instagram 时卡住了?

我正在尝试为 Instagram 实现 facebook 业务登录。下面是我构建的 url 和调用该 URL 的 href 标记。但是,流程在连接到 Instagram 时卡住并出现错误 辉...

回答 2 投票 0

如何在 Discord 网站上创建共享按钮?

我的意思是,就像一个 URL,用户可以单击该 URL 打开 Discord 应用程序或网站并预先编写一条 Discord 消息,准备发送。 我需要类似于 mailto: 的链接,我可以在其中设置消息...

回答 2 投票 0

添加 href 和 id 属性会导致框架错误

获取图像列表后,我想将它们显示在网格上;它在修补框架后工作,但它不断吐出以下错误: TypeError: win[(("HTML" + (intermediate value...

回答 1 投票 0

是否有一个 URL 参数可以使 URL 在专门命名的浏览器窗口中打开

我有一份电子邮件摘要,每天发送给我网站的用户,其中包含指向网站上内容的链接,以便他们可以轻松地进入并开始通过电子邮件进行交互。问题是,如果...

回答 4 投票 0

如何从带有id的链接打开模态框?

我有一个链接,当用户单击它时,将显示一个包含以下内容的模式: 我有一个链接,当用户单击它时,将显示一个包含以下内容的模式: <?php include ('dbcontroller.php'); if(isset($_GET['view_id'])) { $id=$_GET['view_id']; $sql = mysqli_query($conn, "SELECT * from press where id='$id'"); $row = mysqli_fetch_array($sql); ?> <input type="hidden" value="<?php echo $row['id']; ?>" /> <?php echo $row['reason']; ?> <a href="index.php" class="btn btn-primary">GO BACK</a> <?php } $conn->close(); ?> 上面的代码是我所做的,这样当用户单击链接时,它会将他重定向到该页面。但我希望它位于模式对话框中,因为它的内容不多。 这是用户点击的链接。我如何在模式对话框中打开此链接? <a href="viewReason.php?view_id=<?php echo $row['id'];?>">Click to view </a> 我在这个网站和其他地方看到过一些,但它们只有一个没有 ID 的链接来查看模式对话框。我没有找到与我相同的问题,所以我决定寻求帮助。 嘿,您可以使用以下代码来获取行值 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <!-- Trigger the modal with a button --> <br><br><br><br> <table id="prab" border="1"> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> <td><button type="submit" class="btn btn-default" data-toggle="modal" data-target="#myModal" value="Jackson"><span class="glyphicon glyphicon-envelope"></span>Invite</button></td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>50</td> <td><button type="submit" class="btn btn-default" data-toggle="modal" data-target="#myModal" value="smith" ><span class="glyphicon glyphicon-envelope"></span>Invite</button></td> </tr> </table> <!-- Modal --> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Modal Header</h4> </div> <div class="modal-body"> <p>clicked value </p> <input type="text" id="valueof" > </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> </div> <script type="text/javascript"> $('#prab').click(function(e){ // alert($(e.target).val()); document.getElementById("valueof").value = $(e.target).val(); }) </script> </body> </html>

回答 1 投票 0

链接到另一个网站上的 Anchor 不起作用(在 Chrome 中测试)

我面临的问题是,如果我在我的锚点所在的网站上,我的锚点似乎可以工作: 我面临的问题是,如果我在我的锚点所在的网站上,我的锚点似乎可以工作: <li role="presentation"> <a aria-controls="k" data-toggle="tab" href="#k" role="tab">K</a> </li> 但是,如果我尝试通过 href 从另一个网站跳转到该网站上的特定部分,则不会。选项卡窗格是在 Bootstrap 中内置的。 domain.com/beamer-lexikon/#k 使超链接导航到该页面,但不导航到“k”部分。 “k”部分标有 id“k”: <div class="tab-pane fade" id="k" role="tabpanel"></div> 我是不是搞错了什么? 您知道我可以从哪里开始寻找问题吗? JavaScript、CSS? 非常感谢和最诚挚的问候, 删除 Beamer 词典后面的“/”,并确保目标 ID 在您要跳转到的部分中声明。 除此之外,如果没有看到你的代码,就很难判断。 domain.com/beamer-lexikon#k 我发现Bootstrap框架不支持这种锚链接。解决方案是在文档就绪函数中锚点所在的页面上实现这段代码: if(window.location.hash != "") { $('a[href="' + window.location.hash + '"]').click(); } 最诚挚的问候, 史蒂芬

回答 2 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.