Image that floats or pops over the content

I'm currently working on designing a card similar to the one displayed in the image. However, I'm facing difficulty in creating the floating image effect on the card. Any tips or suggestions on how to achieve this using angular, jquery, css, or any free plugins along with some sample code would be greatly appreciated.

At the moment, I am utilizing the materialize framework.

The code snippet I've used for creating the card is as follows:

`

<div class="col s6">
    <div class="card card white lighten-1 horizontal" style="height: 300px; width: 500px;">
        <div class="card-image">
            <img src="assets/dark_murder.jpg">
        </div>
        <div class="card-content grey-text">
            <span class="card-title">Dark Murder</span>
            <div class='starrr' id='star1'></div>
            <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
            <div class="card-action">
                <a href="#">This is a link</a>
            </div>
        </div>
    </div>
</div> 

`

The corresponding CSS styles are as follows:
`
.card-image img {
    position: absolute;
    bottom: 8px;
    left: 16px;
    height: 100%;
}
.card-title {
    padding-left: 20px;
}`

Here is the current progress of the card design: Card so far

Answer №1

Creating a stylish card layout is as easy as pie with bootstrap.

HTML

<div class="card-content">
   <h2> Insert Title Here</h2>
   <p>Lorem ipsum dolor sit amet, 
      consectetur adipiscing elit, 
      sed do eiusmod tempor incididunt ut 
      labore et dolore magna aliqua.</p>
      <a href=""> Click here to read more</a>
 </div>

CSS

.card {
  background-color: #bdbdbd;
  margin: 30px 0;
  padding: 30px 0;
  overflow: hidden;
}

For a live demo, visit: http://codepen.io/sifulislam/pen/XjrajE

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

Why does my body feel devoid whenever I submit a post request from the React JS frontend?

Angular js: export const addUser=( username, email )=> { return (dispatch) => { fetch("http://yourdomain.com/addUser", { method: "post", credentials: 'same-origin', mode: 'no-cors', ...

What is the reason behind only one function being executed out of the two in the onClick event?

I am currently developing a basic react application that involves passing multiple functions to update a shared state object in the parent component. However, I have encountered an issue where only one of the two functions appears to be executed when trigg ...

What is the reason for calling specific functions as "illegal invocations" in JavaScript?

Imagine this scenario: var q = document.querySelectorAll; q('body'); Suddenly, an "Illegal invocation" error pops up in Chrome. It's puzzling why this happens, especially considering that not all native code functions behave this way. Tak ...

Exploring IP geolocation integration within Rails 3

I am looking to add a dynamic feature to my homepage that will display the location object closest to the reader's physical location. Currently, I have a Location model with longitude and latitude fields. My goal is to retrieve the location model obj ...

Angular 2's Conditional Validation: A Comprehensive Guide

Angular 2 offers straightforward validation, which is a great feature. However, the challenge lies in making a required field optional based on another field's selection. Below are the validation rules: this.contractsFilter = this.fb.group({ selec ...

Challenges encountered when using promises for handling mysql query results

I've been working on creating a function that will return the value of a mysql query using promises. Here's what I have so far: query(query: string): string { var response = "No response..."; var sendRequest = (query:string): Prom ...

Enhance row visibility by clicking a button in an ajax table

I'm facing an issue where I am trying to apply a highlight class to the selected row in an ajax table when clicking on the edit button, but for some reason my code is not working as expected. Can someone assist me with this problem? Thank you in advan ...

Is JSDOM capable of configuring exuberant ctags for a project setup?

Anticipating great javascript ctags support got me considering the possibility of using a project like to configure ctags for optimum vim usage. ...

My component reference seems to have gone missing in angular2

Trying to load my Angular 2 app, I encountered this error: https://i.stack.imgur.com/FmgZE.png Despite having all the necessary files in place. https://i.stack.imgur.com/kj9cP.png Any suggestions on how to resolve this issue? Here is a snippet from ap ...

Customizing the appearance of input range in Firefox

I am having trouble styling the HTML input range element. I have successfully styled it for webkit browsers, but my styling does not seem to work on -moz- browsers. I attempted to use pseudo elements before and after on moz-range-thumb, but it seems that F ...

What is the best approach for filtering a nested array in this scenario?

Here is the response I am getting: let m = [ { name: 'Summary', subListExpanded: false, subList: [ ] }, { name: 'Upload', subListExpanded: false, subList: [ ...

Performing an AJAX call using jQuery within a PhoneGap application to communicate with a Node JS server

I've searched everywhere online for a practical demonstration of a jQuery AJAX call to a Node JS server, but to no avail. Typically, a jQuery AJAX request to a PHP server follows this format: $("button").click(function() { $.ajax({url: "http://w ...

Encountered a SocketTimeoutException while trying to parse JSON data from a

Can someone assist me with parsing HTML using Jsoup from this specific URL on Sierra's clearance page for women's red items within a price range of $10 to $14.99: Whenever I attempt to parse the HTML from this URL, I encounter the following erro ...

Data-attribute does not support Angular binding functionality

Using a CSS HTML template that includes various HTML components and data-attributes, such as for a slider: <div class="slider slider-default"> <input type="text" data-slider class="slider-span" value="" ...

The setInterval function appears to be undefined despite being explicitly defined earlier

Within the HEAD section of my code, I have defined a function like so: <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"> function live() { $.get("http://mydomain.com/script.php", function(data){ var timer ...

Unleash the power of nesting Angular ng-repeats to enhance your

I've designed a template that looks like this... <div ng-repeat="itemEntry in itemEntry"> <!-- content --> <section class="product-view-wrapper" ng-repeat="productView in itemEntry.Productview"> <div class="slide" ng ...

Tips for accessing a value in a multidimensional json array without the key in JavaScript/jQuery?

I'm working with a JSON file that contains a multidimensional array. The array consists of city data at the first level and temperature data at the second level. I'm facing difficulties in dynamically extracting values from the second level. I a ...

Building a dynamic web application using JDBC Template, AngularJS, and RESTful APIs

Seeking guidance on populating an HTML table with data from an MS SQL Database. I have configured my app.properties for the sql server and initialized my jdbcTemplate in my .java file. As a newcomer to AngularJS and jdbcTemplate, any example code or pointe ...

Utilizing jQuery AJAX to enable a functional back button feature upon modifying HTML

While there are numerous inquiries regarding jQuery and Back button issues, the focal point is typically on maintaining history features when using the browser back/forward buttons. One specific query I have is how to load an AJAX-affected HTML page when ...

Organizing components within a division

It's maddening... I'm working on a website and trying to create a header div that includes the site name, search bar, and sign in/log in buttons. I want the logo on the left, search bar in the center, and sign in/log in buttons on the right, sta ...