Utilizing collection-repeat with thumbnail cards and unconventional margins

I have created a collection-repeat feature that loops through my objects and populates cards based on them. I am facing two main challenges in completing this task. Despite using 'Thumbnail' cards, I am struggling to properly set margins. The issue lies in the fact that it adds margin on the left side but not on the right or between different cards (bottom margin). I have attempted to use CSS for this, but so far nothing has been successful.

Below is the snippet of my HTML code:

<div class="card" collection-repeat="item in items" item-width="'100%'">
    <div class="item item-divider">
        {{item.eventTitle}}
    </div>

    <div class="item item-text-wrap">
        <b>{{item.eventHour}}</b><br />{{item.eventText}}
    </div>
</div>

Upon viewing the result in the browser without any custom CSS applied, there are noticeable issues with the left and nonexistent right margins:

https://i.sstatic.net/iLljI.png

I am seeking guidance on how to address both the bottom and right margin concerns. Any insights would be greatly appreciated.

Thank you for your assistance in advance.

Answer №1

Is there a specific reason you have chosen to use collection-repeat? Keep in mind that it may limit your options for styling.

If you convert to a simple ng-repeat, many of your issues will likely be resolved. Check out this example: http://codepen.io/aaronksaunders/pen/PzZVPr

<ion-content>
  <div class="list">
    <div class="card" ng-repeat="item in items">
      <div class="item item-divider">
        {{item}} HEADER
      </div>
      <div class="item item-text-wrap">
        {{item}} BODY..
      </div>
    </div>
  </div>
</ion-content>

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

"Looking to format dates in AngularJS? Here's how to do it

Can anyone provide guidance on how to format the /date()/ function in angularjs 1.6? I am looking to format it within HTML rather than inside the javascript controller. I attempted to use angular-relative-date without success. ...

Copy and move icons by dragging and dropping them in unison

I have two bordered spaces for tools and a free space (droppable area). The tool space includes some shapes that can be dragged and dropped into the free space. One issue I would like to address is regarding cloning. How can I add a clone of icons back in ...

check if JSON value is not null

Display items in ng-repeat only when the value of a certain key is not empty. Here is the code snippet: <a class="item" href="#" ng-repeat="e in events | orderBy:'match_time'" ng-if="e.match_timer !== NaN && e.match_status !== ' ...

Versatile HTML elements for styling both inline and block content

Is there an HTML tag I can use to encapsulate other content for styling purposes without impacting the layout, such as setting the background color? This is particularly relevant when the nature of the content (inline or block) is not known in advance. Co ...

Tips on resizing images in CSS with accompanying text to prevent overlap

In my school project, I am using cloud9. When utilizing the live preview in a small window pane, my images appear correctly sized. However, upon maximizing my screen browser, the images stack on top of each other and their dimensions increase. My ideal l ...

What is the best way to display HTML content inside a pop-over window?

How can I load popover content from another HTML file using templateUrl in AngularJS? Check out the demo below: HTML: <!DOCTYPE html> <html ng-app="plunker"> <head> <meta charset="utf-8"/> <title>AngularJS Plunker& ...

Instructions for activating the click function for each individual looping image

When creating a blog page, I am using PHP to loop the like button images according to the total count of posts (example: Facebook like button). The issue I am facing is that while the PHP loop is working, when I click on the first post image, only the firs ...

Creating a search form in Bootstrap 4 that is centered and expands to full width only on small screens

I'm currently working with a bootstrap v.4 navbar that has 3 elements in it. I've managed to align the elements evenly so that the search bar is centered in the navbar. However, when it collapses it takes up the full width of the screen. Here is ...

Using AngularJS to Adjust a $Resource Parameter When the DLL is Altered

I recently took over an Angular application that communicates with a Web API service. My goal is to maintain the original structure as much as possible while incorporating a new requirement to pass in a specific number of days. I have updated the call acco ...

What is the best way to conceal AngularJS expression while the page is still loading?

I'm facing an issue with the following code snippet: div {{count}} When I use JavaScript to replace this code with a value, everything works fine. But every time I refresh the page, the {{count}} is displayed initially until the page finishes loadin ...

What is the reason for padding influencing the overall dimensions?

The result I achieved was unexpected. After realizing that the text was positioned above the green markers, I decided to add some internal padding to the three pink containers. To my surprise and disappointment, when I made this adjustment, it ended up lo ...

Rearrange elements by swapping based on their z-index and layer order

Trying to design a unique CSS effect where there is a fixed colored element in the top left corner of a webpage. The background consists of different stages or chunks (red, green, blue) each with a height of 1000px. I want the color of the icon to transiti ...

How can I align text within an Input component to the right or center using MaterialUI?

Is there a way to align text within a Material UI input text element? The code snippet below doesn't seem to have any effect. I am currently working with version 1.x of Material UI. import {Input} from 'material-ui'; //Alignment attempt th ...

Learning the ins and outs of HTML5 and CSS3

Does anyone have recommendations for high-quality HTML5 and CSS3 tutorials? ...

Unable to locate and interact with element using CSS Selector in the webdriver

I am having trouble locating the element that contains both "Confirm" and "Cancel" without using Xpath. Can anyone suggest a better approach to find this element? Below is the HTML code snippet: <div class="ui-dialog-buttonpane ui-widget-content ui- ...

Menu rollout problem when clicking or hovering

I'm facing challenges in making my menu content appear when a user clicks or hovers over the hamburger menu. My app is built using Angular, and I've written some inline JavaScript and CSS to achieve this, but the results are not as expected. Here ...

Issue with Bootstrap container's max-width not functioning

After implementing the code in the following manner: <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <link href="css/bootstrap-responsive.css" rel="stylesheet" type="text/css"> <style type="text/css"> .con ...

Choosing both large font and low vision CSS stylesheets concurrently

I'm currently working on designing one of my initial websites and have encountered a dilemma. I have three different stylesheets - one for low vision, one for large font, and the default one. I have three buttons to select these stylesheets, but I&apo ...

How can I loop through JSON in AngularJS to populate fields without knowing the key value?

Here is the data structure that I'm working with: { "0": { "keyword": "flower", "short_desc": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "pt_value": "5" }, "1": { "keyword": "tree", "short_desc": "Lorem ipsum dolor sit amet, consecte ...

What is the best way to effectively utilize bootstrap and JavaScript together?

I've been trying to implement some JavaScript on top of Bootstrap 5, but it doesn't seem to be working. I'm not sure if I'm doing something wrong with the JavaScript itself, or if there's an issue with how it's interacting wit ...