Alaric Posted November 4, 2003 Posted November 4, 2003 Simple Question: My asp:inkbuttons always apear blue when I run my aspx whatever colour I set them at design time. Why is this? Quote
Moderators Robby Posted November 4, 2003 Moderators Posted November 4, 2003 Do you mean like a default hyperlink blue? If so, you can add css styles to it. Quote Visit...Bassic Software
Alaric Posted November 4, 2003 Author Posted November 4, 2003 yeah, we have a css where the color for linkbuttons is set to navy, but I set the HTML tag attribute to white (which is the color we want a handful of our links to be) but it had no effect. By my understanding of style sheets (which is slim) I thought that attributes overrode anything from the css? I then tried defining new selector lower down in my css and associating that to my linkbuttons, but again it had no effect. I'm sure the problem is my understanding of style sheets... Quote
Moderators Robby Posted November 4, 2003 Moderators Posted November 4, 2003 Yes, On most controls attributes override the css, but I beleive that the LinkButton gives css priority. Set the CssStyle of the LinkButton to "SomeClass" then in the css copy/paste the 4 A:Link,A:Visited etc.... to a new section of the css file and change each of the 4 to this.... A.SomeClass:link, A.SomeClass:Visited, etc... Of course once you have copied all four you can then change their colors and so on. Quote Visit...Bassic Software
Alaric Posted November 4, 2003 Author Posted November 4, 2003 Excellent that worked, thanks very much By the way I was wrong about the attribute not overriding the css so I could have done it that way but it is much better to use the css. What we would like to do is have differnect css files for the different 'pages' of our website, but it is based on IBuySpy so it reality we only have one page and lots of user controls. So do you know away of having different stylesheets for different usercontrols? Quote
Moderators Robby Posted November 4, 2003 Moderators Posted November 4, 2003 Include this in the head section of any aspx page... <link type="text/css" rel="stylesheet" href="CSS/Styles.css" /> Quote Visit...Bassic Software
Alaric Posted November 4, 2003 Author Posted November 4, 2003 I want different css's for each asCx that can be displayed in my aspx, if that makes sense... Quote
Moderators Robby Posted November 5, 2003 Moderators Posted November 5, 2003 I don't think you can have an aspx and the added ascx use different css files because they both render to the single page. They can however share the same css file. You may consiider having a css file per application or even section of an application. Quote Visit...Bassic Software
Alaric Posted November 5, 2003 Author Posted November 5, 2003 yeah I think if I'm clever with the sub-classing and stuff I can get it working like I want anyway thanks for all your help Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.