Skip to main content
Gareth_Williams
Inspiring
July 3, 2024
Answered

Text Class Properties on CSS Not Working!

  • July 3, 2024
  • 2 replies
  • 1333 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
    Adobe 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 &amp; Moderator
    Adobe 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

    Can anyone explain why the text “24th of September 2024” isn’t white like the rest of the links on the page? The ones at the top? Basically what I want to do is have that text grey and control the link colours with the code above. Thanks again.

    BenPleysier
    Adobe Expert
    July 4, 2024

    I do not know if the following answers your question, but this is what I see:

     

    The first link is styled as

     

    The second link

     

    And the third link

     

    Having said that:

     

    I assume that you are using a very very old version of Dreamweaver. DON'T!!!

     

    For the heading

     

    you could use

        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Rubik+Scribble&display=swap" rel="stylesheet">
    

    The style rule

    .rubik {
        font-family: "Rubik Scribble", system-ui;
        font-weight: 400;
        font-style: normal;
    }
    

     And HTML

    <h1 class="rubik text-danger fw-bold text-uppercase">Join us at your nearest live music venue &hellip;</h1>

     

    Notice that I did not use upper case for the heading text. This is because it confuses assistant technology. The upper case conversion is done using Bootstrap CSS

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!