Forums

[resolved] What am I doing wrong? Remove underline from links inside tables (7 posts)

  1. astriv
    Member
    Posted 3 months ago #

    I've been trying to remove the underline under links inside the table by adding this to styles.css:

    [please mark any code - up to 10 lines - using the code button]

    #table {
    margin:0;
    background-color: #ff0000;
    }
    #table a{
    color:#FF0000;
    text-decoration:none;
    }
    
    #table a:hover{
    text-decoration: underline;
    }

    It's not working. There's no table code in my theme so I added that code after researching on ways to remove the underline inside tables.
    So what am I doing wrong?

    If you wanna look at my stylesheet, here it is:

    [CSS code moderated - please post a link to your site]

  2. alchymyth
    The Sweeper
    Posted 3 months ago #

    does this mean you have a html tag or html table with the css id #table in your site?

    http://www.w3schools.com/css/css_table.asp

  3. peredur
    Member
    Posted 3 months ago #

    Please do not post code like that. It's very annoying and against the forum rules. All the CSS for your site is publicly available, so a better idea is to post a link to your site.

    This also allows us to play around with the styles in Firebug.

    If you can't post a link to the site, it's very hard for us to help beyond giving general advice such as to use Firebug to find what style rules are being applied to the elements you are interested in so that you can override them in your CSS.

    From what you've posted, though, are we to assume that your table has an id of 'table' and that therefore there will only ever be one table on a page? I'm just asking, because you can only use an id once on any given page.

    I hope you're not using tables for positioning. It's not the way to do it. Positioning is done using CSS.

    HTH

    PAE

  4. astriv
    Member
    Posted 3 months ago #

    Thanks for the replies. Sorry about posting codes more than 10 lines, I was not aware of it.

    The link to my website is:

    http://showfreetv.com/how-i-met-your-mother/

    I tried determining what's causing it in Internet Explorer by pressing F12 and I also tried changing the entire text-decoration to none; in style.css and adding !important but nothing works. I don't know what's causing the underline in a:link inside the tables...but links outside the tables are fine. I'm confuse.

    I'm making tables using Tiny MCE in post section.

  5. alchymyth
    The Sweeper
    Posted 3 months ago #

    try to add at the end of style.css:

    table a { text-decoration: none; }

    for more formatting, such as :hover styles etc, see:
    http://www.w3schools.com/css/css_link.asp

    and do try to read and understand the posted links ...

  6. astriv
    Member
    Posted 3 months ago #

    I found the solution!
    I removed #

    from:
    #table

    to:
    table

    Some codes have # in them so i thought of replicating them but I was wrong
    *slaps forehead*

    Thank you for the replies.

  7. peredur
    Member
    Posted 3 months ago #

    The hash denotes an id. If you want to select an element you just use the element's name. If you want to select a class, you use a full stop. So 'table', '#table' and '.table' all mean different things:

    * The table element
    * The element with the id of 'table'
    * The element(s) in the class 'table'

    Cheers

    PAE

Reply

You must log in to post.

About this Topic

Tags