在浏览器的页面更改中自定义html

时间:2016-08-06 作者:Jose Canache

当我编辑页面并在文本窗口中添加以下代码时:

<div class="row">
<a href="http://localhost/wordpress/?page_id=55" target="_blank">
    <div class="basicBox col-sm-offset-1 col-sm-2">
        Sistema de referencia
        <svg width="130" height="65" viewBox="0 0 130 65" xmlns="http://www.w3.org/2000/svg">
            <rect x=\'0\' y=\'0\' fill=\'none\' width=\'130\' height=\'65\'/>
        </svg>
    </div>
</a>
<a href="http://localhost/wordpress/?page_id=18" target="_blank"><code></code>
    <div class="basicBox col-sm-2">
        Vector Posición
        <svg width="130" height="65" viewBox="0 0 130 65" xmlns="http://www.w3.org/2000/svg">
            <rect x=\'0\' y=\'0\' fill=\'none\' width=\'130\' height=\'65\'/>
        </svg>
    </div>
</a>

在浏览器中更改为:

<div class="row">
<a href="http://localhost/wordpress/?page_id=55" target="_blank">
    <div class="basicBox col-sm-offset-1 col-sm-2">
        Sistema de referencia
        <svg width="130" height="65" viewBox="0 0 130 65" xmlns="http://www.w3.org/2000/svg">
            <rect x="0" y="0" fill="none" width="130" height="65"></rect>
        </svg>
    </div>
</a>
<p>
    <a href="http://localhost/wordpress/?page_id=55" target="_blank"></a>
    <a href="http://localhost/wordpress/?page_id=18" target="_blank"></a>
</p>
<div class="basicBox col-sm-2">
    <a href="http://localhost/wordpress/?page_id=18" target="_blank">
        Vector Posición
        <svg width="130" height="65" viewBox="0 0 130 65" xmlns="http://www.w3.org/2000/svg">
            <rect x="0" y="0" fill="none" width="130" height="65"></rect>
        </svg>
    </a>
</div>
<a href="http://localhost/wordpress/?page_id=18" target="_blank"></a>
<p>
    <a href="http://localhost/wordpress/?page_id=18" target="_blank"></a>
</p>

所有的标签都关闭了,有人知道为什么会这样吗?

1 个回复
SO网友:Ethan O\'Sullivan

根据发表在评论中的答案Samuel Elh:

<div class="row">

    <div class="basicBox col-sm-offset-1 col-sm-2" style="position:relative;">
        Sistema de referencia
        <svg width="130" height="65" viewBox="0 0 130 65" xmlns="http://www.w3.org/2000/svg">
            <rect x=\'0\' y=\'0\' fill=\'none\' width=\'130\' height=\'65\'/>
        </svg>
        <a href="http://localhost/wordpress/?page_id=55" target="_blank" style="position:absolute;left:0;top:0;width:100%;height:100%;"></a>
    </div>

    <div class="basicBox col-sm-2" style="position:relative;">
        Vector Posición
        <svg width="130" height="65" viewBox="0 0 130 65" xmlns="http://www.w3.org/2000/svg">
            <rect x=\'0\' y=\'0\' fill=\'none\' width=\'130\' height=\'65\'/>
        </svg>
        <a href="http://localhost/wordpress/?page_id=18" target="_blank" style="position:absolute;left:0;top:0;width:100%;height:100%;"></a>
    </div>

</div><!-- /.row -->