May 7, 201016 yr Please help, im trying to add a link into html that wont overwrite my css... I have this in the html <div id="banner"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Css Letterpress and Drop Shadow</title> <link href="custom.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="letterpress"> <h1>text here</h1> </div> </body> </html> </div> I then have all the css style for letterpress in custom css, this all works fine until I add <a href="{{store url="home"}}"> within the banner div, then it changes the text style to grey, because I have "a" as another text style earlier in the css. I cant work out how to create a link without using "a" in the <a href I would like to have it so that the whole banner is a link to "home" but when i do this, the "a" messes up the text style... any help would be great, Thanks!
May 7, 201016 yr Hi if you mean you are try doing something like this <div id="letterpress"> <h1>text here</h1> <a href="#"></a> </div> why not set the css to it like #letterpress a{ color:pink } of course you could do something similar on the actual <a> tag that is messing it up further up the page just be a little more specific when you set the css rules Cheers Ysuran
May 7, 201016 yr Only guessing, but you can use an inline style or a class. Inline: <a style="color: red;">Link Here</a> Class: .bannerlink {color: red; } <a class="bannerlink">Link Here</a> Otherwise I am not sure what you are reffering to I am afraid.
May 8, 201016 yr Author Hi, Thanks, very helpful comments. I have managed to get exactly what I want by adding a more specific css to the link inside the letterpress div: #letterpress a{ color:pink } Thanks for that Ysuran. This works perfect in Safari, the whole banner and the text within the letterpress div inside the banner image is the link. However in Firefox it is just the text that is the link, and the banner image is not a link!! strange, but the styling is the same in both, so that is perfectly good enough. Next time I think I will set it up properly from the start with inline styling. Cheers, Hecsmac
Create an account or sign in to comment