473,320 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

problem with style sheets

Hi boss,

I am adding style sheets in my project . I have created a style for labels.
I linked it to my web page and used. Now the problem is for the first page load , my style sheet attributes are applying. If i select some option in the page and submit , the styles of labels are changing....

Can anybody help me in solving this problem. Style i used for labels is
Expand|Select|Wrap|Line Numbers
  1. .labelStyle
  2. {
  3.     font-family: 'Times New Roman' , Times, serif;
  4.     font-size: medium;
  5.     font-weight: bolder;
  6.     font-variant: normal;
  7.     color: Background;
  8.     margin: 10px;
  9.     text-transform: none;
  10. }
In the aspx page i used like
Expand|Select|Wrap|Line Numbers
  1. <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
  2.  
  3. <asp:Label ID="lbAdmissionNumber" runat="server" CssClass="labelStyle" Text="<%$ Resources:Resource,  AdmissionNumber %>"></asp:Label></td>
I will be thankful to you if you tell how to apply stylesheet to labels in webusercontrol page.


Thanking you boss,
May 13 '09 #1
2 1597
What do the option being selected and button being clicked do?
May 13 '09 #2
Frinavale
9,735 Expert Mod 8TB
@vinod allapu
Hi Vinod Allapu,

You need to add the link for the style sheet to the head section of your aspx page:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head id="Head1" runat="server">
  4.     <title></title>    
  5. <!-- Added link to style sheet here -->
  6.     <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
  7. </head>
  8. <body>
  9.     <form id="Form1" runat="server" autocomplete="off" style="height:100%;width:100%;">

You should not have any problem applying any of the classes defined in the style sheet to your Labels (or other elements).

Your style is invalid though so this might explain why it's not working for you. You cannot set the color: Background. You need to set it to some color:

Expand|Select|Wrap|Line Numbers
  1. .labelStyle
  2. {
  3.     font-family: 'Times New Roman' , Times, serif;
  4.     font-size: medium;
  5.     font-weight: bolder;
  6.     font-variant: normal;
  7. //will set the text color to red
  8.     color: #C00000;
  9. //will set the background color to Green
  10.         background-color: #009900;
  11.     margin: 10px;
  12.     text-transform: none;
  13. }

@vinod allapu
Are you using Ajax on the page?


Cheers!

-Frinny
May 13 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Geoff Cox | last post by:
Hello, I publish some web pages using large fonts and would like to give the user the opportunity to print the pages using a smaller font. I believe that this is possible using different style...
3
by: Phil Thompson | last post by:
does it matter in which order i place different style sheets i.e. <link rel="stylesheet" type="text/css" media="screen" href="style/screen.css" /> <link rel="stylesheet" type="text/css"...
12
by: relaxedrob | last post by:
Hi All! I have a page with with the following style information: <link rel="stylesheet" type="text/css" href="/eEmployment/eTech.css" /> <style type="text/css"> DIV.Application {...
33
by: LRW | last post by:
http://gto.ie-studios.net/index.php When you view the above site in IE, if the 1st of the three product images is tall enough to push the cell down a couple of pixels, IE somehow doesn't show...
3
by: Leslie A Rhorer | last post by:
Hello all, I am quite new to HTML, and I have created a number of pages related to a project on which I am working. Several of the pages look just the way I want with the default font settings...
12
by: Jarno Suni | last post by:
I want a device to use styles given for media type handheld and not the styles given for media type screen, if the device supports media types handheld and screen. Is it possible without writing...
9
by: Radium | last post by:
Cascading Style Sheet is an extreme hazard to your privacy. It allows others on the internet to see your monitor and files. It allows them to copy images on your monitor to their computers. It...
1
by: mscertified | last post by:
Can anyone explain how references to style sheets work, I've exhausted looking in help, its all so confusing. I have three style sheets in my project under 'Style Sheets'. Only the first style...
0
by: JohnK82 | last post by:
Hi guys I have a webcontrol that displays an article in multiple parts. You can jump back and forward between the parts (I call them sheets) by clicking on a label. Each sheet has a label. The...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a machine running IIS 6.0. I just replaced the web.config and several aspx pages in the application and now the style sheets are not working. the images from the themes work but not the css...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.