Perhaps the most important thing to notice about this snippet of code is that we’ve added a class, which I’ve generically labeled “button.” There are a couple of reasons for this.įirst of all, we need a way to target and style this button in our CSS without necessarily targeting all of the anchor tags on the page. If we wrapped this in a div and styled that, only the text part of the button would be a link, meaning that the user could conceivably click the button with no result. In the above example, our entire element will be the link. This is completely unnecessary though and can create problems with both the click and the hover. Using this flawed logic, I would wrap my anchor in a div and then apply most of the styling to the div. One problem that I used to come across when I first started coding is that I would often think that I needed a div to create anything.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |