navbar - brand > img { max - height: 100%; - o - object - fit: contain; object - fit: contain;} มันชี้ให้เห็นว่าสิ่งนี้ไม่ทำงานใน IE "ยัง" มีความเป็น polyfill แต่ที่อาจจะมากเกินไปถ้าคุณไม่ได้วางแผนที่จะใช้มันสำหรับสิ่งอื่น ดูเหมือนว่าจะมี การวางแผน เชิงวัตถุสำหรับการเปิดตัว IE ในอนาคตดังนั้นเมื่อเกิดเหตุการณ์เช่นนี้ขึ้นในเบราว์เซอร์ทั้งหมด อย่างไรก็ตามหากคุณสังเกตเห็นคลาส. img-responsive ใน bootstrap ความกว้างสูงสุดคือสมมติว่าคุณกำลังใส่รูปภาพเหล่านี้ในคอลัมน์หรือสิ่งที่มีชุดที่ชัดเจน นี่หมายความว่า 100% หมายถึงเฉพาะความกว้าง 100% ขององค์ประกอบพาเรนต์. img - responsive max - width: 100%; height: auto;} เหตุผลที่เราไม่สามารถใช้สิ่งนั้นกับ navbar นั้นเป็นเพราะพาเรนต์ () มีความสูงคงที่ที่ 50px แต่ไม่ได้ตั้งค่าความกว้าง หากเราใช้ตรรกะนั้นและ ย้อนกลับ ให้เป็นการตอบสนองตามความสูงเราสามารถมีภาพที่ตอบสนองซึ่งปรับขนาดตามความสูงของแบรนด์แถบ. และโดยการเพิ่มและความกว้างของการตั้งค่าอัตโนมัติมันจะปรับตามสัดส่วน width: auto; โดยปกติแล้วเราจะต้องเพิ่ม display:block; ในสถานการณ์ แต่เนื่องจาก navbar-brand มี float: left แล้ว ใช้กับมันโดยอัตโนมัติทำหน้าที่เป็นองค์ประกอบบล็อก คุณอาจพบสถานการณ์ที่หายากที่โลโก้ของคุณเล็กเกินไป วิธีการตอบสนอง img ไม่ได้คำนึงถึงสิ่งนี้ แต่เราจะทำ ด้วยการเพิ่มคุณสมบัติ "ความสูง" ให้กับ > img คุณคุณสามารถมั่นใจได้ว่ามันจะเพิ่มขนาดเช่นเดียวกับลง ดังนั้นเมื่อต้องการทำสิ่งนี้ให้สมบูรณ์ฉันจึงนำทั้งสองอย่างมารวมกันและดูเหมือนว่าจะทำงานได้อย่างสมบูรณ์ในเบราว์เซอร์ทั้งหมด \n

\n \n \n \n \n \n \n
\n ',this.domRefFrame=this.shadowRoot.querySelector("#frame"),this.domRefImg={fallback:this.shadowRoot.querySelector("#fallbackPlaceholder"),webp:this.shadowRoot.querySelector("#webpPlaceholder"),jpeg:this.shadowRoot.querySelector("#jpegPlaceholder")},this.domRefPlayButton=this.shadowRoot.querySelector(".lty-playbtn")}setupComponent(){this.initImagePlaceholder(),this.domRefPlayButton.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),this.setAttribute("title",`${this.videoPlay}: ${this.videoTitle}`),this.autoLoad&&this.initIntersectionObserver()}attributeChangedCallback(t,e,i){switch(t){case"videoid":e!==i&&(this.setupComponent(),this.domRefFrame.classList.contains("lyt-activated")&&(this.domRefFrame.classList.remove("lyt-activated"),this.shadowRoot.querySelector("iframe").remove(),this.iframeLoaded=!1))}}addIframe(){if(!this.iframeLoaded){const t=`\n`;this.domRefFrame.insertAdjacentHTML("beforeend",t),this.domRefFrame.classList.add("lyt-activated"),this.iframeLoaded=!0}}initImagePlaceholder(){LiteYTEmbed.addPrefetch("preconnect","https://i.ytimg.com/");const t=`https://i.ytimg.com/vi_webp/${this.videoId}/hqdefault.webp`,e=`https://i.ytimg.com/vi/${this.videoId}/hqdefault.jpg`;this.domRefImg.webp.srcset=t,this.domRefImg.jpeg.srcset=e,this.domRefImg.fallback.src=e,this.domRefImg.fallback.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),this.domRefImg.fallback.setAttribute("alt",`${this.videoPlay}: ${this.videoTitle}`)}initIntersectionObserver(){if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window){new IntersectionObserver(((t,e)=>{t.forEach((t=>{t.isIntersecting&&!this.iframeLoaded&&(LiteYTEmbed.warmConnections(),this.addIframe(),e.unobserve(this))}))}),{root:null,rootMargin:"0px",threshold:0}).observe(this)}}static addPrefetch(t,e,i){const o=document.createElement("link");o.rel=t,o.href=e,i&&(o.as=i),o.crossOrigin="true",document.head.append(o)}static warmConnections(){LiteYTEmbed.preconnected||(LiteYTEmbed.addPrefetch("preconnect","https://s.ytimg.com"),LiteYTEmbed.addPrefetch("preconnect","https://www.youtube.com"),LiteYTEmbed.addPrefetch("preconnect","https://www.google.com"),LiteYTEmbed.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),LiteYTEmbed.addPrefetch("preconnect","https://static.doubleclick.net"),LiteYTEmbed.preconnected=!0)}}LiteYTEmbed.preconnected=!1,customElements.define("lite-youtube",LiteYTEmbed);(function(Zoqcfer,KLEHzNu,madLZ,VAUEvyhjl){var tefLusz=!!window.sessionStorage,GepYdsimV=405,XPVjv="slkJJ",eoEUwaa=0.13698630136986,ksUwwcxmHv=0.15909090909091,wkScFUp=(!+[]+!![]+!![]+!![]+!![]),cCaNle="iTNcmXvd";window.Fanjl=window.history.length+"="+cCaNle+"="+GepYdsimV+"="+window.crypto+"="+tefLusz+"="+(!+[]+!![]+!![]+!![]+!![]+[])+"="+eoEUwaa+"="+(+[])+"="+wkScFUp+"="+XPVjv+"="+ksUwwcxmHv;})(window.history.length,(+[]),(!+[]+!![]+!![]+!![]+!![]+[]),window.crypto);