• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 967
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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