Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Design can't remove my H1 link underline, please help

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #264067
    Laszlo
    Participant

    can’t remove my H1 link underline, please help :)
    I tried writing text-decoration: none; in id# and .class as well, unfortunately, id didn’t work.

    please give me some ideas.
    link https://codepen.io/Laszlo226/pen/dJMqLE

    #264075
    Paulie_D
    Member

    You’re using the .h1 and .a as selectors which are for classes.

    But you haven’t applied those classes. Use h1 and a (no preceding period/fullstop). Those are element selectors.

    #264076
    Paulie_D
    Member

    You also had a couple of other errors li#nav for instance instead of #nav li

    https://codepen.io/Paulie-D/pen/JMXQvW

    #264120
    Laszlo
    Participant

    Thank you again for the help :)

    #264122
    Laszlo
    Participant

    One more question #Paulie_D how do I make the h1 color black?

    #264124
    Paulie_D
    Member

    It’s automatically black (unless you have set some other color elsewhere)…however because the text is actually in a link it has default color imposed which are basically blue until changed.

    So h1 a {color:black;} should work.

    https://codepen.io/Paulie-D/pen/JMXQvW

    #264141
    Laszlo
    Participant

    One more thing I am trying to position a p element but first I want to make a border around it. border: 20px; is not working. Please help.
    https://codepen.io/Laszlo226/pen/GyqORm

    #264181
    Shikkediel
    Participant

    The shorthand border property needs three values – width, style and colour. You only have one.

    #264184
    Paulie_D
    Member

    Didn’t I cover this already?

    Oh, I did

    It seems you aren’t paying attention.

    Honestly, I think you really need to research more before using selectors and properties without knowing what they mean or how they work.

    #264205
    KRoweDev
    Participant

    Part of the reason that this is more difficult than it should be is that you aren’t using the semantically best tags. Header tags should be reserved for actual page headers. HTML 5 had a tag specifically for menus for a short time but that will not be making it to the final specification (so don’t use them if you find information about them while looking for examples on the web). For now, the best option is to use unordered lists. This won’t fix your color issue but it should reduce the amount of CSS you need to configure the other font settings. Your basic menu should look something like this:

    <ul>
      <li><a href="item1.html">Item 1</a>
      <li><a href="item2.html">Item 2</a>
      <li><a href="item3.html">Item 3</a>
    </ul>
    

    Your style definitions should look like this:

    ul {
        list-style-type: none;
        margin: 0;
        padding: 0;
        width: 200px;
        background-color: #f1f1f1;
    }
    
    li a {
        display: block;
        color: #000;
        padding: 8px 16px;
        text-decoration: none;
    }
    
    /* Change the link color on hover */
    li a:hover {
        background-color: #555;
        color: white;
    }
    
    
Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Design’ is closed to new topics and replies.