ホームページ >ウェブフロントエンド >htmlチュートリアル >HTML への画像の挿入と HTML への画像の追加の例

HTML への画像の挿入と HTML への画像の追加の例

高洛峰
高洛峰オリジナル
2017-03-03 16:27:572026ブラウズ

HTMLに画像を挿入する 画像を表示するには、imgタグが必要です。

1. HTML画像タグの構文

コードは次のとおりです:

<img  src="pcss5-logo-201305.gif"    style="max-width:90%"  style="max-width:90%" / alt="HTML への画像の挿入と HTML への画像の追加の例" >

imgの紹介:

srcの後に画像のパスアドレスが続きます

width 画像の幅を設定します

height 画像の高さを設定します

2.具体的なHTML画像表示例 - TOP

HTMLソースコードに3枚の画像を挿入します。1つは元のサイズ、1つは幅と高さを小さく変更し、もう1つは幅と高さを大きく変更します。

1. サンプルの完全な HTML コード:

コードは次のとおりです:

 
 
 
 
图片插入html 在线演示 <a href="http://www.vcss.com</title">www.vcss.com</title</a>> 
</head> 

<body> 
<p>原始大图片</p> 
<p> 
<img  src="pcss5-logo-201305.gif"    style="max-width:90%"  style="max-width:90%" / alt="HTML への画像の挿入と HTML への画像の追加の例" > 
</p> 
<p>改小图片</p> 
<p> 
<img  src="pcss5-logo-201305.gif"    style="max-width:90%"  style="max-width:90%" / alt="HTML への画像の挿入と HTML への画像の追加の例" > 
</p> 
<p>改大图片</p> 
<p> 
<img  src="pcss5-logo-201305.gif"    style="max-width:90%"  style="max-width:90%" / alt="HTML への画像の挿入と HTML への画像の追加の例" > 
</p> 
</body> 
</html></pre><p>2. HTML への画像の挿入例のスクリーンショット</p>
<p><img alt="HTML への画像の挿入と HTML への画像の追加の例" src="https://img.php.cn/upload/article/000/000/013/01a9772901e3e927a85b643220ded383-0.png"    style="max-width:90%"  style="max-width:90%" title="HTML への画像の挿入と HTML への画像の追加の例"></p>
<p> HTML 画像の挿入の例を表示するスクリーンショット</p>
<p>詳細htmlに画像を挿入する例とhtmlに画像を追加する関連記事 PHPの中国語サイトに注目! </p></div><div class="nphpQianMsg"><div class="clear"></div></div><div class="nphpQianSheng"><span>声明:</span><div>この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。</div></div></div><div class="nphpSytBox"><span>前の記事:<a class="dBlack" title="HTML Web ページでのメタ ビューポート属性スキルの紹介" href="https://m.php.cn/ja/faq/354743.html">HTML Web ページでのメタ ビューポート属性スキルの紹介</a></span><span>次の記事:<a class="dBlack" title="HTML Web ページでのメタ ビューポート属性スキルの紹介" href="https://m.php.cn/ja/faq/354748.html">HTML Web ページでのメタ ビューポート属性スキルの紹介</a></span></div><div class="nphpSytBox2"><div class="nphpZbktTitle"><h2>関連記事</h2><em><a href="https://m.php.cn/ja/article.html" class="bBlack"><i>続きを見る</i><b></b></a></em><div class="clear"></div></div><ins class="adsbygoogle"
     style="display:block"
     data-ad-format="fluid"
     data-ad-layout-key="-6t+ed+2i-1n-4w"
     data-ad-client="ca-pub-5902227090019525"
     data-ad-slot="8966999616"></ins><script>     (adsbygoogle = window.adsbygoogle || []).push({});
</script><ul class="nphpXgwzList"><li><b></b><a href="https://m.php.cn/ja/faq/348757.html" title="HTMLの知識のまとめ" class="aBlack">HTMLの知識のまとめ</a><div class="clear"></div></li><li><b></b><a href="https://m.php.cn/ja/faq/348804.html" title="HTMLを早く学ぶ方法" class="aBlack">HTMLを早く学ぶ方法</a><div class="clear"></div></li><li><b></b><a href="https://m.php.cn/ja/faq/348873.html" title="html xhtml xml の違い" class="aBlack">html xhtml xml の違い</a><div class="clear"></div></li><li><b></b><a href="https://m.php.cn/ja/faq/348884.html" title="src 属性と href 属性の違い" class="aBlack">src 属性と href 属性の違い</a><div class="clear"></div></li><li><b></b><a href="https://m.php.cn/ja/faq/348902.html" title="HTML5とCSSの置き換え利用について" class="aBlack">HTML5とCSSの置き換え利用について</a><div class="clear"></div></li></ul></div></div><ins class="adsbygoogle"
     style="display:block"
     data-ad-format="autorelaxed"
     data-ad-client="ca-pub-5902227090019525"
     data-ad-slot="5027754603"></ins><script>     (adsbygoogle = window.adsbygoogle || []).push({});
</script><footer><div class="footer"><div class="footertop"><img src="/static/imghwm/logo.png" alt=""><p>福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!</p></div><div class="footermid"><a href="https://m.php.cn/ja/about/us.html">私たちについて</a><a href="https://m.php.cn/ja/about/disclaimer.html">免責事項</a><a href="https://m.php.cn/ja/update/article_0_1.html">Sitemap</a></div><div class="footerbottom"><p>                © php.cn All rights reserved
            </p></div></div></footer><script>isLogin = 0;</script><script type="text/javascript" src="/static/layui/layui.js"></script><script type="text/javascript" src="/static/js/global.js?4.9.47"></script></div><script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script><link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css' type='text/css' media='all'/><script type='text/javascript' src='/static/js/viewer.min.js?1'></script><script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script><script>jQuery.fn.wait = function (func, times, interval) {
    var _times = times || -1, //100次
    _interval = interval || 20, //20毫秒每次
    _self = this,
    _selector = this.selector, //选择器
    _iIntervalID; //定时器id
    if( this.length ){ //如果已经获取到了,就直接执行函数
        func && func.call(this);
    } else {
        _iIntervalID = setInterval(function() {
            if(!_times) { //是0就退出
                clearInterval(_iIntervalID);
            }
            _times <= 0 || _times--; //如果是正数就 --

            _self = $(_selector); //再次选择
            if( _self.length ) { //判断是否取到
                func && func.call(_self);
                clearInterval(_iIntervalID);
            }
        }, _interval);
    }
    return this;
}
$("table.syntaxhighlighter").wait(function() {
    $('table.syntaxhighlighter').append("<p class='cnblogs_code_footer'><span class='cnblogs_code_footer_icon'></span></p>");
});
$(document).on("click", ".cnblogs_code_footer",function(){
      $(this).parents('table.syntaxhighlighter').css('display','inline-table');$(this).hide();
});
$('.nphpQianCont').viewer({navbar:true,title:false,toolbar:false,movable:false,viewed:function(){$('img').click(function(){$('.viewer-close').trigger('click');});}});
</script></body><!-- Matomo --><script>  var _paq = window._paq = window._paq || [];
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="https://tongji.php.cn/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '9']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
</script><!-- End Matomo Code --></html>