pjdevins@yahoo.com Posted September 30, 2009 Report Share Posted September 30, 2009 Hi, I have been reading a lot of tutorials and researching CSS for the past week and I feel like I am just not getting it. Maybe I'm just missing a key concept or something or I just may have it all wrong. I thought the whole concept was that I could use CSS to apply formatting to all of the elements in my page in one place without having to repeat the same code over and over again. I develop web applications in .net and I have been tasked with trying to combine about 10 different applications into one and make them all have the same color scheme. I though I could set up a CSS file to make all of the data grids, buttons, drop downs and other user controls look the same and at the same time format the application without using tables. I am having problems with understating how to write the CSS for anything other than div, , a , etc. I feel like I almost understand what to do, but it is just not coming together for me. Okay so I have rambled on and I don't even know if I am asking the right type of question. Can anyone help? ---Dazed and confused. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted September 30, 2009 Report Share Posted September 30, 2009 Sounds like you have the basic concept of CSS correct -- it is used to apply styling to elements of the website in one place. However, CSS just effects visual styling -- not the underlying structure of the code. For example, in order to change a site from a table based layout to a div based layout, you have to do more than CSS changes. You would need to go into the code of the site and recode it using divs rather than tables, and then adjust the CSS styling. Also, a lot of CSS requires you to add classes or id's to your code, so that CSS can be used to target just that element. That would require you to go into the original code and add classes/ids as necessary. Then, you can properly target those elements using CSS: .class { css code here... } #id { css code here... } Quote Link to comment Share on other sites More sharing options...
pjdevins@yahoo.com Posted October 2, 2009 Author Report Share Posted October 2, 2009 Thank you very much. I have learned that CSS and ASP.net don't necessarily play well together like I thought they would. So I am off to learn about themes and custom adapters. I think it is going to be more work than I originally thought, but well worth it from a maintenance perspective. :cool: Quote Link to comment Share on other sites More sharing options...
pjdevins@yahoo.com Posted October 2, 2009 Author Report Share Posted October 2, 2009 (edited) One more question. This may sound like a stupid one, but what is the differnce between the "." and the "#" when creating the classes? Edited October 2, 2009 by pjdevins@yahoo.com Quote Link to comment Share on other sites More sharing options...
Andrea Posted October 2, 2009 Report Share Posted October 2, 2009 The "." in your CSS is used for a class in your HTML, and the "#" for an ID. Classes can be used multiple times, but IDs can only be used once per page. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted October 2, 2009 Report Share Posted October 2, 2009 I have learned that CSS and ASP.net don't necessarily play well together like I thought they would. Explain this further? They should work together just fine... I do it all the time at my job. We do a lot of work with ASP.NET. Quote Link to comment Share on other sites More sharing options...
pjdevins@yahoo.com Posted October 7, 2009 Author Report Share Posted October 7, 2009 Well I was trying to use CSS to format all of the asp: link buttons the same you can't do that with css but you can with a theme. Since allof the applications I am trying to merge rely more on ASP control than on html elements, I have to make use of themes to have the same effect. Is there some other what to do it? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted October 7, 2009 Report Share Posted October 7, 2009 Ah, that makes sense. Probably faster to use themes in that case. You can do it via CSS, but would probably have to go back and add class names for your buttons/other elements by hand. Quote Link to comment Share on other sites More sharing options...
pjdevins@yahoo.com Posted October 8, 2009 Author Report Share Posted October 8, 2009 Darn! I was hoping you were going to say I was wrong . Quote Link to comment Share on other sites More sharing options...
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.
Note: Your post will require moderator approval before it will be visible.