Solved

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

Posted on 2008-06-17
6
958 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

803 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