小编use*_*713的帖子

XPath查询:从标记中获取属性href

我想使用XPath hrefa-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 xpath domdocument

36
推荐指数
2
解决办法
8万
查看次数

CSS重叠部分

我在一个网站上工作,我的 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)

html css

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

html ×2

css ×1

domdocument ×1

xpath ×1