2017-03-13 28 views
0

我附加了我試圖在MS Outlook 2007中顯示的HTML代碼。它在Chrome中工作正常,但是當涉及到Outlook時它無法正常工作。我如何在Outlook中做這項工作?CSS樣式和Jscript在MS Outlook 2007中沒有正確反映

我們可以使用替代代碼/標籤而不是我在這裏使用的代碼/標籤,以使其在MS Outlook 2007中工作嗎?如果是這樣,請幫助我。

<!DOCTYPE html> 
 
<html> 
 
<body> 
 
<div> 
 

 
<ol class="track-progress" data-steps="3"> 
 
    <li id="1"> 
 
    <span style="color:Black;font-weight:bold;font-size:70%">Submission</span> 
 
    <i></i> 
 
    </li><!-- 
 
--><li id="2"> 
 
    <span style="color:Black;font-weight:bold;font-size:70%">Approval</span> 
 
    </li><!-- 
 
--><li id="3"> 
 
    <span style="color:Black;font-weight:bold;font-size:70%">Implementation</span> 
 
    </li><!-- 
 
--><li id="4"> 
 
    <span style="color:Black;font-weight:bold;font-size:70%">Completed</span> 
 
    <i></i> 
 
    </li><!-- 
 
--><li id="5"> 
 
    <span style="color:Black;font-weight:bold;font-size:70%">Rejected</span> 
 
    <i></i> 
 
    </li> 
 
</ol></div> 
 
    
 
<style> 
 
.track-progress li > span { 
 
    display: block; 
 

 
    color: #0000; 
 
    //font-weight: bold; 
 
    //text-transform: uppercase; 
 
} 
 
.track-progress li > span:after, 
 
.track-progress li > span:before { 
 
    content: ""; 
 
    display: block; 
 
    width: 0px; 
 
    height: 0px; 
 

 
    position: absolute; 
 
    top: 0; 
 
    left: 0; 
 

 
    border: solid transparent; 
 
    border-left-color: #f0f0f0; 
 
    border-width: 15px; 
 
} 
 

 
.track-progress li > span:after { 
 
    top: -5px; 
 
    z-index: 1; 
 
    border-left-color: white; 
 
    border-width: 20px; 
 
} 
 

 
.track-progress li > span:before { 
 
    z-index: 2; 
 
} 
 
.track-progress li.done + li > span:before { 
 
    border-left-color: #19832f; 
 
    
 
} 
 
.track-progress li.ongoing + li > span:before { 
 
    border-left-color: #24d347; 
 
} 
 

 
.track-progress li:first-child > span:after, 
 
.track-progress li:first-child > span:before { 
 
    display: none; 
 
} 
 

 
.track-progress[data-steps="3"] li { width: 15%; } 
 
.track-progress[data-steps="4"] li { width: 25%; } 
 
.track-progress[data-steps="5"] li { width: 20%; } 
 
.track-progress { 
 
    margin: 0; 
 
    padding: 0; 
 
    overflow: hidden; 
 
} 
 
.track-progress li:first-child i, 
 
.track-progress li:last-child i { 
 
    display: block; 
 
    height: 0; 
 
    width: 0; 
 

 
    position: absolute; 
 
    top: 0; 
 
    left: 0; 
 

 
    border: solid transparent; 
 
    border-left-color: white; 
 
    border-width: 15px; 
 
} 
 

 
.track-progress li:last-child i { 
 
    left: auto; 
 
    right: -15px; 
 

 
    border-left-color: transparent; 
 
    border-top-color: white; 
 
    border-bottom-color: white; 
 
} 
 
.track-progress li { 
 
    list-style-type: none; 
 
    display: inline-block; 
 

 
    position: relative; 
 
    margin: 0; 
 
    padding: 0; 
 

 
    text-align: center; 
 
    line-height: 30px; 
 
    height: 30px; 
 

 
    background-color: #f0f0f0; 
 
} 
 
</style> 
 

 
<script> 
 
var firstName = "Planning"; 
 
if (firstName === "Draft") { 
 
\t document.getElementById("1").style.backgroundColor = "#81C5F1"; 
 
\t document.getElementById("2").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("3").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("4").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("5").style.backgroundColor = "f0f0f0"; 
 
} 
 
if (firstName === "In Cart") { 
 
\t document.getElementById("1").style.backgroundColor = "#81C5F1"; 
 
\t document.getElementById("2").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("3").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("4").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("5").style.backgroundColor = "f0f0f0"; 
 
} 
 
if (firstName === "In Review") { 
 
\t document.getElementById("1").style.backgroundColor = "#81C5F1"; 
 
\t document.getElementById("2").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("3").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("4").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("5").style.backgroundColor = "f0f0f0"; 
 
} 
 
if (firstName === "Submitted") { 
 
\t document.getElementById("1").style.backgroundColor = "#81C5F1"; 
 
\t document.getElementById("2").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("3").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("4").style.backgroundColor = "#f0f0f0"; 
 
\t document.getElementById("5").style.backgroundColor = "f0f0f0"; 
 
} 
 
if (firstName === "Waiting Approval") { 
 
\t document.getElementById("1").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("2").style.backgroundColor = "#81C5F1"; 
 
\t document.getElementById("3").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("4").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("5").style.backgroundColor = "f0f0f0"; 
 
} 
 
if (firstName === "Pending") { 
 
\t document.getElementById("1").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("2").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("3").style.backgroundColor = "#81C5F1"; 
 
\t document.getElementById("4").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("5").style.backgroundColor = "f0f0f0"; 
 
} 
 
if (firstName === "Planning") { 
 
\t document.getElementById("1").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("2").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("3").style.backgroundColor = "#81C5F1"; 
 
\t document.getElementById("4").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("5").style.backgroundColor = "f0f0f0"; 
 
} 
 
if (firstName === "In Progress") { 
 
\t document.getElementById("1").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("2").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("3").style.backgroundColor = "#81C5F1"; 
 
\t document.getElementById("4").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("5").style.backgroundColor = "f0f0f0"; 
 
} 
 
if (firstName === "Completed") { 
 
\t document.getElementById("1").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("2").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("3").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("4").style.backgroundColor = "#81C5F1"; 
 
\t document.getElementById("5").style.backgroundColor = "f0f0f0"; 
 
} 
 
if (firstName === "Closed") { 
 
\t document.getElementById("1").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("2").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("3").style.backgroundColor = "#77E765"; 
 
\t document.getElementById("4").style.backgroundColor = "#81C5F1"; 
 
\t document.getElementById("5").style.backgroundColor = "f0f0f0"; 
 
} 
 
if (firstName === "Rejected") { 
 
\t document.getElementById("1").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("2").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("3").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("4").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("5").style.backgroundColor = "#F74141"; 
 
} 
 
if (firstName === "Cancelled") { 
 
\t document.getElementById("1").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("2").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("3").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("4").style.backgroundColor = "f0f0f0"; 
 
\t document.getElementById("5").style.backgroundColor = "#F74141"; 
 
} 
 

 
</script> 
 
</body> 
 
</html>

回答

2

我怎樣才能使前景這項工作?

您需要詳細閱讀以下資源:Supported HTML Elements, Attributes, and Cascading Style Sheet PropertiesWorking with Outlook HTMLBody – a guide for Office developers。通過簡單地查看您的HTML代碼以及Outlook將允許的內容,您會使用很多不支持的標籤。例如:「顯示」,「溢出」等。請清理您的HTML並使其與OUTLOOK能夠呈現的內容兼容。您也可以使用在線Outlook HTML Email Online Validator。我不知道它有多準確,但這絕對是開始的好方法。

我們可以使用替代代碼/標籤而不是我在這裏使用的代碼/標籤,以使其在MS Outlook 2007中工作嗎?

是的,這正是你應該做的。使用支持的CSS樣式和HTML標籤。

如果是這樣,請幫助我。

這就是你應該做的開發者。這可能是你付出的工作。所以簡單地按照提供的資源來做,不要指望有人會爲你寫代碼。