我想使用XPath href从a-tag 获取属性,但它在同一个文件中有两次出现.我怎么相处?我需要检查如果有一个href值为$ street/object 的属性,我有这个代码,它不起作用:
$product_photo = $xpath->query("//a[contains(@href,'{$object_street}fotos/')][1]");
$product_360 = $xpath->query("//a[contains(@href,'{$object_street}360-fotos/')][1]");
$product_blueprint = $xpath->query("//a[contains(@href,'{$object_street}plattegrond/')][1]");
$product_video = $xpath->query("//a[contains(@href,'{$object_street}video/')][1]");
Run Code Online (Sandbox Code Playgroud)
它根本不会返回任何东西.谁能帮助我?
我在一个网站上工作,我的 HTML 中有一个无序列表的按钮,之后有更多内容。但问题是部分堆叠在这些按钮的顶部。#advertising高度为 0px,这可能就是它堆叠在按钮顶部的原因。
不过,我不知道如何解决这个问题。
编辑: 删除第 8 行。这是调试目的,与问题无关。
我的 HTML 代码
<!DOCTYPE html>
<html>
<head>
<title>Zien! Woningmarketing</title>
<link href='http://fonts.googleapis.com/css?family=Titillium+Web:400,300,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/mobile.css"/>
</head>
<body>
<header>
<nav>
<figure>
<span class="helper"></span><img src="http://placehold.it/180x55" alt="Zien Woningmarketing"/>
</figure>
<a href="#"><img src="http://placehold.it/45x20" alt="Menuknop: open het menu"/></a>
</nav>
</header>
<section id="intro-image">
<figure>
<img src="img/foto-bg.png" alt="Professionele woningfotografie"/>
</figure>
<h1><span>Professionele Woningfotografie</span></h1>
</section>
<section id="wat-doen-we">
<h2>Wat doen we?</h2>
<span>We verzorgen <span class="em">krachtige</span> en <span class="em">mooie</span> woningvisualisaties</span>
</section>
<section id="buttons">
<ul>
<li>
<ul>
<li><img src="http://placehold.it/60x60" …Run Code Online (Sandbox Code Playgroud)