Solved

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

Posted on 2008-06-17
6
960 Views
Last Modified: 2011-08-18
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
Comment
Question by:AkhilBMin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:sajay_j
ID: 21810492
Could you please send the codes within page or URL?
0
 
LVL 1

Author Comment

by:AkhilBMin
ID: 21810648

<!-- 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
 
LVL 4

Expert Comment

by:sajay_j
ID: 21810730
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!

 
LVL 4

Expert Comment

by:sajay_j
ID: 21810736
<div id="divInvalidPwd" runat="server" visible="visible">
</div>
0
 
LVL 1

Author Comment

by:AkhilBMin
ID: 21811033
i actually need to put the css rulesets in an external .css file.
0
 
LVL 1

Accepted Solution

by:
AkhilBMin earned 0 total points
ID: 21819383
using CLASS selector solved the problem, rather using ID selector !
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hiding Adsense on Mobile Devices 2 46
How to get CSS styled menu to maintain the open selected menu? 13 44
alert on input text 2 23
Clear input text 15 26
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

740 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