我正在编写一个谷歌地图页面,我正在尝试设置滚动条的样式。 奇怪的是,每个文本都有下划线,但我不希望这种情况发生(我的意思是,我不想下划线除了最后一行的网址,它很可能是一些愚蠢的事情要修复,但我真的找不到它,能帮帮我吗? 这是实时网站:www.gsilvainc.com/jewels/test.php 这是我到目前为止使用的代码:
<?php include("dbinfo.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<style type="text/css">
#side_bar {
font-family:Georgia, "Times New Roman", Times, serif;
font-size:12px;
color:#000000;
}
#side_bar A:link {text-decoration: none; color: black;}
#side_bar A:visited {text-decoration: none; color: black;}
#side_bar A:active {text-decoration: none; color: black;}
#side_bar A:hover { color: red;}
#side_bar A.clase2:visited {font-size:12;color:#0000cc;}
#side_bar A.clase2:active {font-size:12;color:#0000cc;}
#side_bar A.clase2:link {font-size:12;color:#0000cc;}
#side_bar A.clase2:hover {font-size:12;color:#0000cc;}
</style>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=<?php echo $key; ?>" type="text/javascript"></script>
</head>
<body onunload="GUnload()">
<!-- you can use tables or divs for the overall layout -->
<table border=0>
<tr> <td width = 200 valign="top" style="text-decoration: underline; color: #4444ff;">
<!-- =========== side_bar with scroll bar ================= -->
<div id="side_bar" style="overflow:auto; height:450px;"></div>
<!-- ===================================================== -->
</td>
<td>
<div id="map" style="width: 550px; height: 450px"></div>
</td>
</tr>
</table>
<script type="text/javascript">
//<![CDATA[
if (GBrowserIsCompatible()) {
var side_bar_html = "";
var gmarkers = [];
var htmls = [];
var i = 0;
// A function to create the marker and set up the event window
function createMarker(point,name,html, address, city, state, zip, phone, url) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
gmarkers[i] = marker;
htmls[i] = html;
side_bar_html += '<b><a href="javascript:myclick(' + i + ')">' + name + '<\/a><\/b><\/br>'+ address + '<\/br>' + city +', '+ state +', '+ zip +'<\/br>' + phone +'<br \/><a class="clase2" href="http://'+url+'">'+url+'<\/a><br \/><hr \/>';
i++;
return marker;
}
function myclick(i) {
gmarkers[i].openInfoWindowHtml(htmls[i]);
}
// create the map
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng( 41.907787,-90.359741), 9);
// Read the data from 100.xml
GDownloadUrl("phpsqlsearch_genxml.php?lat=41&lng=-90&radius=5000", function (doc) {
var xmlDoc = GXml.parse(doc);
var markers = xmlDoc.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
// obtain the attribues of each marker
var lat = parseFloat(markers[i].getAttribute("lat"));
var lng = parseFloat(markers[i].getAttribute("lng"));
var point = new GLatLng(lat,lng);
var html = markers[i].getAttribute("name");
var label = markers[i].getAttribute("name");
var address = markers[i].getAttribute("address");
var city = markers[i].getAttribute("city");
var state = markers[i].getAttribute("state");
var zip = markers[i].getAttribute("zip");
var phone = markers[i].getAttribute("phone");
var url = markers[i].getAttribute("url");
// create the marker
var marker = createMarker(point,label,html,address, city, state, zip, phone, url);
map.addOverlay(marker);
}
document.getElementById("side_bar").innerHTML = side_bar_html;
});
}
else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}
// This Javascript is based on code provided by the
// Community Church Javascript Team
// http://www.bisphamchurch.org.uk/
// http://econym.org.uk/gmap/
//]]>
</script>
感谢!!!
答案 0 :(得分:2)
你的td标签中有“text-decoration:underline;”,它正在被继承。使
<td width = 200 valign="top" style="text-decoration: underline; color: #4444ff;">
到
<td width = 200 valign="top" style="border-bottom:1px solid #4444ff; color: #4444ff;">
假设你想在单元格下面有一个边框。
如果你还没有使用它,Firefox的Firebug插件对于查看继承样式的位置非常有用。