MUI enables the creation of a fixed vertical box anchored at the bottom of the screen

I’ve attempted the following so far:

import "./styles.css";
import { Box, Typography } from "@mui/material";
import styled from "@emotion/styled";
export default function App() {
  const MainStyle = styled("div")(({ theme }) => ({
    position: "fixed",
    zIndex: 99999,
    right: 0,
    bottom: 0
  }));
  return (
    <MainStyle>
      <Box sx={{ transform: "rotate(-90deg)", backgroundColor: "blue" }}>
        <Typography sx={{ color: "white" }}>CHAT WITH US!</Typography>
      </Box>
    </MainStyle>
  );
}

The issue I’m facing is that half of the box extends off the screen and doesn’t align all the way to the right.https://i.stack.imgur.com/aolXr.png

My objective is to have it positioned in the right corner with the entire box visible, similar to how displays their "chat with us, we are online" prompt, but specifically on the right side.

Answer №1

writing-mode: vertical-lr; is a useful CSS property that can be implemented in your code.

  • To see an HTML example showcasing the use of writing-mode: vertical-lr, visit this resource.
    .content {
      position: relative;
    }
    
    .text {
      writing-mode: vertical-lr;
      border: 2px solid #000;
      position: absolute;
      top: 15px;
      right: 15px;
      height: 120px;
    }
    <div class="content">
      <p class="text">Sample text</p>
    </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

Customize the appearance of semantic-ui-react components with hover effects

When I assign a specific className to components like <Segment className="Change" color='blue' inverted></Segment> and then in my CSS I apply the following: .Change:hover{ background-color: black; //or any other hover effect } N ...

Navigating through Expression Engine and utilizing conditional statements

Would greatly appreciate some assistance with this issue. I am working on an Expression Engine website and encountering difficulties with simple conditionals for navigation active states. Despite having a color state designated within the styles, there s ...

Incorporating Bootstrap's Inline Design Elements

I am having trouble aligning a series of elements horizontally using bootstrap as shown in the example image below: Whenever I add the "form-control" class to the input element, it gets pushed down below the other elements. I have experimented with differ ...

Ensuring Consistent Headings While Scrolling

Imagine having headings structured like this: <h1 class="fixontop">heading 1</h1> content goes here. . . . long paragraph. <h1 class="fixontop">heading 2</h1> 2nd content goes here. . . . long paragraph. <h1 class="fixontop"> ...

What is the best way to enlarge a Material UI card?

Currently, I am utilizing Material UI version 4 on my website and integrating cards (for more details, click here). https://i.stack.imgur.com/dm2M2.png I am interested in enlarging the overall size of the card so that the image appears larger. As I am si ...

Encountering a vast expanse of empty white void

Attempting to create a scrollbar within my content div instead of the entire window seems to be causing a large white space in the content box, and I'm struggling to understand why. Can someone take a look and help me identify the issue? You can view ...

The padding of DateTimePicker from Material UI gets altered upon reloading the page

Experiencing an issue with the DateTimePicker component from Material UI. Upon page reload, it seems to lose its initial padding of 10px on each side. Initially, upon rendering, it appears as shown below: However, after reloading the page, it changes to: ...

How can I showcase Bootstrap cards horizontally within a razor foreach iteration?

I seem to be experiencing a mental block on how to arrange bootstrap cards in a horizontal layout using a for each loop. By default, they appear vertically. Below is my razor code: @foreach (var item in Model) { var imgUrl = Url.Content("~/Conte ...

In ReactJS, when you encounter TextField values that are "undefined", it is important to handle them appropriately

I'm a beginner when it comes to ReactJs and Material-UI, so please bear with me if my question seems silly. Currently, I have a file named Main.js which includes the following code snippet: handleChange = (name, event) => { if(event==null) ...

How to properly pass arguments in React component constructor using the binding method

After reading an article that suggested incorporating event handler binding in the constructor of my React project, I made the switch. However, I encountered a problem where I lost the ability to pass my form variable to the onChange Material-UI Checkbox f ...

What are the ways to incorporate the width property in @media queries within CSS?

I've been struggling to set the width inside @media in my code, but it's not working as expected. Here is what I have tried: mat-toolbar { app-toolbar-left { width: 35%; } app-toolbar-right { width: 22%; } } @me ...

Moving the sidebar from the app component to a separate component in Angular results in a situation where the sidebar does not maintain full height when the page is scrolled down

Within my Angular application, I have implemented a sidebar as a separate component. Previously, the content of the sidebar was housed within the main app component's HTML page, and it functioned properly by taking up the full height of the page when ...

Switching out one block of HTML with another in JavaScript is a powerful way to dynamically update

I am working on creating a feature on a webpage where clicking a button will change the HTML code inside a specific div. Essentially, I want to be able to update the content of a div by simply clicking a link. Here are two different sets of HTML code: Co ...

The footer is anchored at the bottom on one page but mysteriously relocates to the center on the next page

I've been working on creating a footer for my Angular application and here's the code for it: // HTML <footer class="footer"> // code for footer </footer> // LESS .footer { position: absolute; bottom: 0; width: 100% ...

Tips on aligning images of various sizes with text within a row using CSS

Looking for help aligning four different height (ranging from 160-180px) svg images with text positioned directly below each image. I want the images to be neatly aligned in a row, but I'm struggling to align the short text underneath them in a single ...

Animation does not trigger before switching pages

I'm attempting to create an animation that occurs before the page transitions. After finding a jQuery script on this site and tweaking it to match my HTML, I realized the code works in a fiddle but not on my actual page. Any assistance would be greatl ...

Guide to changing the background color of material ui drawer component using styled-components

Issue with Styling Material Ui Drawer Using Styled Components In my application, I am utilizing a Material ui drawer in conjunction with Styled components. Although I have successfully styled several simple Material ui components using Styled components a ...

Steps for placing my material ui app drawer below the header:

Screenshot of Material UI sidebar being fixed <= This image shows the issue I am experiencing I need my app drawer to appear below my header paragraph, but currently it is fixed in place and overlapping with the header. In my App.js file, I have inclu ...

Show only the populated fields in a user profile with ReactJS

Purpose Showcasing only completed fields. Context In my app, users fill out an application with fields like "early reg fee, early reg date, regular reg fee, regular reg date". After completing all the information and clicking "view profile", they should ...

Strategies for Resolving the IE 8 Issue with Table Row Background Images

Looking for some assistance with this issue. The solution I found doesn't seem to be working properly in IE 8. In short, when you add a background image to a table row, the background is showing up in all the inner cells as well. ...