Thread: CSS Trouble...

Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default CSS Trouble...

    Ok, I'm now making the final tweaks to my site before it goes live.

    The problem I'm having can be seen below. I'm trying to align the sub-total value to the right. So the words 'Sub-total:' remain aligned to the left, while the value is aligned to the right.



    Below is the code I'm using (in the shopping cart sidebox).

    Code:
    $content .= '<table><tr><td><span class="cartBoxSubTotal">' . BOX_SHOPPING_CART_SUBTOTAL . '</span></td><td><span class="cartBoxTotal">' . $currencies->format($_SESSION['cart']->show_total()) . '</span></td></tr></table>';
    	$content .= '<br />';
    I'm using the text-align parameter in my CSS for both of the above classes.

    Anyone able to help with this one?

  2. #2
    Join Date
    Jan 2005
    Location
    Lake Havasu, AZ
    Posts
    1,149
    Plugin Contributions
    0

    Default Re: CSS Trouble...

    Try assigning the class to the <td> rather than the text itself so that the cell for your subtotal reads <td class="cartBoxTotal">

    I believe that will fix your problem.
    When the world gets in my face I say Have A Nice Day.
    * I DO Think and I HAVE BEEN Zenned - therefore, I AM * I donate - do you?
    Custom Templates and Zen Services CRS Designs, Inc.

  3. #3
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: CSS Trouble...

    Thanks for the reply. I've already tried this, but forgot to mention that it my original post.

    Anyway... it didn't work.

    I can make the text bold, change it's colour and size, but not align it to the right!!

    Here's the exact css code used...

    Code:
    .cartBoxTotal {
    	text-align: right;
        /*font-weight: bold;*/
    	color: #939292;
    	font-size: 11px;
    	padding-right: 2px;
    	}
    I'm now running out of ideas!

  4. #4
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: CSS Trouble...

    The problem is you added a table with no width defined. Tables are only as big as what is inside them unless you tell it otherwise.

  5. #5
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: CSS Trouble...

    Quote Originally Posted by Kim
    The problem is you added a table with no width defined. Tables are only as big as what is inside them unless you tell it otherwise.
    Ok, I'll try adding a width of 100% and see if that sorts it.

    Thanks for the help. :)

  6. #6
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: CSS Trouble...

    Kim - Just to confirm... this worked a treat! Thanks. :)

 

 

Similar Threads

  1. Trouble with css images
    By cliffecm in forum Templates, Stylesheets, Page Layout
    Replies: 16
    Last Post: 14 Jul 2011, 12:08 AM
  2. CSS button trouble
    By LizzyB in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 28 Feb 2009, 06:54 AM
  3. trouble customizing css pages
    By MB1 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 24 Sep 2007, 06:51 AM

Posting Permissions

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