Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #688980

    Hi

    I am trying to style text in a table to make some of the text red with HTML but as an example when I use the HTML below only the first option is red and the rest is black. Is there a better solution to make some text a different colour in a table. Many thanks.

    <p style=”text-align: left;”><span style=”color: #a81010;”>CONTACT</span>
    <span style=”color: #a81010;”> FACEBOOK</span>
    <span style=”color: #a81010;”> TWITTER</span></p>

    #689028

    did you use copy paste from f.e. word ? because it seems that there is something with your quotes not working.
    Try inserting this:

    <p style="text-align:left"><span style="color:#a81010">CONTACT</span>
    <span style="color:#a81010">FACEBOOK</span>
    <span style="color:#a81010">TWITTER</span></p>

    by the way – this should work as well:

    <p style="text-align:left; color:#a81010"><span>CONTACT</span>
    <span>FACEBOOK</span>
    <span>TWITTER</span></p>

    to your question if you only want to make one word in a different color – the inline css method is best
    if you have this very often – you can create a custom class for it like :

    .red {
    text-transformation: upperclass;
    color: #a81010;
    letter-spacing: 1px;
    }

    than you only have to do:

    <p class="red"><span>contact</span>
    <span>facebook</span>
    <span>twitter</span></p>

    if you have to colorize all in that table or only every 2nd, 3rd etc field there are selectors which might help (nth-child selectors)

    #689066

    Thanks Guenni007

    That’s helpful but I think I see the issue now – when I apply my href link the style is overridden by the link style so the red disappears again. So I am looking to remove/alter the link styling to keep the text red.

    Any help appreciated.

    #689068

    I can have been able to see in other posts to change the link color but I just want to change it for this table text (not for all links) and can not see how to do this?

    #689070

    so you have a link on those Twitter … ?

    by default an inline css should overwrite all styles – but try please first with important:

    
    <p style="text-align:left; color:#a81010 !important"><span>CONTACT</span>
    <span>FACEBOOK</span>
    <span>TWITTER</span></p>

    edit : does not work so

    give the table a custom class f.e. nolinkcolor and than via quick css

    .nolinkcolor a {
        color: inherit !important;
    }

    and to make it visual that there is a link you can show an icon after those links:

    .nolinkcolor a::after {
        content: " \00a0 \e822";
        font-family: entypo-fontello;
    }
    • This reply was modified 8 years, 3 months ago by Guenni007.
    #689143

    Thanks so much Guenni007

    Unfortunately still not working for me. As soon as I add the link text goes black.

    #689241

    and you have done the custom class on the table?

    http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/

    did you realy read all i wrote on thread before?

    see result here – allthough there is a link on contact it is red font color and to show that there is a link after the link an icon (you don’t need that – but how should visitors know that there is a link if no difference between the other table element is seen)

    http://webers-testseite.de/elegant/table-with-links-inside/

    #689466

    Hi Guenni007

    Yes to custom class (great feature) but I think you have the solution as I was breaking it using <strong> tags. Should have used the ‘code’ post feature in the first post. When I took the <strong> tags out it worked straight away and then I added bold to the <p> as html below.

    Thank you so much Guenni007 your perseverance has been invaluable and hopefully this post may also help others. Finally to answer an earlier question I created the code using the WordPress Visual Editor to create colours, bold and alignment and then copied the code from the WortPress text editor. I can see not a good idea now.

    <p style="text-align:left;font-weight: bold;">
    <span style="color:#a81010"><a href="URL">CONTACT</a></span>
    <span style="color:#a81010"><a href="URL">FACEBOOK</a></span>
    <span style="color:#a81010"><a href="URL">TWITTER</a></span>
    </p>
    
    • This reply was modified 8 years, 3 months ago by philoakley.
    #689479

    yes strong has its own rule so we than had to set a rule similar to

    .nolinkcolor a {
        color: inherit !important;
    }
    #690285

    Hi,

    Please try adding following code to Quick CSS

    .main_color a,.alternate_color a { color: inherit !important; }

    Best regards,
    Yigit

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.