Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/421.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 从列表标记和表标记中删除HTML中的空白_Javascript_Html_Css_List_Html Table - Fatal编程技术网

Javascript 从列表标记和表标记中删除HTML中的空白

Javascript 从列表标记和表标记中删除HTML中的空白,javascript,html,css,list,html-table,Javascript,Html,Css,List,Html Table,我已经搜索了几个在线资源,并删除了Javascript菜单和它下面的图像之间的空白。我甚至从代码中删除了空格,但没有用 <tr> <td width="43" height="999" rowspan="16"> <img src="images/spacer.gif" width="43" height="999" alt=""></td> <td colspan="13">

我已经搜索了几个在线资源,并删除了Javascript菜单和它下面的图像之间的空白。我甚至从代码中删除了空格,但没有用

<tr>
        <td width="43" height="999" rowspan="16">
            <img src="images/spacer.gif" width="43" height="999" alt=""></td>
        <td colspan="13">
            <img src="images/Logo.gif" width="458" height="91" alt="The App-properties logo"> 
                                 <img src="images/Banner.gif" width="456" height="91" alt="Featured realestates">

                                           <ul class='dd_menu' style="margin-top: 0; margin-bottom:0px;">
            <li>  <img src="images/homeButton.gif" width="238" height="25" alt="App-properties Hompage">    <ul><li><a href='about_us.html' title="About App-properties"><p style="margin-bottom:0;">About Us</p></a></li></ul></li>
            <li><img src="images/salesButton.gif" width="97" height="24" alt="Property buying tips">
            <ul>
                <li><a href='latest_properties.html' title="latest properties in Spain"><p style="margin-bottom:0;">Featured Property</p></a></li>
                <li><a href='guide_to_buying.html' title="How to buy real estate"><p style="margin-bottom:0;">Guide to buying in spain</p></a></li>
                <li><a href='selling_property_tips.html' title="how to sell real estate"><p style="margin-bottom:0;">Sell your property with us</p></a></li>
            </ul>
            </li>
                <li><img src="images/rentalsButton.gif" width="94" height="23" alt="Renting property and real estate in spain">
            <ul>
                <li><a href='renting_property.html' title="renting property in Spain"> <p style="margin-bottom:0;">Search for a property</p></a></li>
                <li><a href='benefits_rented_property.html' title="Benefits of renting property at App-properties" ><p style="margin-bottom:0;">Rent your property with us</p></a></li>
            </ul>
            </li>
            <li><img src="images/mortgageButton.gif" width="118" height="24" alt="Buying property in Spain on a mortgage">
            <ul>
                <li><a href='realestate_finance.html' title="Financial assistance in buying real estate"><p style="margin-bottom:0;">Financial services we offer</p></a></li>
            </ul>
            </li>
                <li><img src="images/constructionButton.gif" width="97" height="24" alt="Constructing a new structure in a real estate">
            <ul>
                <li><a href='building_construction_spain.html' title="Building construction in Spain"><p style="margin-bottom:0;">Construction, reforms, planning & licences</p></a></li>
                <li><a href='disadvantages_building_in_spain.html' title="Difficulty in building in Spain"><p style="margin-bottom:0;">Is it hard to build in Spain?</p></a></li>
            </ul>
            </li>
                <li><img src="images/contactUs.gif" width="264" height="24" alt="">
            <ul>
                <li><a href='contact_us.html' title="Location of App-properties"><p style="margin-bottom:0;">Address</p></a></li>
                <li><a href='contact_us.html' title="Email of App-properties"><p style="margin-bottom:0;">E mail</p></a></li>
                <li><a href='contact_us.html' title="Phone number of App-properties"><p style="margin-bottom:0;">Phone number </p></a></li>
            </ul>
            </li>
            </ul>
        </td>
    </tr>
    <tr>
        <td width="19" height="122" colspan="2" rowspan="3">
            <img src="images/spacer.gif" width="19" height="122" alt=""></td>
        <td colspan="10">
            <img src="images/pathShower.gif" width="880" height="32" alt="Website Current location"></td>
        <td width="16" height="883" rowspan="15">
            <img src="images/spacer.gif" width="16" height="883" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="32" alt=""></td>
    </tr>


尝试将其添加到CSS中,以查看是否有区别并删除空白:

ul, li { margin:0 !important; padding:0 !important; }
如果是这样的话,那只是一个根据需要设置边距或填充的问题

另一个需要注意的是这些元素的线条高度。尝试:

ul, li { line-height: 100%: }

查看一个实时示例页面会很好。

尝试将此添加到CSS中,看看是否会有所不同并删除空白:

ul, li { margin:0 !important; padding:0 !important; }
如果是这样的话,那只是一个根据需要设置边距或填充的问题

另一个需要注意的是这些元素的线条高度。尝试:

ul, li { line-height: 100%: }
看一个活生生的示例页面是很好的。

首先:使用“间隔”图像和布局表是一种非常过时的技术

您的实际问题可能是这样的:

首先:像这样使用“间隔”图像和布局表是一种非常过时的技术


您的实际问题可能是:

为什么不使用好的IDE格式化代码?您能简化示例并添加一个吗?是的,现场演示在这里,为什么不使用好的IDE格式化代码?您能简化示例并添加一个吗?是的,现场演示在这里,很抱歉延迟,在回答此问题时突然断电昨天无论如何,上面的CSS也没有什么不同!我在这里做了一个现场演示,图像和CSS在演示中不起作用,你有真实的例子吗?另一个建议是,您不应该使用表格进行布局,也不应该使用spacer.gifs。这两种都是非常过时的技术。很抱歉,昨天在回复此答案时出现了突然停电。无论如何,上面的CSS也没有什么不同!我在这里做了一个现场演示,图像和CSS在演示中不起作用,你有真实的例子吗?另一个建议是,您不应该使用表格进行布局,也不应该使用spacer.gifs。这些都是非常过时的技术。