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

Populate two MUI-Autocomplete fields by selecting one item

Is it possible to have two different Autocomplete components on the same row within a table? I'm unsure if this can be done, and how to execute it based on the example provided below. [Feel free to check out the sandbox for more context] sandbox A ne ...

Designing websites or applications for mobile devices requires careful consideration of how content will

Currently, I am trying to use media queries to cater to mobile screens. The main problem I am encountering involves the text on the header when switching between Portrait and Landscape modes. In the landscape view, the top property overrides the portrait ...

displaying a video within an iframe without occupying the entire screen

After successfully implementing a fullscreen video background using the "video" tag with a video hosted on my own server, I decided to switch it out for a Vimeo video. However, after making the necessary code and CSS changes, the video now appears like thi ...

Unable to generate file with Compass

In my attempts to compile a project using compass, I have experimented with both the gui app and the command line. However, I consistently encounter the same error message in both cases: "Nothing to compile. If you're trying to start a new project, yo ...

Is there a way to conceal one column in a row and display only the second column from a medium screen to a small screen using Bootstrap 5?

I am currently working on creating a row with two columns, one being the left_bar column and the other a large image. My goal is to display only the large image (column 2) when the screen size changes from medium to small breakpoints, hiding the left_bar c ...

Setting a constant width for text characters across all devices using CSS and HTML

I am looking to display text in my textarea with the same width in pixels across all devices. Essentially, I want to set the character width in pixels so that it appears consistently on any device (Desktop/Mobile). <html> <head> <styl ...

How can I prevent the MUI date picker from automatically displaying today's date when the page loads?

When using the MUI Datepicker, I noticed that it displays today's date on page load even though no date is actually selected. I have tried setting the defaultValue prop to null and an empty string like this: defaultValue={null} defaultValue="" Howeve ...

Is it feasible to design a draggable Material UI dialog with an embedded Autocomplete feature?

I need assistance in creating a draggable Material UI dialog that includes an Autocomplete component in its contents. The desired outcome is shown in the following image: https://i.sstatic.net/Zp1fa.jpg When dragging the dialog on desktop (by dragging th ...

Ways to remove the default classes added by ngbootstrap

My current challenge involves utilizing ngbootstrap for popovers, yet desiring to override its default styling. Specifically, I have a form that should function as a popover triggered by a button click, and it needs to maintain its own distinct styles. Up ...

What steps can be taken to resolve the issue with the background's placement?

There seems to be an issue with the border being hidden. I've tried adjusting the background-position variables, but without success. Here is a code example: * { margin: 0; padding: 0; } .container { max-width: 1170px; width: 100%; ...

Arrange divs in a grid layout with evenly distributed dynamic spacing

I am not a big fan of bootstrap, so I was wondering if it is possible to achieve the layout without using it. I have 6 divs that I want to arrange in 2 rows and 3 columns. I need the space between each row/column to be precise. While I can calculate this ...

Using AJAX to refresh a div upon submitting a form, instead of reloading the entire page

My SQL database generates a table that remains hidden until the search button is clicked to display the results. I want to use ajax to update the table without refreshing the entire page. Currently, when the page refreshes, the table reverts back to being ...

Tips for adjusting image and div sizes dynamically according to the window size

In my quest, the end goal is to craft a simplistic gallery that closely resembles this particular example: EXAMPLE: This sample gallery is created using Flash technology, but I aim to develop mine utilizing HTML, CSS & Javascript to ensure compatibil ...

Text centered over an animated underline using CSS

Seeking help with my bootstrap 4 nav menu. I have implemented a CSS animation that creates an outward underline effect for the nav-link items. However, I am struggling to center the text above the line. Any suggestions on how to achieve this? I attempted ...

Steps to position an image without a background in the middle of a smaller container:

My HTML includes the following code: <div style="width:400px;height:300px;overflow:hidden;"> <img src="http://d39kbiy71leyho.cloudfront.net/wp-content/uploads/2016/05/09170020/cats-politics-TN.jpg" /> </div> Take a ...

When will the search bar toggle and the logo appear sliding down?

.navbar { background-color: #F91F46; } .src-bar { border: 0; border-radius: 5px; outline: none; padding-left: 15px; width: 30vw; } <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" in ...

Column with space between arranged rows in a container

I have a container with multiple rows, each containing several columns. I am looking to adjust the spacing between each column <div class="main" style="margin-bottom:0px"> <div class="container"> <div class="row"> <div ...

The alignment of Bootstrap input fields is off center

@import url( 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' ); <div class="row"> <div class="col-xs-12 text-center btn-group" data-toggle="buttons"> <label class="btn btn-primary active"> ...

The correct Loader for managing this specific file format - Next.js

Interestingly, running the command npm run build seems to function properly within the npm module I am developing. It's worth mentioning that this module is focused on MUI Theming and also features some Nextjs components. However, when attempting to ...

What could be causing the submenus in my intricate menu component to lose focus when input is entered?

I'm currently working on developing a menu using the MUI Menu component. The goal is to have a popup input control (such as Autocomplete, TextField, Select, or a custom form) appear when a menu item is clicked, based on the choice made from the menu. ...