2011-12-25 40 views
2

我正在編寫一個谷歌地圖頁面,我試圖設計滾動條的樣式。 奇怪的是,每個文本都被加下劃線,但我不希望發生這種情況(我的意思是,除了最後一行使用url之外,我不想強​​調它,它最可能是修復一些愚蠢的東西,但我真的無法找到它,你可以請幫我 這裏是現場直播?www.gsilvainc.com/jewels/test.php 這是我使用至今代碼:關於一些使用javascript的文本樣式在css中使用

<?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&amp;v=2&amp;sensor=false&amp;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> 

謝謝! !

回答

2

您的td標籤中有「text-decoration:underline;」,其中h正在繼承。讓

<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插件對於查看樣式的繼承來說非常有用。

+0

大聲笑,我知道這是愚蠢的。謝謝! – Sebastian 2011-12-25 21:09:33