Creating rotated text in CSS for adaptable website designs

I have utilized the solution provided in a previous question I asked: Rotated text producing inconsistent results, but I am looking to display the text in a different way. Specifically, I want the first letter of the word to be at the top with the rotated text anchored to the bottom right, as shown in the screenshot below. Currently, my code starts the word at the bottom, and the solution should be compatible with a fluid/responsive layout.

Here is the JSFiddle link for reference: https://jsfiddle.net/wy0qq027/

Desired Outcome:

https://i.sstatic.net/up0sf.jpg

CSS:

html,body,.carousel,.carousel a.item { height: 100%; }
.carousel a.item {
  height: 100%;
  padding-top: 100px;
  position: relative;
  overflow: hidden;
  width: 25%;
  float: left;
}
.rotate {
  white-space: nowrap;
  position: absolute;
  bottom: 50px;
  left: 100%;
  transform-origin: left bottom;
  transform: rotate(-90deg);
}
.carousel a.item h1 {
  color: #fff;
}
.bg-image {
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

Answer №1

To achieve the desired effect, you'll need to rotate the text by 90 degrees in a positive direction and then position the div on the right side instead of the left.

.rotate {
    white-space: nowrap;
    position: absolute;
    bottom: 50px;
    right: 100px; /* offset from right */
    z-index: 1;
    transform-origin: right bottom;
    transform: rotate(90deg);
}

Check out this working jsfiddle fork for reference

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

Retrieving various data from the created panel

I've come across an issue with my logic that involves looping and adding a new Panel control to another control: for (int segmentIndex = 0; segmentIndex < segments.Length; ++segmentIndex) { holder.Controls.Add(new Panel() { Width = Unit.Percen ...

establishing a CSS class for the containing element of an active route link in Angular version 2 or later

I have a bootstrap 4 navbar that includes a dropdown menu with routes. I am able to show the active route based on 'routerLinkActive', but I also want to style the 'dropdown-toggle' or 'nav-item' as active when one of its chil ...

How to collapse one section while expanding another in Bootstrap 4?

const cur_url = window.location.href.split('#')[0].split('?')[0], body = $('body'), menu_toggle = $('.menu-toggle'), sidebar_menu = $('#sid ...

Adjust the Size of iFrame Content Using JavaScript

Is there a way to automatically resize the content within an iFrame so it fits without adjusting the size of the iFrame itself? I want all the content inside the iFrame to scale down if there is too much to display. Does anyone have any suggestions on how ...

The problem with floating labels

I have been attempting to incorporate the floatlabels feature from floatlabels, but I am encountering difficulties in getting it to work properly. Here is the sequence of steps I have taken: Firstly, I include the JS file <script src="js/floatlabels. ...

As the browser window is resized, the gap between images widens while the images themselves decrease

Hey there, I'm encountering some trouble with the image links at the top of my page. As I resize the browser or change screen resolutions in media queries using percentages, the images are resizing accordingly. However, I'm noticing that as the i ...

The numbering in Chrome with slidetoggle is inaccurately displayed by the CSS Counter feature

Description:- The counter is incrementing continuously on slide toggle. It is providing a continuous number to the li outside of ol. The issue is appearing in Chrome, but it works fine in Mozilla. What could be the solution for this? I have included the ...

Align a single <td> element in the center of a row while the other row contains multiple <td> elements

I am facing an issue with centering a <td> element in a row, especially when there are multiple <td> elements in the same row. The first row's <td> element remains fixed in the first column position and does not move to the center as ...

What is the reason behind having a selectedOptions property rather than just a selectedOption?

Why does the selectedOptions property of select return an HTMLCollection instead of just one HTMLOptionElement? As far as I understand (correct me if I'm wrong), a select element can only have one selected option, so why do I always need to access it ...

Tips for concealing divs when hovering over them

I have designed a header for my website with the following styles: .header-cont { width:100%; position:fixed; top:0px; } .header { height:50px; background:#F0F0F0; border:1px solid #CCC; width:950px; margin:0px auto; } .hea ...

The content within a container that has flex-grow: 1 is exceeding its bounds instead of being able to scroll

I am currently facing an issue with a container that is set to grow within a fixed size container and I need help figuring out how to make the content wrapper element scrollable. Specifically, the flex-grow container houses a div that is larger than the c ...

Angular JS: Changing Byte Array into an HTML File

I created an HTML file using ASPOSE workbook and stored it in a memory stream in C#. Now, I am trying to show this HTML file in an Angular JS environment within the Div element. C# Snippet: wb.Save(htmlMemoryStream, new HtmlSaveOptions() { IsExportComment ...

Updating a Div on your webpage using a JQuery UI dialog: A step-by-step guide

I am currently trying to update my webpage from a JQuery UI dialog, but the code I have so far does not seem to be working. Any assistance or guidance would be greatly appreciated. function submit_new_site() { // These are the input text IDs on the ...

One function is failing to execute properly due to multiple if conditions

Take a look at my JavaScript code below: function showLater1() { if ((vidos.currentTime >= 30) && (vidos.currentTime <= 34)) { lay.style.opacity = "1"; content.style.opacity = "0"; controls.style.opacity = "0"; ...

A database table named after a pair of digits

My database tables are named "30" and "kev." When I query the table named "30," I receive the following error message: Warning: Invalid argument supplied for foreach() in # on line 94 However, when I query the kev table, I do get the desired results. B ...

Enhancing 2D video viewing with Threejs interactivity

I want to create an interactive 2D video using three.js and maintain the aspect ratio of the video when resizing the browser window. Here is the code I am currently using: var camera, scene, renderer; var texture_placeholder, distance = 500; init() ...

reflecting on the attributes of CSS

Do you struggle with remembering CSS property names like I do? Wondering if it's common to use a cheat sheet for that purpose. If it is, could you share a reliable reference or cheat sheet for quick CSS property lookup? ...

How to effectively utilize Python to compare HTML files

Can the HTML be compared differently as shown below? html_1 = "<h1>text<h1>" html_2 = "<h2>text<h2>" Using Google's diff_prettyHtml may not yield accurate results. If I want to say that 1 has changed to 2: <h <del styl ...

How to extract text from a textarea without a value attribute using Python and Selenium WebDriver

I have exhausted all efforts and still need help. I am attempting to retrieve the text from an element on a page that displays as a popup within a frame, not as an alert or new window. Although WebDriver is able to locate the element, the text returned whe ...

Two distinct Div elements share an identical ID and Class name – but which one is actually the function?

One of my divs has a unique ID: id="1" Another div in a separate section has a different class: class="1". To trigger my function, I use the jQuery snippet below to simulate an onClick event on the ID div and perform an action on another div that shares ...