Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 969
  • Last Modified:

how can i apply external css rule to a <div runat="server">?

i've a <div> element on a .aspx page with some css rules defined in external .css file. It is working fine, but as soon as i add an attribute runat="server" inside <div>, the external css rule is not called. What could be the problem?
0
AkhilBMin
Asked:
AkhilBMin
  • 3
  • 3
1 Solution
 
sajay_jCommented:
Could you please send the codes within page or URL?
0
 
AkhilBMinAuthor Commented:

<!-- HTML Page Code -->
<div id="divInvalidPwd" runat="server" visible="false">
</div
---------------------------------------------------
/* CSS */
#divInvalidPwd{position: relative; background-color: #FDFAF1; border: solid 1px #DAD9DA; height: 50px; width: 303px;}

Open in new window

0
 
sajay_jCommented:
Apply the codes as below. Hope it would work..I am not getting any error out of it.
<!---------------------------------------------------*/
/* CSS -->
<style>
#divInvalidPwd{position: relative; background-color: #FDFAF1; border: solid 1px #DAD9DA; height: 50px; width: 303px;}
</style>
 
<!-- HTML Page Code -->
<div id="divInvalidPwd" runat="server" visible="false">
</div>

Open in new window

0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
sajay_jCommented:
<div id="divInvalidPwd" runat="server" visible="visible">
</div>
0
 
AkhilBMinAuthor Commented:
i actually need to put the css rulesets in an external .css file.
0
 
AkhilBMinAuthor Commented:
using CLASS selector solved the problem, rather using ID selector !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now