2013-05-30 43 views
0

當我在克羅姆我的代碼運行,它看起來像view in crome如何解決這個跨瀏覽器問題?

當我在Firefox中運行它,那麼它看起來像

view in firefox

我想在到處火狐狸視圖。我該如何解決這個問題。我的代碼如下

@{ 
    ViewBag.Title = "Home Page"; 
} 
<link href="../../Content/css/jq.stopwatch.css" rel="stylesheet" type="text/css" /> 
<script src="../../Scripts/js/jq.stopwatch.js" type="text/javascript"></script> 

<input type="submit" id="createNew" name="AddNewTask" value="Add New Task" /> 
<div id="form"> 

</div> 
<div id="tasks"> 

</div> 

<style> 
    #createNew { 
     margin-left : 450px; 
     margin-bottom : 10px ; 
    } 
    #taskDiv{ 
     background-color: #669900; 
     height: 300px; 
     width: 240px; 
     float: left; 
     border-radius: 8px; 
     margin-left: 25px; 
     margin-bottom: 10px; 
    } 
    #taskNameId { 
     color : white ; 
     margin: 5px 15px 15px 5px; 
    } 
    #taskCategoryId { 
     color : white ; 
     margin: 5px 15px 5px 5px; 
    } 
    .timerDiv { 
     color : white ; 
     margin: 5px 15px 5px 36px; 
    } 
    #taskDescriptionId{ 
     color : white ; 
     margin: 5px 15px 5px 5px; 
    } 
    #taskDescriptiontextareaId { 
     margin-left: 18px; 
     width : 200px ; 
     border-radius : 10px ; 
    } 

    #taskListId { 
     margin-left : 20px ; 
     border-radius: 10px; 
     width : 124px ; 
    } 
    #taskCategoryListId { 
     border-radius: 10px; 
     width : 124px ; 
    } 
</style> 
<script type="text/javascript"> 
    var counter = 0; 

    $("#createNew").click(function() { 
     $(".closed").css("background-color", "#0099CC"); 
     $(".closed").css("height", "200"); 
     $(".dropdownClass").attr("disabled", "disabled"); 
     $(".taskDescriptiontextareaClass").attr("disabled", "disabled"); 
     $("#stopwatch").replaceWith('<div class="timerDiv">'+"Time Duration:" + $(".hr").html() + ":" + $(".min").html() + ":" + $(".sec").html() + '</div>'); 
     createNewTask().appendTo("#main"); 
     var mainHeight = $("#main").css("height"); 
     if (mainHeight <= '300px' || (counter % 4 == 0)) { 
      $("#main").css("height", parseInt(mainHeight) + 300 + 'px'); 
     } 
     counter++; 

    }); 

    function createNewTask() { 
     var newDiv = $('<div>') 
      .attr({ Class:'closed',id: 'taskDiv' }); 
     newDiv.append(createTask()); 
     newDiv.append(createTaskCategory()); 
     newDiv.append(createTaskDescription()); 
     newDiv.append(getStopwatchDiv()); 
     return newDiv; 
    } 

    function getStopwatchDiv() { 
     var stopwatchDiv = $('<div>').attr({ Class:'stopwatchClass',id: 'stopwatch' }); 
     stopwatchDiv.stopwatch('theme-1'); 
     return stopwatchDiv; 

    } 

    function createTask() { 
     var taskName = $('<label>').attr({id:'taskNameId'}).text('Task Name:'); 
     createTaskDropdown().appendTo(taskName); 
     return taskName; 
    } 

    function createTaskCategory() { 
     var taskCategory = $('<label>').attr({ id: 'taskCategoryId' }).text('Task Category:'); 
     createTaskCategoryDropdown().appendTo(taskCategory); 
     return taskCategory; 
    } 

    function createTaskDescription() { 
     var taskDescription = $('<label>').attr({ id: 'taskDescriptionId' }).text('Task Description:'); 
     var textArea = $('<textarea/>').attr({ Class: 'taskDescriptiontextareaClass', id: 'taskDescriptiontextareaId' }); 
     textArea.appendTo(taskDescription); 
     return taskDescription; 
    } 

    function createTaskDropdown() { 
     var data = ["Select Task", "TaskA", "TaskB", "TaskC"]; 
     var taskList = $('<select />').attr({ Class:'dropdownClass',id: 'taskListId' }); 

     for (var val in data) { 
      $('<option />', { value: val, text: data[val] }).appendTo(taskList); 
     } 
     return taskList; 
    } 

    function createTaskCategoryDropdown() { 
     var data = ["Select Task ", "CategoryA", "CategoryB", "CategoryC"]; 
     var taskCategoryList = $('<select />').attr({ Class: 'dropdownClass', id: 'taskCategoryListId' }); 

     for (var val in data) { 
      $('<option />', { value: val, text: data[val] }).appendTo(taskCategoryList); 
     } 
     return taskCategoryList; 
    } 

</script> 
+4

具體是什麼,你想看到FF呈現它?圓形的邊框?你谷歌'邊界半徑'瀏覽器兼容性?你發現了什麼?你看過[這個](http://caniuse.com/#search=border-radius)嗎? – Jon

+0

您使用的是什麼版本的Chrome? – Pete

+0

crome版本27.0.1453.94 m @Pete。 –

回答

3

也使用廠商前綴版本border-radius。例如:,所以你必須使用舊版本

-webkit-border-radius: 8px; 
-moz-border-radius: 8px; 
border-radius: 8px; 

border-radius已經在Chrome現在支持了一會兒:

border-radius: 8px; 

應改爲。

+0

感謝您的迴應........但實際上並沒有工作 –

+0

我很困惑,然後至於你的問題是什麼。你能否提供一個[JSFiddle](http://jsfiddle.net)來顯示你遇到的問題? –

+0

我的克羅姆是最新的........你可以嘗試這個你自己的克羅姆 –