Solved

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

Posted on 2008-06-17
6
956 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

747 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

16 Experts available now in Live!

Get 1:1 Help Now