Forums

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

Home Forums CSS Is there any difference between these two link formats?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #260853
    Cora Carter
    Participant

    I’m new at this so thank you in advance to anyone who can help me. My name is Cora and I am desperate to try to figure this out! I am making a navigation bar menu for my website using CSS and can’t figure out how to use a specific link format involved “classes.”

    Here is my question. Can you tell me if there is any difference between, or reason why, you would use one or the other of these two link formats in my navigation?

    <a href="#" class="#">
    <a class="#" href="#">

    I am just confused why one begins with ” a href class” and the other begins “a class href”

    Are they different? The same? Thank you thank you!

    #260859
    JeroenR
    Participant

    I think it’s just a matter of taste. All the attributes are being parsed before rendering the element.
    So the href tells you something about the purpose of the anchor element, while the class tells you something about how it should look.
    In my opinion the purpose is more important than the look, so I would place href before class.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.