Spin the content of the HTML body using CSS

I need help rotating the HTML body using CSS. Here is the code I have tried so far:

-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);

I have tested this in IE, Chrome, and Firefox, but it does not work in any browser. Can anyone point out what I might be doing wrong?

body {
  font-family: Arial, Verdana;
  font-size: 10pt;
  background-color: #eeeeee;
  margin: 0;
  overflow: hidden;
  -webkit-transform: rotate(90deg);
  -moz-transform: rotate(90deg);
  -o-transform: rotate(90deg);
  -ms-transform: rotate(90deg);
  transform: rotate(90deg);
}
/* Current day display */

#head {
  font-weight: bold;
  font-size: 30pt;
  margin: 50px 0 30px 60px;
}
#page_navigation {
  bottom: 0;
  /*display: none;*/
  margin-left: 10px;
  height: 34px;
  text-align: center;
  position: fixed;
}
table {
  width: 90%;
  height: auto;
  border-spacing: 2px;
}
th {
  background-color: #009de0;
  color: #ffffff;
}
td div {
  overflow: hidden;
  text-align: center;
}
.content {
  -webkit-transform: rotate(180deg);
  -moz-transform: rotate(180deg);
}
.c1 {
  background-color: #c7ebfc;
  width: 20%;
  color: #009de0;
}
.c2 {
  background-color: #c7ebfc;
  width: 20%;
  color: #009de0;
}
.c3 {
  background-color: #c7ebfc;
  width: 40%;
}
.c4 {
  background-color: #b9e6fb;
  width: 20%;
}
.c5 {
  background-image: linear-gradient(to right, #D2D3D5 3%, #FFFFFF 8%, #D2D3D5 15%);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
}
.c6 {
  position: relative;
  margin: 28px 0 0 50px;
  height: 50px;
  z-index: 99;
}
.c7 {
  width: 100%;
  border-spacing: 1px;
}
.c8 {
  width: 50%;
  vertical-align: top;
}
.c9 {
  width: 50%;
  vertical-align: top;
}
.c10 {
  height: 332px;
  width: 627px;
}
.c11 {
  width: 50%;
  vertical-align: top;
}
.c12 {
  width: 50%;
}
<div id="content">
  <div id="logo">
  </div>
  <div id="title">
    Seminar
  </div>
  <div id="head">
  </div>
  <hr />

  <div id='events_head'>
    <table>
      <tr>
        <th class="c1">
          Seminar
        </th>
        <th class="c2">
          from
        </th>
        <th class="c3">
          to
        </th>
        <th class="c4">
          Buildung
        </th>
        <th class="c5">
          Room
        </th>
      </tr>
    </table>
  </div>
  <div id='events'>
  </div>
  <!-- An empty div which will be populated using jQuery -->
  <div id='page_navigation'>
  </div>
</div>

Answer №1

Even though your code is functioning properly, I have a jQuery solution for you to experiment with. (I noticed that jQuery wasn't tagged, but it was included in your code.)

I just developed this plugin that handles rotations.

jQuery.fn.rotate = function(angle, speed, d) {
    if(typeof speed == 'undefined') var speed = 50;
    if(typeof angle == 'undefined') var angle = 360;
    if(typeof d =='undefined') var d = 0;
    ctx = this;
    setTimeout(function(){
        console.log(d);
        $(ctx).css({
            '-webkit-transform' : 'rotate('+d+'deg)',
            '-moz-transform' : 'rotate('+d+'deg)',
            '-ms-transform' : 'rotate('+d+'deg)',
            'transform' : 'rotate('+d+'deg)'
        });
        d++;
        if(d<=angle) $(ctx).rotate(angle, speed, d);
    }, speed)
};

The first parameter specifies the rotation angle, the second determines the rotation speed, and the third can be ignored.

Once you've added the plugin code to your webpage, you can use:

$('body').rotate(90, 10);

This will rotate the page by 90 degrees.

Check out the demo here: http://jsfiddle.net/63u1bgfw/

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

How to create list item bullets with a star icon using reactstrap/react?

As a machine learning professional looking to enhance my frontend skills, I am curious about how to create list item bullets using a custom star bullet image. Could anyone please share a complete HTML/CSS example with me? Thank you in advance! ...

Combining CSS Selectors

Can you combine these selectors into one for ul#footer_navigate: ul#social_footer li a:link, ul#social_footer li a:visited {} I would like the same selector to apply for both anchor states on the ul with ID #footer_navigate. Is there a different approac ...

What is the best way to increase the size of an element within a row if it does not have any other siblings?

Here is the code snippet for your reference: https://codepen.io/Kezhich/pen/pXNevv Inquiry: How can I ensure that the input-group expands to the full width of the container when there is no round-button present? I have attempted using flex-grow but it d ...

A strategy for concealing the selected button within a class of buttons with Vanilla JS HTML and CSS

I have encountered a challenging situation where I am using JavaScript to render data from a data.json file into HTML. Everything seems to be functioning correctly, as the JSON data is being successfully rendered into HTML using a loop, resulting in multip ...

Interact with the horizontal click and drag scroller to navigate through various sections effortlessly, each designed to assist you

Currently, I am facing an issue with my horizontal scrolling feature in JavaScript. It works perfectly for one specific section that has a particular classname, but it fails to replicate the same effects for other sections that share the same classname. ...

Selenium not registering click on enabled element

I am trying to trigger a click event on an element on the page, but for some reason the Selenium click function is not working as expected. Here is the relevant code snippet: username_form = driver.find_element_by_id('form3-username') passwor ...

Is there a way to modify just the homepage url of the logo on a WordPress website using the OceanWP theme?

My website, abc.com, is set up with Angular for the homepage and WordPress for the blogs. The WordPress site is located in a subfolder within abc.com. You can see the file structure in the image below. I am now looking to change only the homepage link on ...

The webpage must be designed to be compatible with screen resolutions starting from 800 x 600 pixels and higher, utilizing Angular

I am working on developing a webpage that is specifically designed to work for resolutions of 800 x 600 pixels and higher. Any other resolutions will display the message "This website can only be accessed from desktops." Here is my approach using jQuery: ...

a guide on fetching information from mysql and showing it in a text box

I want to design an html form that consists of 4 columns: item, quantity, cost, and amount, all within a single PHP file. The item column should be a select tag fetching data from a MySQL table, which is functioning correctly. Upon selecting an item, the ...

Angular: Implementing asynchronous data retrieval for templates

I am currently facing the following issue: I need to create a table with entries (Obj). Some of these entries have a file attribute. When an entry has a file attribute (entry.file), I need to make a backend call to retrieve the URL of that file: public g ...

Highlighting DOM elements that have recently been modified in Angular

Is there a simple way to change the style of an element when a bound property value changes, without storing a dedicated property in the component? The elements I want to highlight are input form elements: <tr field label="Lieu dépôt"> ...

Unable to access the suggestion list within the modal

I incorporate the PrimeNG AutoComplete feature within a PrimeNG Dialog, displaying a list of elements below the AutoComplete in the dialog. My objectives are: To set the max-height of the modal dialog to 300, and have a visible scrollbar if the total ...

Implement HTML code within WordPress labels

Seeking assistance with customizing certain menu items in a WordPress website. Wondering if it's feasible to include HTML/CSS in the title label? My current situation is as follows: I only want one result to be highlighted in blue. I attempted to ...

Display an image when the cursor hovers over a text

I'm attempting to display an image when hovering over specific text. The image should not replace the text, but appear in a different location. The concept is as follows: When hovering over the word "Google", the Google logo should appear in the red ...

Tips for organizing certain elements in a horizontal row

In the process of developing a WordPress plugin for shortcodes generation. The user can choose to create testimonials. For example, the shortcode below functions as a slider: [testimonial]Content 1[/testimonial] [testimonial]Content 2[/testimonial] [test ...

Coloring the entire table as a whole instead of individual cells

I'm struggling with formatting a table that displays roles as "EXISTS" or "MISSING". The issue is that the code I found online to color code the cells is coloring the entire table green, not just the cells with "EXISTS". I'm not very familiar wit ...

New to jQuery: struggling with click event and CSS... What am I missing here?

I have a very simple question for you: $j(".srch-txt").click(function() { $j(this).css("color:" "#155D97") }); $j is used to avoid conflicts It's quite straightforward: I want to change the color of the .srch-txt element to #155D97 when it is click ...

Utilize flexbox to make two elements on the same line

Is it feasible to have two elements on the same line when aligning a series of elements with flexbox? Consider this scenario: .outer { display: flex; flex-direction: column; margin-left: auto; margin-right: auto; width: 50px; } .outer .inner ...

Bug on a Safari browser when using a dotted border on a table

Issue in Safari and Chrome browsers: CSS: TABLE { width: 100%; clear: both; border: 0px; border-collapse: collapse; } TABLE TH, TABLE TD { padding: 10px; text-align: center; border: 1px dotted #898989; } ...

Resolve a container overflow problem within the footer section

Trying to adjust the footer (newsletter signup form) on this page to fall to the bottom of the page has been a challenge. The #container element appears to be larger than the body, causing layout issues. Any suggestions on how to resolve this? An image d ...