Formatting span tags in CSS

Discussion in 'CSS' started by redbrad0, Jan 19, 2009.

  1. #1
    I have two span's where one contains a hyperlink and one does not. For some reason I am having issues formatting the one thast contains the link. The link is taking format of my main css for links. Basically I want the one with the link to have the exact same formatting as the one without the link

    <span class="selectaseat_purchased" name="ticket_818873" id="ticket_818873" title="Section C Row J Seat 10">10</span>
    <span class="selectaseat_purchased" name="ticket_818874" id="ticket_818874" title="Section C Row J Seat 11"><a href="#" onclick="selectSSTicket('818874', 'Reserve');" />11</a></span>
    HTML:
    .selectaseat_purchased {
    	font-size: 6pt;
    	border: 1px solid;
    	text-align: center;
    	padding: 2px;
    	background-color: #FFBFBF;
    }
    HTML:

     
    redbrad0, Jan 19, 2009 IP
  2. Anthony Thomas

    Anthony Thomas Peon

    Messages:
    46
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    .selectaseat_purchased {
        font-size: 6pt;
        border: 1px solid;
        text-align: center;
        padding: 2px;
        background-color: #FFBFBF;
    }
    .selectaseat_purchased a {
        font-size: 6pt;
    }
    
    Code (markup):
    Should do the trick, you will need to put the colour etc.. into the .selectaseat_purchased a { } part
     
    Anthony Thomas, Jan 19, 2009 IP
  3. redbrad0

    redbrad0 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well thats the code I had and I still couldnt get it to work. So I created a blank page with only that CSS and it worked fine BUT as soon as I add in my table... It gets all out of wack again which has to be because I have a class on my tables

    <table border="0" width="100%" cellspacing="0" cellpadding="0" class="body">

    in the CSS everything for "body" is listed below. How can I make it so it does not apply the body class (but leave the class assigned to the table) or override the class settings

    .body
    {
    	FONT-FAMILY: tahoma, arial, helvetica, sans-serif;
    	FONT-SIZE:11px;
    	color: #000000;
    	text-decoration: none;
    }
    .body a:link
    {
    	FONT-FAMILY: tahoma, arial, helvetica, sans-serif;
    	FONT-SIZE:11px;
    	color: #000000;
    	text-decoration: underline;
    }
    .body a:active
    {
    	FONT-FAMILY: tahoma, arial, helvetica, sans-serif;
    	FONT-SIZE:11px;
    	color: #000000;
    	text-decoration: underline;
    }
    .body a:visited
    {
    	FONT-FAMILY: tahoma, arial, helvetica, sans-serif;
    	FONT-SIZE:11px;
    	color: #000000;
    	text-decoration: underline;
    }
    .body a:hover
    {
    	FONT-FAMILY: tahoma, arial, helvetica, sans-serif;
    	FONT-SIZE:11px;
    	color: #000000;
    	text-decoration: underline;
    }
    body {
    	FONT-FAMILY: tahoma, arial, helvetica, sans-serif;
    	FONT-SIZE:11px;
    	color: #000000;
    	text-decoration: none;
    }
    
    
    HTML:
     
    redbrad0, Jan 19, 2009 IP