diff options
Diffstat (limited to 'files/zh-tw/learn/html')
-rw-r--r-- | files/zh-tw/learn/html/multimedia_and_embedding/images_in_html/index.html | 2 | ||||
-rw-r--r-- | files/zh-tw/learn/html/multimedia_and_embedding/other_embedding_technologies/index.html | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/files/zh-tw/learn/html/multimedia_and_embedding/images_in_html/index.html b/files/zh-tw/learn/html/multimedia_and_embedding/images_in_html/index.html index e079fd84f8..1764ce98de 100644 --- a/files/zh-tw/learn/html/multimedia_and_embedding/images_in_html/index.html +++ b/files/zh-tw/learn/html/multimedia_and_embedding/images_in_html/index.html @@ -98,7 +98,7 @@ original_slug: Learn/HTML/Multimedia_and_embedding/HTML中的圖片 <p>您應該在<code>alt</code>屬性中確切寫些什麼? 這取決於圖片為何而出現;也就是說,如果圖片不顯示,您將損失什麼:</p> <ul> - <li><strong>裝飾: </strong>你可以用 {{anch("CSS_背景圖片")}} 加入裝飾圖片,但如果必須使用HTML,可以添加一個空的 <code>alt=""</code>。如果圖片不是內容的一部分,那麼就不應該讓螢幕閱讀器浪費時間去閱讀它。</li> + <li><strong>裝飾: </strong>你可以用 <a href="#css_背景圖片">CSS_背景圖片</a> 加入裝飾圖片,但如果必須使用HTML,可以添加一個空的 <code>alt=""</code>。如果圖片不是內容的一部分,那麼就不應該讓螢幕閱讀器浪費時間去閱讀它。</li> <li><strong>內容: </strong>如果您的圖片提供了重要的資訊,請在簡短的<code>alt</code>文字中提供相同的資訊,甚至最好在所有人都能看到的主要文字中提供相同的資訊。請不要撰寫冗餘替代文字,試想如果所有段落都在主要內容中寫了兩次,對於用視力觀看的使用者有多煩人。如果圖像在正文中已充分敘述,請使用 <code>alt=""</code>。</li> <li><strong>連結:</strong> 如果你在{{htmlelement("a")}} 標籤中放了圖片使其轉入連結,你仍應該提供<a href="/zh-TW/docs/Learn/HTML/Introduction_to_HTML/Creating_hyperlinks#%E4%BD%BF%E7%94%A8%E6%98%8E%E7%A2%BA%E7%9A%84%E5%AD%97%E8%A9%9E">明確的字詞</a>。在这种情况下,您可以根據適合你的情況,将其写在相同的<code><a></code>元素内,或是写在图像的<code>alt</code> 属性内。</li> <li><strong>文字:</strong> 請不要在圖片中寫字。如果你的主要目的是為標題加上下拉式陰影,你可以<a href="/en-US/docs/Web/CSS/text-shadow">使用CSS</a>更甚於在圖片中描繪文字。 但如果你無法避免這麼做,也請將文字敘述加在<code>alt</code> 属性内。</li> diff --git a/files/zh-tw/learn/html/multimedia_and_embedding/other_embedding_technologies/index.html b/files/zh-tw/learn/html/multimedia_and_embedding/other_embedding_technologies/index.html index d828b00fca..626ae9e8bb 100644 --- a/files/zh-tw/learn/html/multimedia_and_embedding/other_embedding_technologies/index.html +++ b/files/zh-tw/learn/html/multimedia_and_embedding/other_embedding_technologies/index.html @@ -180,7 +180,7 @@ textarea.onkeyup = function(){ <p>So, that was easy and fun, right? {{htmlelement("iframe")}} elements are designed to allow you to embed other web documents into the current document. This is great for incorporating third-party content into your website that you might not have direct control over and don't want to have to implement your own version of — such as video from online video providers, commenting systems like <a href="https://disqus.com/">Disqus</a>, maps from online map providers, advertising banners, etc. The live editable examples you've been using through this course are implemented using <code><iframe></code>s.</p> -<p>There are some serious {{anch("Security concerns")}} to consider with <code><iframe></code>s, as we'll discuss below, but this doesn't mean that you shouldn't use them in your websites — it just requires some knowledge and careful thinking. Let's explore the code in a bit more detail. Say you wanted to include the MDN glossary on one of your web pages — you could try something like this:</p> +<p>There are some serious <a href="#security_concerns">Security concerns</a> to consider with <code><iframe></code>s, as we'll discuss below, but this doesn't mean that you shouldn't use them in your websites — it just requires some knowledge and careful thinking. Let's explore the code in a bit more detail. Say you wanted to include the MDN glossary on one of your web pages — you could try something like this:</p> <pre class="notranslate"><iframe src="https://developer.mozilla.org/en-US/docs/Glossary" width="100%" height="500" frameborder="0" @@ -223,7 +223,7 @@ textarea.onkeyup = function(){ <p>{{interwiki('wikipedia','Clickjacking')}} is one kind of common iframe attack where hackers embed an invisible iframe into your document (or embed your document into their own malicious website) and use it to capture users' interactions. This is a common way to mislead users or steal sensitive data.</p> </div> -<p>A quick example first though — try loading the previous example we showed above into your browser — you can <a href="http://mdn.github.io/learning-area/html/multimedia-and-embedding/other-embedding-technologies/iframe-detail.html">find it live on Github</a> (<a href="https://github.com/mdn/learning-area/blob/gh-pages/html/multimedia-and-embedding/other-embedding-technologies/iframe-detail.html">see the source code</a> too.) You won't actually see anything displayed on the page, and if you look at the <em>Console</em> in the <a href="/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools">browser developer tools</a>, you'll see a message telling you why. In Firefox, you'll get told <em>Load denied by X-Frame-Options: https://developer.mozilla.org/en-US/docs/Glossary does not permit framing</em>. This is because the developers that built MDN have included a setting on the server that serves the website pages to disallow them from being embedded inside <code><iframe></code>s (see {{anch("Configure CSP directives")}}, below.) This makes sense — an entire MDN page doesn't really make sense to be embedded in other pages unless you want to do something like embed them on your site and claim them as your own — or attempt to steal data via clickjacking, which are both really bad things to do. Plus if everybody started to do this, all the additional bandwidth would start to cost Mozilla a lot of money.</p> +<p>A quick example first though — try loading the previous example we showed above into your browser — you can <a href="http://mdn.github.io/learning-area/html/multimedia-and-embedding/other-embedding-technologies/iframe-detail.html">find it live on Github</a> (<a href="https://github.com/mdn/learning-area/blob/gh-pages/html/multimedia-and-embedding/other-embedding-technologies/iframe-detail.html">see the source code</a> too.) You won't actually see anything displayed on the page, and if you look at the <em>Console</em> in the <a href="/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools">browser developer tools</a>, you'll see a message telling you why. In Firefox, you'll get told <em>Load denied by X-Frame-Options: https://developer.mozilla.org/en-US/docs/Glossary does not permit framing</em>. This is because the developers that built MDN have included a setting on the server that serves the website pages to disallow them from being embedded inside <code><iframe></code>s (see <a href="#configure_csp_directives">Configure CSP directives</a>, below.) This makes sense — an entire MDN page doesn't really make sense to be embedded in other pages unless you want to do something like embed them on your site and claim them as your own — or attempt to steal data via clickjacking, which are both really bad things to do. Plus if everybody started to do this, all the additional bandwidth would start to cost Mozilla a lot of money.</p> <h4 id="Only_embed_when_necessary">Only embed when necessary</h4> @@ -278,7 +278,7 @@ textarea.onkeyup = function(){ <p><strong>Note</strong>: A <strong>plugin</strong>, in this context, refers to software that provides access to content the browser cannot read natively.</p> </div> -<p>However, you are unlikely to use these elements very much — Applets haven't been used for years, Flash is no longer very popular, due to a number of reasons (see {{anch("The case against plugins")}}, below), PDFs tend to be better linked to than embedded, and other content such as images and video have much better, easier elements to handle those. Plugins and these embedding methods are really a legacy technology, and we are mainly mentioning them in case you come across them in certain circumstances like intranets, or enterprise projects.</p> +<p>However, you are unlikely to use these elements very much — Applets haven't been used for years, Flash is no longer very popular, due to a number of reasons (see <a href="#the_case_against_plugins">The case against plugins</a>, below), PDFs tend to be better linked to than embedded, and other content such as images and video have much better, easier elements to handle those. Plugins and these embedding methods are really a legacy technology, and we are mainly mentioning them in case you come across them in certain circumstances like intranets, or enterprise projects.</p> <p>If you find yourself needing to embed plugin content, this is the kind of information you'll need, at a minimum:</p> |