Convert the image presentation to be inline

I am currently working on an image slider and I'm having issues with displaying the images inline. I have applied CSS but unfortunately, it's not working as expected. The images are not being displayed inline. Can someone please advise on what property needs to be changed? Your help is greatly appreciated.

<div id="f1_container">
    <div id="f1_card1" class="shadow">
        <div class="front face">
            <img src="thumb1.jpg" style="height: 281px; width: 450px;" />
        </div>
        <div class="back face center">
            Some text inside here
        </div>
    </div>

    <div id="f1_card2" class="shadow">
        <div class="front face">
            <img src="thumb2.jpg" style="height: 281px; width: 450px;" />
        </div>
        <div class="back face center">
            text2
        </div>
    </div>
</div>

Below is my CSS code:

 #f1_container {
    position: relative;
    margin: 10px auto;
    width: 450px;
    height: 281px;
    z-index: 1;
}
#f1_container {
    -webkit-perspective: 1000;
    perspective: 1000;
}
#f1_card {
    width: 100%;
    height: 100%;
    -webkit-transform-style: preserve-3d;
    -webkit-transition: all 1.0s linear;
    transform-style: preserve-3d;
    transition: all 1.0s linear;
}
#f1_container:hover #f1_card {
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    box-shadow: -5px 5px 5px #aaa;
}
.face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.face.back {
    display: block;
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    box-sizing: border-box;
    color: white;
    text-align: center;
    background-color: #aaa;
}

Thank you for your assistance.

Answer №1

To resolve the problem, I adjusted the body width in my CSS code.

Answer №2

To create an inline display of the image and text, consider placing them within a div element and using float:left property to align them side by side.

Answer №3

Create a shadow style by setting position to relative and floating it to the left. Additionally, make sure to eliminate any
elements between divs that have the class "shadow".

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

What is the process of utilizing PHP to generate and insert HTML tags into a separate HTML file?

I am facing an issue with two files in my project - input.php and output.html. Within the input.php file, the code is as follows: <?php $file="output.html"; $doc=new DOMDocument('1.0'); $doc->loadHTMLFile($file); $elements = ...

What could be the reason for an element with a width of 100% not recognizing the width of its parent?

One issue I'm currently experiencing is my inability to match the width of the parent within a flexbox item. Below is the code snippet, where the span element does not have the same width as its parent. .container { display: flex; } .item1 { ...

Expand the <div> by clicking on it, then hover away to return it to its normal size

One interesting feature I have on my website is a <div> that expands when clicked, and returns to normal size with another click. However, I am looking for something a bit different... What I want is for the <div> (with the class name .topHead ...

Position the division at the location of the cursor for particular usemap components

Looking for a way to position a division on top of an image using a usemap. Interested in having the div only appear when the mouse hovers over a particular area, and at the precise location of the cursor. Came across some examples using jQuery, similar ...

div maintain aspect ratio while scaling

My current layout is structured like this: HTML <div id="container"> <div id="zoomBox"> <div class="box"></div> <div class="box"></div> <div class= ...

What is the reason for the ineffectiveness of percentage padding/margin on flex items in Firefox and Edge browsers?

I am trying to create a square div within a flexbox. Here is the code I have used: .outer { display: flex; width: 100%; background: blue; } .inner { width: 50%; background: yellow; padding-bottom: 50%; } <div class="outer"> <div c ...

Apply a red border to any form inputs that contain incorrect information when the submit

How can I add red borders to my form inputs only when they are invalid after submission, without displaying the red borders from the start? Currently, I am using the input:invalid selectors in CSS, but this causes the red borders to appear immediately. I ...

Maximizing the number of divs arranged horizontally in HTML while utilizing the full line width

My website consists of several fixed-width div elements that are styled to flow inline using the display type inline-block. This layout creates empty space at the end of the line where subsequent div elements cannot be accommodated and have to wrap to the ...

The CSS does not display properly on iPad or mobile devices

Recently, I had the opportunity to design a website for a local music school. This project was a great learning experience that has shown me the importance of continuous improvement and practice. Check out the site here Initially, I wanted to make the w ...

Tips for positioning two elements side by side on a small screen using the Bootstrap framework

Greetings! As a beginner, I must apologize for the lack of finesse in my code. Currently, I am facing an issue with the positioning of my name (Tristen Roth) and the navbar-toggler-icon on xs viewports. They are appearing on separate lines vertically, lea ...

Arrange a pair of div containers side by side on the webpage without the need to alter the existing

Is there a way to align these two div side by side? <div class="main_one"> <div class="number_one">Title A</div> </div> <div class="main_two"> <div class="number_two">Title B</div> </div> <div class=" ...

Combining Angular variables within HTML tags: A Guide to AngularJS

As a newcomer to AngularJS, I am truly impressed by its capabilities. One thing I am eager to learn is how to include an AngularJS binding within an HTML attribute, while also adding another string to it. I often use unique names like "thisform" and "thisd ...

Operating PHP program from html on Beaglebone Black Rev C Debian

I've created a JavaScript program that utilizes node.js to manage GPIO from an IO.html page to the beaglebone. I simply initiate the JavaScript with "node myscript.js". Now, I'm looking to incorporate a PHP file that will store data from the IO. ...

Find the size of the grid using the data attribute

I am currently working on a piece of code that involves fetching a data-attribute known as grid size from the HTML. My objective is to create a conditional statement that checks whether the value of grid size is "large" or "small", and assigns specific x a ...

Is there a way to specifically import only variables and mixins from Sass stylesheets?

Using the Zurb Foundation 4 (S)CSS framework has presented a challenge with massively duplicated styles. Each file that I import 'foundation' into brings along all of Foundation's styles, resulting in redundant declarations for body, .row, . ...

One way to change the cursor CSS property is by dynamically altering it based on scrolling behavior. This involves modifying the cursor property when scrolling

I'm attempting to adjust the cursor property within an Angular function. The issue I'm facing is that when I begin scrolling the webpage, the cursor changes to a pointer, but when I stop scrolling, it remains as a pointer. I've attempted to ...

javascript onload select the text in the textarea

Is there a way to have JavaScript automatically highlight the text inside a textarea when the page is loaded? ...

using Javascript to eliminate necessary tags from concealed tabs

My goal is to dynamically remove the required tag from fields in hidden tabs when a tab is clicked using JavaScript. The presence of the required tag on unused fields causes issues with form submission, preventing data insertion into the database. Here&apo ...

Discover the method to adjust the position of elements, such as images, using radio buttons

I have an image positioned in a container along with 3 radio buttons. I want to make additional images appear over the main image when specific radio buttons are selected. Each button will trigger different positions for the additional images. So far, thi ...

Platform designed to simplify integration of high-definition imagery and scalable vector illustrations on websites

In the ever-evolving world of technology, some clients support advanced features like svg while others do not. With the rise of high resolution devices such as iPhone 4+ and iPad 3rd gen., it has become crucial to deliver graphics that can meet these stand ...