Warning: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ..../includes/class_bbcode.php on line 2083

Warning: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ..../includes/class_bbcode.php on line 2083
CSS Problem
Results 1 to 6 of 6

Thread: CSS Problem

  1. #1
    Registered Mike's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    2,755

    CSS Problem

    Hi all,

    I've got the following CSS:

    HTML Code:
    a.reviewbuttons:link {
    background:#052220;
    border-style:solid;
    border-width:1px;
    width:100%;
    }
    a.reviewbuttons:visited {
    background:#052220;
    border-style:solid;
    border-width:1px;
    width:100%;
    }
    a.reviewbuttons:active {
    background:#052220;
    border-style:solid;
    border-width:1px;
    width:100%;
    }
    a.reviewbuttons:hover {
    background:#052220;
    border-style:solid;
    border-width:1px;
    width:100%;
    }
    I've made a few links which have this as their class. However, whatever I set it to, the width never changes. It's always just the same size as the text length itself.

    Could someone help me please? I want the width to be 100%...

    Oh and, the links are in <td> tags...

    Cheers,
    Mike
    Don't you just love free internet games ?

  2. #2
    Future AstonMartin driver r2d2's Avatar
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,608
    Hey Mike,

    You need to add display:block; to the list - links are 'inline' elements, which means they ignore any width commands.

    Also, you don't need to repeat all the commands for the different <a> types. Just put them first as the root element, then add any changes you want to occur for the different states.

    HTML Code:
    a.reviewbuttons {
     display:block;
     background:#052220;
     border-style:solid;
     border-width:1px;
     width:100%;
     color:#FFF;
    }
    a.reviewbuttons:link {
    }
    a.reviewbuttons:visited {
    }
    a.reviewbuttons:active {
    }
    a.reviewbuttons:hover {
    border-color:#0F0;
    }

  3. #3
    Do you have the rest of the html and css code? There may be something else throwing it off in your css document or even in you html code. If you have it uploaded please post a link.

  4. #4
    Working. Masetek's Avatar
    Join Date
    Aug 2005
    Location
    Aust
    Posts
    543
    You may also want to use margin and padding to set the size of the background. Padding with increase the space between the link and border.

  5. #5
    Registered Mike's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    2,755
    Yup, that worked r2d2, cheers mate
    Don't you just love free internet games ?

  6. #6
    I'm the oogie boogie man! James's Avatar
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    1,566
    You may also want to use margin and padding to set the size of the background. Padding with increase the space between the link and border.
    Using padding'd mean that he'd be stuck with a bunch of links with dissimilar widths.

Similar Threads

  1. viewing problem
    By fellboyzs in forum HTML, CSS, Layout, and Design
    Replies: 2
    Last Post: 05-05-2004, 06:15 PM
  2. Search Engine Friendly URLs Problem
    By cameron in forum Search Engine Optimization
    Replies: 5
    Last Post: 02-24-2004, 08:43 PM
  3. Problem with my links
    By Mike in forum HTML, CSS, Layout, and Design
    Replies: 3
    Last Post: 11-15-2003, 03:25 PM
  4. Language Problem:(
    By Mike in forum General Chat
    Replies: 3
    Last Post: 11-06-2003, 09:33 AM
  5. My Problem
    By Chris in forum General Chat
    Replies: 10
    Last Post: 08-30-2003, 12:59 PM

Bookmarks

Posting Permissions

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