StyleSheets in ASP.NET

Posted on 2005-05-02
Last Modified: 2010-04-06

I have this stylesheet "StyleSheet1.css". To inform u, i am doing the rest of working in Asp.Net using C#.











I have included this on a .aspx page like

<LINK href="StyleSheet1.css" type="text/css" rel="stylesheet">

Now the problem for about 20 links is that i don't want this stylesheet to take effect since making them bold on hovering over them just shifts other things on the pages. So i don't want this style sheet to take effect for some links(since it doesn't look good). However there are a large no of links that i want stylesheet for. So is there anyother way to go for except for CSSClass Property? Please do explain your answer with code, if possible. Thanks


Question by:theNab
    1 Comment
    LVL 49

    Accepted Solution

    You could assign a container <div> object, give it an id/class and add additional css rules:

    div#menu a:hover {font-weight:normal;}

    Likewise you could assign a class to the <a> tags: <a class="nobold">. You would then add a new rule to the stylesheet:
    a.nobold:hover {font-weight:normal;}


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: HTML5 Specialist

    HTML5 development skills are critical to all developers. HTML5 is the foundation to almost any development process. That's why business, design studios, development shops and other organizations need HTML5 developers. Get your foot in the door as a HTML5 specialist.

    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now