Solved

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

Posted on 2008-06-17
6
957 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Max-width on individual images in grid 4 52
alert before form submission 6 32
Host asp.net pages 5 26
Problem with a CSS in a page 2 27
This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 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

22 Experts available now in Live!

Get 1:1 Help Now