Troubleshooting problem with alignment on Angular HTML elements

https://i.sstatic.net/0ESwu.jpg

https://i.sstatic.net/GW0vz.jpg https://i.sstatic.net/EDWON.jpg

I am attempting to position the lower image to the right of the table. I believe there is a small setting that I'm overlooking, but I can't seem to locate it. In the code below, it's the saleForMonth element that I want to align to the right.

   <mat-sidenav-container>
    <mat-sidenav-content style="height:99vh;">
        <div style="float:left; margin:22px 0px 0px 32px;">
            <div style="text-align:center;">
            </div>
            <button mat-raised-button type="button" style="background-color:#3378a8;color:WHITE;height:45px;" (click)="sidenavOpen('sale',sidenav)">
                <b>SALE</b>
            </button>
            <button mat-raised-button type="button" style="background-color:#3378a8;color:WHITE;height:45px;margin-left:2px;" (click)="sidenavOpen('upgrade',sidenav)">
                <b>UPGRADE</b>
            </button>
            <div style="margin-top:53px">
                <div>
                    <salesByPackage></salesByPackage>
                </div>
                <div style="margin-top:240px;">
                    <salesByCampaign></salesByCampaign>
                </div>
            </div>
        </div>
        <div class="container" style="margin-top:20px;float:right">
                <div class="col-lg-9">
                  <mat-tab-group #tab mat-stretch-tabs (selectedTabChange)="onTabClick($event)">
                      <mat-tab label="SALES">
                          <orders></orders>
                      </mat-tab>
                      <mat-tab label="UPGRADES">
                          <upgrades></upgrades>
                      </mat-tab>
                  </mat-tab-group>
              </div>
              <!-- Change to this -->
              <div class="col-lg-3">
                  <div>
                      <salesForMonth></salesForMonth>
                  </div>
              </div>
              </div>
    </mat-sidenav-content>

Answer №1

<div class="row" style="float:right">
  <div class="col-lg-3">
    <monthlySales></monthlySales>
  </div>
</div>

Alternatively, you can use an empty div on the left side and give it a col-lg-9 class.

<div class="row">
  <div class="col-lg-9">

  </div>
  <div class="col-lg-3">
    abc
  </div>
</div>

Answer №2

In the event that your element called salesForMonth is not taking up the full width, consider applying this CSS -

<div style='width:100%; float:right'>
    <salesForMonth></salesForMonth>
</div>

Alternatively, adding float:right directly to your element may suffice.

Answer №3

    <div class="container col-lg-9" style="margin-top:20px;float:right">
        <mat-tab-group #tab mat-stretch-tabs (selectedTabChange)="onTabClick($event)">
            <mat-tab label="SALES">
                <orders></orders>
            </mat-tab>
            <mat-tab label="UPGRADES">
                <upgrades></upgrades>
            </mat-tab>
        </mat-tab-group>
    </div>
    <!-- Change to this -->
    <div class="container col-lg-3">
        <div>
            <salesForMonth></salesForMonth>
        </div>
    </div>

merge the two blocks into a single container, with one set as col-lg-9 and the other as col-lg-3

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 best way to transfer values from an iterated object in HTML to a component in Angular 2/4?

My Angular2/4 app allows for file uploads to S3. The setup is such that when a user uploads a file, it will be stored in an S3 bucket. Once uploaded, the user will be shown the list of files they have uploaded. In case they upload the wrong file by mistake ...

Hover state not responsive on screens of varying sizes due to style inconsistencies

Here are the CSS styles I'm using: @media (min-width: 769px) and (max-width: 992px) { .box:hover{ background-color:#000000; } } @media screen and (min-width: 993px) { .box:hover{ background-color:#ffffff; ...

I'm seeking assistance in understanding the concept of padding in HTML and CSS - can you

Currently learning html/css and facing an issue with adding a border-bottom to my .menu ul li ul li element. .menu ul li ul li{ padding:0; float:none; margin:0 0 0 0px; width:100%; border-bottom: 1px solid #911; } The border is being cut off on the right ...

Unable to apply Login Form Css to HTML

Creating a Login Form <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>Login Form</title> <link rel = "stylesheet" type="text/css" href="{{ ...

Retrieve a single document using Angularfire2 without setting up a listener

I'm facing an issue with angularfire2 v6 and angular 11. Specifically, I am attempting to retrieve a single document from the users collection based on their email without utilizing valueChanges() or snapshotChanges(). Realtime updates are not necessa ...

JSP generates unconventional HTML output

I'm encountering a strange issue with one of my JSP pages. It seems like the HTML is not being fully rendered. The output looks like this: <html> ... <table> ... </table> <div id= So, the last line is exactly what ...

Setting innerHTML does not affect the content of an SVG element

I am currently working on an Angular 7 application and I need to dynamically update the text value based on a dropdown selection. For example, if the id of the text element is 10, then I want to change the text from 'hi' to 'hello'. T ...

Unable to close Bootstrap sidebar menu on mobile devices

I implemented a sidebar menu for mobile that opens when you click on the hamburger icon, with a dark overlay covering the body. The issue I encountered is that on mobile devices, the visibility of the menu does not change when clicked outside of it. It wor ...

Tips for making content vanish or remain concealed behind a see-through header during page scrolling

I made a JavaScript fiddle http://jsfiddle.net/claireC/8SUmn/ showcasing a fixed transparent header. As I scroll, the text scrolls up behind it. How can I make the text disappear or be hidden behind the transparent div when scrolling? Edit: I should also ...

Ways to assign a default background shade to a webpage with a transparent background

My page has a completely transparent background achieved by using: body { background:none transparent!important; } When I display this page in a transparent iframe on another site, I can see the website's background through the page. However, if ...

What is the best way to remove the default outline in the <img> tag?

<img class="image_cover" src = "" /> .image_cover { width:25px; height:25px; border-style:none; border: 0; box-shadow:none; } Showing an example in a live demo on jsfiddle Encountering an issue in Chrome Version 33.0.1750.152, ...

I am attempting to swap values within table cells using AngularJS. Would it be recommended to utilize ngBind or ngModel, or is there another approach that would

How can I make a table cell clickable in AngularJS to switch the contents from one cell to another, creating a basic chess game? I want to use angular.element to access the clicked elements and set the second clicked square equal to the first clicked using ...

I don't understand what happens when I try to achieve a bottom border in CSS without using the bottom property

https://i.sstatic.net/XSUj0.png Is there a way to remove the bottom border on hover that is not affected by CSS? .bb-custom-wrapper>nav a { display: inline-block; width: 40px; height: 40px; text-align: center; border-radius: 2px; backgro ...

How can I dynamically insert various FormGroup instances into a FormArray in Angular?

I am looking to dynamically populate the order array with multiple dishes. Each dish will be stored as a FormGroup in the form, such as pizza, salad, drink, or any other type of dish. Prior to adding any items, the form structure should resemble this: this ...

Arrange content within DIVs using Bootstrap-4

I'm having trouble figuring out how to align and organize my div content using Bootstrap. I'm a bit confused about how it all fits together align-items- * text-* align-self- * justify-items- * justify-self- * I'm attempting to structure my ...

Span is the alternative to using breaks in XHTML, but unlike breaks, it does not allow for adding padding or margin

When working with xhtml, I encountered an issue where my description and header elements were not position correctly next to my image. I initially used div elements instead of span, which violated xhtml rules. Then I tried using span elements, but I was un ...

The cakePHP time dropdown feature lacks customization options

When viewing my form in CakePHP, I noticed that the time select dropdown appears differently in Chrome compared to Firefox. In Firefox, there are 3 arrow buttons attached to each dropdown, whereas in Chrome it looks different. I want to hide the arrow but ...

Two forms are present on one page, but the submit button is triggering validations for both forms simultaneously

Currently, I am facing an issue with two forms that share one submit button. The problem is that although I have implemented validation for both forms, the validations are not working separately. I want the validations to work independently - when I submit ...

Using PHP, let's display the next image

My website showcases image galleries organized in table format, like this: <table id="gallery"> <tr> <td><a href="largeimg.php?imageID=images/seascape/medium.Vietnam 19.jpg&caption= Vietnam, Cat Ba Island, Vietnam - 2015">< ...

Struggling to align an element in HTML when used in columns?

<div class="row"> <div class="col-lg-3 " style="border: groove;"> <p class="circle col-xs-1 center-block">01</p> <h3>trending courses</h3> ...