Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Two CSS questions

    Hi,

    I am using the following function to build a DIV automatically:
    Code:
    function Style(zxcele,zxcstyle,zxctxt){
     if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
     for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
     if (zxctxt){ zxcele.appendChild(document.createTextNode(zxctxt)); }
     return zxcele;
    }
    I am trying to build a layer with rotated text using the style element writing-code:

    Code:
    var y_axis_text =Style('DIV',{position:'absolute',left:(-fs*6)+'px',top:(ch/3)+'px',width:'10px',height:'1px',color:'black',fontSize:(fs + 2)+'px',writing-mode: 'tb-rl'}, "No. of Reps");
    FrontPage gives me an error regarding missing ":".
    If i change the syntax to:

    Code:
    var y_axis_text =Style('DIV',{position:'absolute',left:(-fs*6)+'px',top:(ch/3)+'px',width:'10px',height:'1px',color:'black',fontSize:(fs + 2)+'px',"writing-mode": 'tb-rl'}, "No. of Reps");
    Then the text is not rotated.
    Any hints why??

    Second question is regarding text alignment to the left. Can you provide me to the right Style syntax to align text to the left in a DIV?

    Million Thanks!
    Last edited by rmedek; 12-22-2006 at 06:13 PM.

  • #2
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    For the second one, text-align: left; (which is the default) sets text to align to the left within a div.

    For the first, ain't got a clue
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools

  • #3
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    That first question really doesn't have anything to do with CSS. Come up with a better title and I'll move this to the Javascript forum for you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •