Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8179897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:05:59+00:00 2026-06-07T00:05:59+00:00

Am attempting to dynamically create html which then injects itself as an iframe into

  • 0

Am attempting to dynamically create html which then injects itself as an iframe into jquery to open a print window with pagebreaks.

I’m receiving a session variable which contains a list of id’s.
for each I want to create a block:

<div class="card">
    <div class="top-center">
        <div class="first-line">
            some text
        </div>
        <div class="second-line">
            some text
        </div>
        <div class="second-line">
            some text
        </div>
    </div>
    <div class="bottom-center">
        <div class="first-line">
            some text
        </div>
        <div class="second-line">
            some text
        </div>
        <div class="second-line">
            some text
        </div>
    </div>
</div>

The JQuery plugin i’m using is: http://www.position-absolute.com/creation/print/.

What i want to do:
Rotate the text 90°

*
{
    margin: 0px;
    padding: 0px
}
.card { 
    -webkit-transform: rotate(90deg);
    page-break-after:always;
    /* this is taken from w3schools*/
    margin-left:auto;
    margin-right:auto;
    width: 70%;
}

I suppose you could look at this as landscape page
What i want then is as you tilt your head the required 90° the top-center is the left side
and bottom-center is the right side as you would fold each page by the short edge.

each div bottom/top is supposed to be dead in the middle of the page after the rotation
both vertically and horizontally.

How do i acquire the aforementioned page-setup with css

Should look something like this:
http://goo.gl/lNP8J

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:06:00+00:00Added an answer on June 7, 2026 at 12:06 am

    For rotating the content, as a start, you’ll need to set the transform-origin, the point that should be used as the center of rotation. You may also have to give the rotated element a fixed width in px or em (it didn’t seem to work well when I tried it with a width in %). And be sure to use the full range of selector prefixes for transform and transform-origin to support the different browsers.

    Something along the lines of the following:

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

    Edit:

    Here’s a simplified version that may get you slightly closer. In the following CSS, I’m setting a fixed width for the content (in this case 400px), and forcing 100px of top and left spacing for the rotated content. In this example I’m not attempting to center the content, but the placement can be adjusted by editing the CSS (to make it look more centered). This doesn’t address multi-page printing (especially how to do so with rotated content), but hopefully it’s a step in the right direction:

    .card {
        width: 400px;
        background-color: #eee;  /* Temporary bg color, for testing */
    
        -webkit-transform-origin: 0 0;
        -moz-transform-origin:    0 0;
        -ms-transform-origin:     0 0;
        transform-origin:         0 0;
    
        -webkit-transform: translate(100px, 500px) rotate(-90deg);
        -moz-transform:    translate(100px, 500px) rotate(-90deg);
        -ms-transform:     translate(100px, 500px) rotate(-90deg);
        transform:         translate(100px, 500px) rotate(-90deg);
    }
    

    Here’s a jsfiddle demo. In the translate functions, the 500px is 400px for the width plus 100px top spacing. Adjust the width and the translate() values as needed to experiment with it.

    You may have to avoid using % for either the width or height of the content (or at least, it may be far simpler if you can avoid doing so).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to evaluate two dynamically assigned variables; then attempting to assign a
I am attempting to dynamically create a profile page. Everything works fine except when
I am attempting to create a long range calendar that dynamically loads (and unloads)
I'm attempting to create a listview that binds dynamically to a set of dates.
I'm attempting to create a framework for allowing controllers and views to be dynamically
I'm attempting to create a few radio buttons and add them a RadioGroup dynamically.
I am currently attempting to create an Inno script installer which requests a list
I was attempting to dynamically create a Where predicate for a LINQ2SQL query: ...Where(SqlMethods.Like(r.Name,
I am attempting to dynamically create the following using data from an array <li><a
I am attempting to create a program with a set of dynamically loaded layout

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.