473,400 Members | 2,145 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,400 software developers and data experts.

CSS and textbox

This is my first attempt at working with style sheets so I am probably
missing something obvious.

I created a default ASP.NET Web Application and added 3 elements to it, a
label, a text box, and a hyperlink.

I changed the default style sheet to have the label color be purple (added
color: purple; to the Body {}).

I changed the hover for the hyper link to lime (changed color: lime; in the
A:hover {})

But what I cannot figure out is the text box entry area. I modified the
TextBoxLabel{} and the TextBoxStyle{}, even added the TextBox{} to the css
file to no avail.

I set the CssClass property to TextBox thinking that was where I was going
wrong.

using ASP.Net 1.1 and VS 2003.

Thank you in advance.
Jan 24 '06 #1
3 2561
TB
I am not an expert on this, but I can tell you that I have succesfully
used a style sheet to format textbox to define for example font
properties and textbox height. Like this:

In page.aspx:

<asp:textbox id="txbTest" CssClass="textbox"
Runat="server"></asp:textbox>

In Styles.css:

..textbox
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-style:normal;
height:18px;
}

Cheers

TB

Jan 24 '06 #2
Asp.net translates aspx pages to html and css rules apply to html pages, not
to aspx ones. There is no TextBox in html. It becomes, or renders as, an
html control of <input type="text" ...>. You can either declare styles for
<input type="text"> or use
CssClass attribute as another poster is suggesting.

Eliyahu

"Stephen Costanzo" <sx********@hotmail.com> wrote in message
news:uk**************@TK2MSFTNGP15.phx.gbl...
This is my first attempt at working with style sheets so I am probably
missing something obvious.

I created a default ASP.NET Web Application and added 3 elements to it, a
label, a text box, and a hyperlink.

I changed the default style sheet to have the label color be purple (added
color: purple; to the Body {}).

I changed the hover for the hyper link to lime (changed color: lime; in
the A:hover {})

But what I cannot figure out is the text box entry area. I modified the
TextBoxLabel{} and the TextBoxStyle{}, even added the TextBox{} to the css
file to no avail.

I set the CssClass property to TextBox thinking that was where I was going
wrong.

using ASP.Net 1.1 and VS 2003.

Thank you in advance.

Jan 25 '06 #3
Thank you both for your suggestions.

The thing I was missing was the <period> before the class name. inserting
the period allowed it to work. Eilyahu thank you for providing the alternate
way so I don't have to always put a CssClass attribute in for each of the
text boxes.
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:en**************@TK2MSFTNGP12.phx.gbl...
Asp.net translates aspx pages to html and css rules apply to html pages,
not to aspx ones. There is no TextBox in html. It becomes, or renders as,
an html control of <input type="text" ...>. You can either declare styles
for <input type="text"> or use
CssClass attribute as another poster is suggesting.

Eliyahu

"Stephen Costanzo" <sx********@hotmail.com> wrote in message
news:uk**************@TK2MSFTNGP15.phx.gbl...
This is my first attempt at working with style sheets so I am probably
missing something obvious.

I created a default ASP.NET Web Application and added 3 elements to it, a
label, a text box, and a hyperlink.

I changed the default style sheet to have the label color be purple
(added color: purple; to the Body {}).

I changed the hover for the hyper link to lime (changed color: lime; in
the A:hover {})

But what I cannot figure out is the text box entry area. I modified the
TextBoxLabel{} and the TextBoxStyle{}, even added the TextBox{} to the
css file to no avail.

I set the CssClass property to TextBox thinking that was where I was
going wrong.

using ASP.Net 1.1 and VS 2003.

Thank you in advance.


Jan 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jonas L | last post by:
Hi, I need to create a textbox which acts as a normal textbox but with the following extra requirements: 1) In-focus color, when the textbox gets focus the backcolor property of the textbox...
4
by: Rodrigo DeJuana | last post by:
Howdy, I'm new to this .net stuff and really have little to no training. Im trying to create a new page for a web form, so i have been pretty much jsut coping code. I having some issue with...
0
by: Newasps | last post by:
Hi guys, I have a problem with UpdateCommand Event. In tihs event Ä°'m creating required controls to get that controls' values and also get them. But when I try to get updated values I'm getting the...
7
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the...
11
by: Keith | last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing...
2
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
3
by: Brad Rogers | last post by:
All, Being immersed in vb.net and trying CSharp after almost a year I forgot the differences. I like vb fixing the uppercase/lowercase names and seeming to be more flexible to code entry. ...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
8
by: Marco Pais | last post by:
Hi there. How can I change the background color of a textbox when it gets the focus? I can handle the "Enter" event and do this private void txtDummie_Enter(object sender, EventArgs e) { ...
1
by: Andy B | last post by:
I have this code: protected void EditEventsWizard_NextButtonClick(object sender, WizardNavigationEventArgs e) { //get the values from the DetailsView TextBox StartTime =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.