Skip to main content
Gareth_Williams
Inspiring
July 3, 2024
Answered

Text Class Properties on CSS Not Working!

  • July 3, 2024
  • 2 replies
  • 1400 views

Hi everybody, I've got a text class where I haven’t defined a font family or size because your want the default font and size. I’ve just defined a colour. However, on this class other code to control the link colours doesn’t work. On the other class which does have a font family and size defined “.Venue” the code below in dark red controls the link colour, hover mouse over, click down and visited link colours.

.Venue {
font-family: Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", serif;
font-size: 20px;
color: #999999;
}
.Venue a:link{
font-weight: bold;
color: #999;
}
.Venue a:visited{
color: #999;
}
.Venue a:hover{
color: #666;
}
.Venue a:active{color: #FFFFCC;}
.Venue a:focus{color: #FFFFCC;} /**adjust colors to suit**/

However, with the class “.Date” that doesn’t have a font family and size defined all that code doesn’t do anything! As well as that without the extra code the normal link settings that apply to the rest of the page don’t work either. As you can see in the linked file, the default colours only apply to the line under the text! This makes our band look very incompetent! Can anybody help? Thanks.

.Date {
color: #999999;
}

Here is the file … http://www.maximum-robot.co.uk/live.html

    This topic has been closed for replies.
    Correct answer osgood_

    Thanks Ben, I can’t work out the point you’re making from the pictures. I guess I’m missing something pretty obvious! I’ve uploaded the file again without the link and taken the bold off to avoid any extra complications. I’ve also turned the table white so I can see what I’m doing in DW! Would anybody know what I would need to do to control the link properties on that text with the class “.Date”? The other two classes with links “.Venue” and “.Support Band” are controlled by the dark red code above. Thanks again for your help.

    http://www.maximum-robot.co.uk/live3.html


    quote

    Would anybody know what I would need to do to control the link properties on that text with the class “.Date”?


    By @Gareth_Williams

     

    Well you would move the class name 'Date' from the span tag to the td cell that the link tag is in, exactly like you have for Venue.

     

     

    <td align="center" valign="top" class="Date" style="white-space: nowrap; color: #999999;"><a href="https://railwayinn.pub/shows/maximum-robot-2024-07-02" target="_blank"><strong><span style="white-space: nowrap">24th of September 2024</span></strong></a></td>

     

     

    Then you can do what you like to style the link:

     

    .Date a {
    color: pink;
    }
    .Date a:hover {
    color: orange;
    }

    2 replies

    Nancy OShea
    Community Expert
    Community Expert
    July 4, 2024

    You should be sleuthing out styles with your browser's Inspect Element (F12) panel by now.

    Firefox and Chrome both have one.

     

     

    Nancy O'Shea— Product User & Community Expert
    Community Expert
    July 3, 2024

    Can you share an image of what you are expecting to happen on that page?

     

    Based on what I am seeing the date just has the color that you are setting, and the a element that is around the date span, is inheriting the default settings of a link with a an underline text decoration and text decoration color. Personally I don't see the need for the strong/span tags inside of the a because the date class on an a element should be enough to provide you with styling to get you the desired look and feel.

    Gareth_Williams
    Inspiring
    July 3, 2024

    Thanks Ben, removing the strong tags takes the bold off. However, this doesn’t make any difference to anything else. Apart from the line under it, the text still does not appear the default colour for the page links which is white. If I just use the default font and size without any class and change the colour in the properties window I don’t know who to control the link colour. Anyway, I will experiment and update the thread when I can. Thanks again.