TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Help Needed on Some CSS

1 pointsby acidpandaover 1 year ago
Do y&#x27;all usually ask programming questions on here? Couldn&#x27;t search for any but I&#x27;m working to familiarize myself with web development and programming in general.<p>I&#x27;m running into this issue with my website on mobile browsers where I&#x27;m trying to put a video inside a TV image, and a &quot;Watch&quot; button on top of the video that links to Twitch. And to top it off, the mobile browsers seem to completely ignore the font (I figure I can solve that later).<p>Here&#x27;s a snippet of my HTML code that shows the classes:<p>******<p>&lt;!-- TV ATTEMPT--&gt; &lt;div class=&quot;testingclass&quot;&gt; &lt;img class=&quot;tvImageClass&quot; src=&quot;UX_UI\TV90S.png&quot; alt=&quot;tv&quot; &#x2F;&gt; &lt;!-- TV Screen Image --&gt; &lt;a href=&quot;https:&#x2F;&#x2F;www.twitch.tv&#x2F;antighfest&quot; class=&quot;watchButton&quot;&gt; &lt;!-- Watch button that links to Twitch. Supposed to fit inside TV Image.--&gt; &lt;img src=&quot;UX_UI\BUTTONZ\WATCH_BUTTON.png&quot; alt=&quot;watch&quot; style=&quot;width: 200px; height: auto;&quot; &#x2F;&gt; &lt;&#x2F;a&gt;<p><pre><code> &lt;video class=&quot;trailerVideo&quot; autoplay muted loop playsinline&gt; &lt;source src=&quot;UX_UI\VIDEO\TRAILERZ\2024 - 24hrz_close_to_final.mp4&quot; type=&quot;video&#x2F;mp4&quot;&gt; &lt;!-- The Video that&#x27;s supposed fit inside the TV screen image--&gt; &lt;&#x2F;video&gt; &lt;&#x2F;div&gt; </code></pre> ****** And here&#x27;s my mobile CSS snippet: ******<p>&#x2F;* For mobile screens smaller than 768px <i>&#x2F; @media (max-width: 768px) {<p><pre><code> .testingclass { position: relative; text-align: center; height: 100vh; } .watchButton, .tvImageClass, .trailerVideo { position: relative; margin: auto; max-width: 100%; display: block; } .tvImageClass { &#x2F;* position: relative; *&#x2F; justify-content: center; width: 50px; max-width: 50px; height: 50px; max-height: 50px; object-fit: contain; } .trailerVideo { &#x2F;* position: relative; *&#x2F; justify-content: center; width: 50px; max-width: 50px; height: 50px; max-height: 50px; object-fit: contain; } </code></pre> } *********</i> Everything on mobile fits except for the trailerVideo and tvImageClass - they appear unusually large on mobile. Is there an efficient way to stack these assets so that they don&#x27;t blow out the pages? So far I&#x27;ve only tested on Safari mobile - and if you want to see what I&#x27;m talking about you can go to antighfest.tv on your phone.

3 comments

gymbeauxover 1 year ago
StsckOverflow for sure, but at quick glance:<p>- vh is an interesting choice for units. I’ve been out of the game for a couple of years but I don’t think that’s what you want to use (or vw for that matter).<p>- fonts are loaded from the device the webpage is being loaded from. To ensure your fonts display on any&#x2F;all devices, regardless of whether they have the font installed locally, use something like Google Fonts to add a link to the fonts in your HTML.
peterkonszover 1 year ago
I think this kind of question is better asked on stackoverflow or reddit
评论 #39247279 未加载
mattlover 1 year ago
Also look at Glitch.com which has a built in feature to ask for help.
评论 #39250049 未加载