Is it possible to include custom icons and text within a column layout when the flex direction is set to row

Trying to create a single line clickable section with a play button, text, and YouTube video thumbnail. It's not rendering correctly even though the container is set as flex with row direction.

Custom play button and properly sized thumbnail are in place, but they refuse to align on the same line. Is there something missing here?

If the play button is commented out, the text and thumbnail do display on the same row successfully.

body {
  background: darkgrey;
}

.page-container {
  background: lightgrey;
  width: 320px;
  margin: auto auto;
  height: 600px;
}

.section-container {
  background: white;
  width: 288px;
  margin: auto auto;
  height: 500px;
}

.video-container {
  display: flex;
  flex-direction: row;
}

.video-thumbnail {
  background-image: url('https://i3.ytimg.com/vi/I-k-iTUMQAY/mqdefault.jpg');
  width: 71.63px;
  height: 40.14px; 
  background-size: 71.63px 40.14px;
}

/* Play button */
.play-button-outer {
  display: inline-block;
  box-sizing: border-box;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background-color: rgba(0, 115, 144, 0.16);
  cursor: pointer;
}

.play-button-inner {
  margin: 0 auto;
  top: calc(50% - 6.645px);
  position: relative;  
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6.645px 0 6.645px 11.04px;
  border-color: transparent transparent transparent #007390;
}
<div class="page-container">
  <div class="section-container">
    <div class="video-container">
      <div class="play-button-outer">
        <div class="play-button-inner"/>
      </div>
      <div class="text">Some text</div>
      <div class="video-thumbnail"/>
    </div>
  </div>
</div>

Answer №1

You didn't properly close the divs

<div class="start-button-center"/>
<div class="image-section"/>

They should be closed like so

<div class="start-button-center"></div>
<div class="image-section"></div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

showing a pair of divs in a split layout on the homepage

I have a partially split homepage with two sections using Twitter Bootstrap v5.1.3 for the layout. The left side consists of two divs, one for text and one for an image. These divs are contained within a flex-parent, giving them an inline-block appearance ...

Searching for all classes and IDs in a CSS Stylesheet that include a specific keyword

I am currently working with a premium WordPress theme that has an extensive styles.css file consisting of over 25,000 lines. My goal is to make sitewide changes to the font and main color, and in order to do this effectively, I need to identify all classes ...

Receive notification of alert content when it is displayed

Having an HTML page with the following script: <Script> function Run() { alert("The Content Here"); return true; } </script> <button onclick="Run();">I Want It Now</button> If I were to open this page using firefox or Chrome, and ...

Problem with responsive design on iPhone

I'm currently working on developing a responsive chatbot using CSS Bootstrap. However, I've encountered an issue where the header and footer are not fixed when I open the app on an iPhone. The keyboard header is also moving up the screen, which s ...

Displaying left and right div elements alongside each other in HTML/CSS works in Chrome, but not in Safari or Firefox

I've encountered an issue with aligning divs side by side in Firefox and Safari, although it seems to be working perfectly in Chrome. It's a bit tricky to provide all the CSS code as I have different stylesheets for mobile, normal, and print vers ...

Is there a way to utilize JavaScript in order to trigger a random audio file to play upon clicking?

Is there a way to create a button using the div element that, upon being clicked, plays a random audio file from a set of options? I found some helpful discussions on this topic here and here. Based on those resources, I created a script utilizing Math.ra ...

Arranging five divs within one main div horizontally with equal margins between them

I am currently working on a website system where I need to place 5 divs within 1 main div horizontally. However, I want the spacing between the 5 divs to be equal and fixed within the main div. Below is how my current page looks: https://i.stack.imgur.com ...

Can anyone provide a solution for the issue with bootstrap utilities?

Currently, I am using Vue3 with Vite and attempting to integrate Bootstrap into my project. While I have managed to implement most of it successfully, I encountered a significant error when trying to override Bootstrap-related variables. Can anyone offer a ...

JQuery content displaying only on the first instance

<script> $(document).ready(function () { $('nav>li').hide(); $('ul').hide(); $('h2').hide(); $('a.btnDown').click(function () { $('body').css('background&apos ...

Styling in CSS for aligning a drop-down menu to the right side

I recently incorporated a CSS/JavaScript drop-down menu on my website, which I sourced from the following page: However, I am facing an issue with aligning the far-right drop-down properly. Specifically, I would like the items in the far-right drop-down t ...

Modifying Bootstrap image dimensions

I've been working on creating a card div with two images inside: an up arrow and a down arrow. Everything looks good when the page is in full screen mode, with the images displaying at their full size. However, with Bootstrap's responsive design ...

I am attempting to create a footer with a set size, but encountering an issue

I'm in the process of developing a responsive website using Vue.js. One aspect I am working on is the footer container, which looks fine on the full screen but shrinks when the screen resolution is reduced below 1100 pixels. As shown in the images li ...

The justify-content property aligns single-line text horizontally, but its alignment may not be consistent when the text expands over

Seeking a deeper understanding of flexbox alignment, I decided to experiment with aligning content using only flexbox properties. One puzzling observation is how "justify-content" centers items with single lines of text (flex-item-1 and flex-item-5), but n ...

Internet Explorer versions 9 and 10 do not support the CSS property "pointer-events: none"

In Firefox, the CSS property pointer-events: none; functions properly. However, it does not work in Internet Explorer 9-10. Are there any alternative approaches to replicate the functionality of this property in IE? Any suggestions? ...

Looking to access the layout details of an HTML element similar to what can be done in Firefox's debugger tool?

I am facing a challenge with a aspx.net grid control where I need to extract the first row's information and copy it into another table using JavaScript. To achieve this, I am attempting to calculate the width of each cell in the first row by accessin ...

Explain the concept of grid layout in CSS

Can you please clarify the distinctions between grid and liquid layouts? Specifically, I am interested in understanding the concept of a grid layout. Thank you in advance for your explanation. ...

The content spilling out of a Bootstrap 4 row

UPDATE: Here is the link to the javascript fiddle When the text on the screen becomes too large for the row, it overlaps onto other rows instead of increasing the height of the row. This could be due to setting the row heights as a percentage value in ord ...

JavaScript code that displays items in a shopping cart

I've set up the HTML and JS functionality for the cart, but I'm facing an issue where the JS doesn't render the cart items when the shop item is clicked. The styling in my HTML is done using Tailwind. If anyone could provide some assistance ...

splitting lengthy words into several lines

Does anyone know how to break words like the examples below using CSS or jQuery? SAMPLE 1 ConfigTechnologyHormonyAppComponentBackOfficeLaunch It needs to be broken into ConfigTechnologyHo rmonyAppComponentB ackOfficeLaunch SAMPLE 2 WorkAppComponentBa ...

The data fail to load correctly with Ajax

I'm having trouble displaying the data from each link in my div. I suspect it may be related to an external .js file that controls the slide up jquery function. Every time a link is clicked, the box slides up but doesn't show any new data. Additi ...