Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6029967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:57:59+00:00 2026-05-23T04:57:59+00:00

I have some CSS elements based on ids of HTML elements. e.g. ul#subNav div

  • 0

I have some CSS elements based on ids of HTML elements. e.g.

ul#subNav div
{   
    /*top:45px !important;*/
    position: relative;
    visibility: hidden;
    margin: 0;
    padding: 0;
    background: #C6DEFF;
    border: 1px solid #5970B2;
    z-index:2020; 
}

Now, I cannot apply this style to a Webpage (ASP.NET Web form) based on a Master Page, since, at the time of rendering, The ID of UL “subnav” changes to “ctl100_subnav” and hence browser no longer applies the CSS.

Any idea to overcome this?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:58:00+00:00Added an answer on May 23, 2026 at 4:58 am

    Add a class to the SubNav div and apply CSS to the class and not to the ID.

    Or you are using .net 4

    In order to avoid naming conflicts in controls, ASP.NET 2.0/3.5 used ClientID’s, which made each control generate the id attribute unique to that page. However these ID’s generated were long and unpredictable. Developers who have been doing Client-Side programming using a scripting language like JavaScript, have sorrow tales to tell when it came to referencing those ClientID’s in their scripts.

    ASP.NET 4.0 through the new ClientIDMode property, now gives control back to the developer over the ClientID’s generated by ASP.NET controls. In my personal opinion, this was a good design decision taken by the ASP.NET team, since a lot of ASP.NET developers are using Client-side programming to enhance their interfaces and popular JavaScript frameworks like jQuery are getting more popular.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to discriminate some page elements (image, css, ...) on the base of
I am setting the background-image of some elements using css (some elements have no
I've been working with a developer on a web-based application. I have some experience
I have a number of CSS attributes and Classes which get applied based on
I have div with a table inside. Inside the td elements of the table,
We have a page that ordinarily has two elements arranged side-by-side. Despite exploring a
I've copied some text nodes from the page (i.e., live DOM) and have stored
Have you noticed that by using jquery's slideDown(), even on elements with dynamic content,
I'd like to use CSS Attribute Selector to apply a class to some spans,
I have a table with many rows of data, and I want to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.